Skip to content

Show complete help text for dagshub repo create - #716

Open
Muhtasim-Munif-Fahim wants to merge 2 commits into
DagsHub:mainfrom
Muhtasim-Munif-Fahim:fix/repo-create-help-text
Open

Show complete help text for dagshub repo create#716
Muhtasim-Munif-Fahim wants to merge 2 commits into
DagsHub:mainfrom
Muhtasim-Munif-Fahim:fix/repo-create-help-text

Conversation

@Muhtasim-Munif-Fahim

Copy link
Copy Markdown

Fixes #310.

The listing

click builds a command listing entry from the first line of the docstring. For create that line is create a repo and optionally:, so the listing ends on a dangling colon and reads exactly as #310 reports — as if the output were cut off:

Commands:
  create  create a repo and optionally:

An explicit short_help on the command makes it a complete sentence:

Commands:
  create  Create a repo, optionally uploading data to it and cloning it
          locally

The long help

While reproducing this I found dagshub repo create --help is mangled too. The bullet list and the examples are pre-formatted, but nothing told click so, and it rewrapped them:

  - upload files to 'data' from a URL dir using `-u` flag. .zip and .tar files
  are extracted,   other formats copied as is.

  example 2:  dagshub --host "https://www.dagshub.com"                 repo
  create mytutorial2 -u "http://0.0.0.0:8080/index.html" --clone --verbose

Note the lost indentation on the continuation line and the collapsed run of spaces in example 2. Adding click's \b no-rewrap markers keeps the structure:

  - upload files to 'data' from a URL dir using the `-u` flag.
    .zip and .tar files are extracted, other formats are copied as is.
  - clone the repo locally using the `--clone` flag.

  Example 1:
    dagshub repo create mytutorial -u "http://example.com/data.csv" --clone

  Example 2:
    dagshub --host "https://www.dagshub.com" repo create mytutorial2
      -u "http://0.0.0.0:8080/index.html" --clone --verbose

I treated that as part of the same complaint since it is the same help output, but happy to split it out if you would rather keep the PR to the listing alone.

Tests

Adds tests/common/test_cli.py — as far as I can tell the first CLI test in the suite — using click.testing.CliRunner to assert the listing carries a complete summary and that the bullets and examples survive rendering. Both fail without this change.

tests/common plus tests/test_misc.py is 50 passed. tests/common/test_determine_repo.py fails to collect on my machine for want of pytest_git, which is unrelated and reproduces on a clean checkout.

Verified against click 8.4.2.

🤖 Generated with Claude Code

`dagshub repo --help` derived the command listing from the first line of the
`create` docstring, which is "create a repo and optionally:". The listing
therefore ended on a dangling colon and read as truncated output:

    Commands:
      create  create a repo and optionally:

Giving the command an explicit `short_help` makes the listing a complete
sentence.

The long help was mangled too. The bullet list and the examples are
pre-formatted, but nothing marked them as such, so click rewrapped them into
run-on paragraphs and collapsed the indentation:

    - upload files to 'data' from a URL dir using `-u` flag. .zip and .tar files
    are extracted,   other formats copied as is.

Adding click's `\b` no-rewrap markers keeps the structure intact.

Adds tests/common/test_cli.py, the first CLI test in the suite, asserting the
listing carries a complete summary and that the bullets and examples survive
rendering. Both fail without this change.

Fixes DagsHub#310

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 146eb447-8c3b-410b-ba74-8d77f9f97921

📥 Commits

Reviewing files that changed from the base of the PR and between b8b5ebd and 7c55979.

📒 Files selected for processing (2)
  • dagshub/common/cli.py
  • tests/common/test_cli.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/common/test_cli.py
  • dagshub/common/cli.py

📝 Walkthrough

Walkthrough

The repo create command now has concise help text and expanded documentation for uploads, copying, cloning, and usage examples. CLI tests verify complete help output and preserved formatting.

Changes

Repository command help

Layer / File(s) Summary
Help content and validation
dagshub/common/cli.py, tests/common/test_cli.py
The repo create command now describes repository creation, optional data upload, and local cloning. Its docstring includes upload and clone behavior with two examples. Tests verify complete summaries, bullets, examples, and successful help invocation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 7c559

This PR improves the repository creation command’s summary and formatted help output without changing repository behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Poem

I’m a rabbit with a CLI tune,
Help text shines beneath the moon.
Bullets hop and examples play,
No truncated words escape today.
repo create is clear and bright! 🐇

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: completing the help text for the dagshub repo create command.
Description check ✅ Passed The description directly explains the truncated and malformed help output, the implementation, and the added tests.
Linked Issues check ✅ Passed The changes fix issue #310 by providing complete repo create command help and regression tests for the rendered output.
Out of Scope Changes check ✅ Passed The help formatting changes and CLI tests are directly related to the linked issue and stated pull request objectives.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/common/test_cli.py (1)

12-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the rendered structure explicitly.

The tests check individual text fragments and example labels. They do not check the command row, leading spaces, the .zip continuation line, or the complete example commands. A later rewrap can therefore pass these tests while breaking the behavior this PR targets. Assert the full preformatted blocks with their newlines and indentation.

Also applies to: 24-36


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7c44abaa-eab2-42bd-932e-6f810fbb3237

📥 Commits

Reviewing files that changed from the base of the PR and between 733227f and b8b5ebd.

📒 Files selected for processing (2)
  • dagshub/common/cli.py
  • tests/common/test_cli.py
📜 Review details
🔇 Additional comments (2)
dagshub/common/cli.py (1)

330-330: LGTM!

tests/common/test_cli.py (1)

1-9: LGTM!

Comment thread dagshub/common/cli.py Outdated
Comment thread dagshub/common/cli.py
Two points from review.

The `-u` description said "from a URL dir", which I carried over from the
original text. It is wrong: `upload_data` is passed straight to
`http_request("GET", upload_data)` and the downloaded name comes from
`os.path.basename(urlparse(upload_data).path)`. That is a single file, and both
examples use one. "dir" invites passing a directory listing URL, which does
not work.

The tests checked that fragments appeared somewhere in the output, which a
later rewrap could satisfy while breaking the layout the escapes exist to
protect. They now assert whole lines, including indentation and the complete
example command, so a regression in the formatting fails rather than passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Muhtasim-Munif-Fahim

Copy link
Copy Markdown
Author

Both addressed in 7c55979.

"URL dir" — you're right, and I'd carried that wording over from the original rather than checking it. upload_data goes straight to http_request("GET", upload_data) and the saved name comes from os.path.basename(urlparse(upload_data).path); both examples pass a single file. "dir" invites passing a directory listing URL, which doesn't work. Now reads "upload a file to 'data' from a URL".

Structural assertions — also fair. Substring checks would have passed on a rewrap that broke the very layout the \b escapes exist to protect, which makes the test close to useless for its stated purpose. It now asserts whole lines including indentation and the full example command, so a formatting regression fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Truncated command help text for dagshub repo --help

1 participant