Skip to content

Scope templates --status flag to the list subcommand#518

Merged
robzolkos merged 4 commits into
mainfrom
fix/templates-status-flag-scope
Jul 2, 2026
Merged

Scope templates --status flag to the list subcommand#518
robzolkos merged 4 commits into
mainfrom
fix/templates-status-flag-scope

Conversation

@robzolkos

@robzolkos robzolkos commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The --status filter was registered as a persistent flag on the templates command group, so Cobra propagated it onto every subcommand — construct, show, create, update, delete, construction — where it has no meaning and is silently ignored.

This moves it to a local flag on templates list, the only command that actually uses it.

Context

Surfaced while validating #454 (templates construct returns Bad Request). The reporter suspected this stray --status flag was being sent in the construct POST body and causing the 400. It is not — the flag is never read by construct and never enters any request body. The real cause of #454 is an SDK bug (flat request body missing the project envelope), tracked in basecamp/basecamp-sdk#354.

So this change is purely a cosmetic UX cleanup: the flag no longer clutters the help of commands that don't support it.

Verification

  • --status now appears only under templates list --help, and is gone from templates construct --help (and the other subcommands).
  • .surface snapshot updated: the 7 spurious templates … --status entries removed, templates list --status retained.
  • gofmt, go vet, internal/commands unit tests, skill-drift, and smoke-coverage checks all pass.

Refs #454


Summary by cubic

Scoped the --status flag to templates list only and removed it from other templates subcommands. Added validation to accept only empty, active, archived, or trashed; grouped the acknowledged removals under the .surface-breaking FLAG section; retargeted the e2e test to templates list --status and added an invalid-value failure case.

Written for commit 8140b48. Summary will update on new commits.

Review in cubic

The --status filter was registered as a persistent flag on the templates
command group, so it leaked onto every subcommand (construct, show, create,
etc.) where it has no meaning and is silently ignored. Move it to a local
flag on `templates list`, the only command that uses it.

This is cosmetic — the stray flag was never sent in any request body and did
not cause the `templates construct` 400 reported in #454 (that is an SDK bug
tracked in basecamp/basecamp-sdk#354).

Refs #454
Copilot AI review requested due to automatic review settings July 2, 2026 20:40
@github-actions github-actions Bot added commands CLI command implementations breaking Breaking change labels Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

⚠️ Potential breaking changes detected:

  • The --status flag was removed from the persistent flags of the 'templates' command and is now scoped specifically to the 'list' subcommand. This breaks any script or usage that relied on setting the --status flag at the top-level 'templates' command.

Review carefully before merging. Consider a major version bump.

Copilot AI 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.

Pull request overview

This PR cleans up the CLI UX for the templates command group by scoping the --status flag to templates list (the only subcommand that actually uses it), instead of exposing it as a persistent flag on every templates subcommand.

Changes:

  • Removed --status as a persistent flag from basecamp templates.
  • Added --status as a local flag on basecamp templates list.
  • Updated the .surface snapshot to remove the spurious --status entries from unrelated subcommands.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/commands/templates.go Moves --status from a persistent templates flag to a local templates list flag.
.surface Removes --status from non-list templates subcommands in the CLI surface snapshot.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/commands/templates.go

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

CI surface diff flags the 7 removed `templates … --status` entries as
breaking removals — acknowledge them in .surface-breaking. Also retarget the
e2e flag-parsing test from `templates --status` to `templates list --status`,
matching where the flag now lives.
@github-actions github-actions Bot added tests Tests (unit and e2e) enhancement New feature or request labels Jul 2, 2026
Per PR review: --status was accepted as any string and, for non-active
values, interpolated directly into the request URL. Reject anything outside
active/archived/trashed (or empty) with a usage error before the value
reaches the account layer or the URL. Add an e2e test for the invalid case.
Copilot AI review requested due to automatic review settings July 2, 2026 20:56

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread .surface-breaking Outdated
Per PR review: the acknowledged removals were appended after the SUB block.
Move them into the FLAG section in correct lexical position so the file stays
grouped and deterministic. Content is unchanged — only reordered.
@robzolkos robzolkos merged commit 1362211 into main Jul 2, 2026
26 checks passed
@robzolkos robzolkos deleted the fix/templates-status-flag-scope branch July 2, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change commands CLI command implementations enhancement New feature or request tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants