Repository navigation
fix(no-ticket): treat an empty trailing OWNER/REPO part as not given - #550
Merged
Merged
Conversation
`cloudsmith repos get myorg/` sent a request for a repository with an empty name. The validator now drops empty optional trailing parts, so the command lists the `myorg` namespace. An empty OWNER before a REPO gives a usage error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change preserves required-component validation, matches affected callers, and includes regression coverage with no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes shared path validation so an empty optional trailing component is treated as omitted, preventing requests with empty repository names.
Changes:
- Drops empty optional trailing components while still rejecting blank required components.
- Adds regression tests for trailing slashes, omitted paths, and invalid blank components.
- Documents the behavior change in the changelog.
| File | Description |
|---|---|
cloudsmith_cli/cli/validators.py |
Normalizes empty optional trailing components and removes allow_blank. |
cloudsmith_cli/cli/tests/test_validators.py |
Adds four focused path-validation regression tests. |
CHANGELOG.md |
Explains trailing-slash handling and blank-owner rejection. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BartoszBlizniak
approved these changes
Oct 28, 2026
cloudsmith-iduffy
enabled auto-merge (squash)
October 28, 2026 13:54
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: cloudsmith-iduffy <178375997+cloudsmith-iduffy@users.noreply.github.com>
auto-merge was automatically disabled
October 28, 2026 14:02
Head branch was pushed to by a user without write access
* origin/master: fix(no-ticket): print a skipped API error one time in copy, move and resync (#552) fix(no-ticket): save credentials.ini with mode 0600 (#553) fix(no-ticket): keep credential-helper list running on a bad config file (#549) fix(no-ticket): show pnpm hosts when the pnpm launcher is missing (#554) # Conflicts: # CHANGELOG.md
cloudsmith-iduffy
enabled auto-merge (squash)
October 28, 2026 17:31
cloudsmith-iduffy
added a commit
that referenced
this pull request
Oct 28, 2026
* origin/master: fix(no-ticket): treat an empty trailing OWNER/REPO part as not given (#550) fix(no-ticket): print a skipped API error one time in copy, move and resync (#552) fix(no-ticket): save credentials.ini with mode 0600 (#553) fix(no-ticket): keep credential-helper list running on a bad config file (#549) fix(no-ticket): show pnpm hosts when the pnpm launcher is missing (#554) fix(no-ticket): read and write .npmrc as UTF-8 (#555) chore(no-ticket): pushing 1.30.1 release (#566) fix(no-ticket): bumping python runtime versions to expedited security patches (#565) # Conflicts: # CHANGELOG.md
cloudsmith-iduffy
added a commit
that referenced
this pull request
Oct 28, 2026
* origin/master: fix(no-ticket): show the API error when mcp cannot load the API schema (#561) fix(no-ticket): treat an empty trailing OWNER/REPO part as not given (#550) fix(no-ticket): print a skipped API error one time in copy, move and resync (#552) fix(no-ticket): save credentials.ini with mode 0600 (#553) fix(no-ticket): keep credential-helper list running on a bad config file (#549) fix(no-ticket): show pnpm hosts when the pnpm launcher is missing (#554) fix(no-ticket): read and write .npmrc as UTF-8 (#555) chore(no-ticket): pushing 1.30.1 release (#566) fix(no-ticket): bumping python runtime versions to expedited security patches (#565) # Conflicts: # CHANGELOG.md
cloudsmith-iduffy
added a commit
that referenced
this pull request
Oct 28, 2026
* origin/master: fix(no-ticket): show a clean error when the SAML IdP response is not a JSON object (#559) fix(no-ticket): show the API error when mcp cannot load the API schema (#561) fix(no-ticket): treat an empty trailing OWNER/REPO part as not given (#550) fix(no-ticket): print a skipped API error one time in copy, move and resync (#552) fix(no-ticket): save credentials.ini with mode 0600 (#553) fix(no-ticket): keep credential-helper list running on a bad config file (#549) fix(no-ticket): show pnpm hosts when the pnpm launcher is missing (#554) # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Shell completion often leaves a trailing slash, so people run
cloudsmith repos get myorg/. The CLI split that intomyorgand an empty repo name, and then asked the API for a repository with no slug:Before:
The request was
GET /repos/myorg//.After:
The request is now
GET /repos/myorg/, the same asrepos get myorg.The fix is in the shared
validate_slashesvalidator. It now drops empty trailing parts that are optional. A required part that is empty still gives the usage errorIndividual values cannot be blank.validate_optional_owner_repono longer passesallow_blank, so I removed that flag. This means an emptyOWNERin front of aREPO, such asrepos get /myrepo, is now a usage error. Before, the CLI dropped the repo name without a message and listed your own repositories.Type of Change
Additional Notes
I checked every command that takes a path argument with an optional trailing part:
repos get/list repos(OWNER/REPO, both optional): this is the bug above.repos getwith no argument, or/, still lists your own repositories.metrics entitlements(OWNER[/REPO]):myorg/used to give a usage error. Now it works the same asmyorg.push <format>targets withOWNER/REPO/DISTRO[/RELEASE]:o/r/ubuntu/used to give a usage error. Now it works the same aso/r/ubuntu.list packages,list entitlements,upstream,tagsand the otherOWNER/REPO[/...]commands have no optional parts.myorg/still gives a usage error there.🤖 Generated with Claude Code