fix: clarify --default-branch semantics across scan and repository#1269
Closed
Martin Torp (mtorp) wants to merge 1 commit intov1.xfrom
Closed
fix: clarify --default-branch semantics across scan and repository#1269Martin Torp (mtorp) wants to merge 1 commit intov1.xfrom
Martin Torp (mtorp) wants to merge 1 commit intov1.xfrom
Conversation
`socket scan create --default-branch` is a boolean toggle, but meow silently discards the value when users pass `--default-branch=<name>` (a common mistake because `socket repository create --default-branch` was a string flag that *did* accept a value). The scan is then created without being marked as the default branch, so it never lands in the Main/PR dashboard tabs. - scan create: reject `--default-branch=<value>` with an InputError pointing users at the correct form (`--default-branch` on its own, with `--branch=<name>` to name the branch). - repository create/update: rename the flag to `--default-branch-name`. `--default-branch` remains accepted as a hidden alias and now emits a deprecation warning pointing at the new name. Includes updated help snapshots, new test coverage for the error path, the deprecation warning, and the silent-path on the renamed flag.
Contributor
|
Tackled in vNext as #1230. We can punt on v1.x 🕺 |
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.
Summary
socket scan create --default-branchis a boolean toggle, but meow silently discards the value when users pass--default-branch=<name>— a common mistake becausesocket repository create --default-branchwas a string flag that accepted a value. When that happens, the scan is created without being marked as the default branch, so it never lands in the Main/PR dashboard tabs.--default-branch=<value>with anInputErrorthat points users at the correct form (--default-branchon its own, with--branch=<name>to name the branch).--default-branch-name.--default-branchstill works as a hidden meow alias and now emits a deprecation warning pointing at the new name, so existing scripts keep functioning.Resolves ENG-4940.
Test plan
pnpm test:unit src/commands/scan/cmd-scan-create.test.mts src/commands/repository/cmd-repository-create.test.mts src/commands/repository/cmd-repository-update.test.mts— 43/43 pass (5 new cases)pnpm run check:tsc— cleansocket scan create --default-branch=main ...now errors with a clear messagesocket repository create fakerepo --default-branch=trunk ...works and emits deprecation warningsocket repository create --helpshows--default-branch-name(old flag hidden from help)