Skip to content

refactor(cmd/config): use names pkg flags - #978

Merged
skevetter merged 1 commit into
mainfrom
cmd-reviewer/apply-flag-names
Aug 10, 2026
Merged

skevetter merged 1 commit into
mainfrom
cmd-reviewer/apply-flag-names

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

cmd/ subdirectory reviewed

cmd/config/ — specifically cmd/config/apply.go and cmd/config/apply_test.go.

Issue found

cmd/config/apply.go defined four local flag-name string constants:

  • flagApplyContainer
  • flagApplyConfig
  • flagApplyWorkspaceFolder
  • flagApplyDockerPath

These duplicated the canonical flag names already exported by pkg/flags/names. The sibling file cmd/config/read.go in the same package already uses the shared names.* constants for its flags, so apply.go was an inconsistency within cmd/config: the same flag name strings were maintained in two places (the local constants and pkg/flags/names). Keeping flag names in a single canonical package is the repo convention (see cmd/flag_aliases_test.go, which asserts flag aliases against pkg/flags/names).

Minimal change

  • Removed the four local flagApply* constants from cmd/config/apply.go.
  • Added the github.com/devsy-org/devsy/pkg/flags/names import and replaced usages with names.Container, names.Config, names.WorkspaceFolder, and names.DockerPath.
  • Updated cmd/config/apply_test.go to reference the same names.* constants (added the import, replaced the flagApply* references).

No behavioral change: the underlying flag name strings are identical, so the CLI flags, help text, and flag aliases are unchanged.

Verification performed

  • task cli:format — clean (no changes to modified files).
  • task cli:lint:ci — 0 issues (new-from-patch against origin/main).
  • task cli:test — cmd/config package passes. The only failing package is pkg/git (TestRepoClone*), which is a known pre-existing failure on origin/main (stale assertion, not caused by this change). This change does not touch pkg/git.

This PR was created by an AI agent as part of an automated daily CLI review job.

@netlify

netlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 5b5fffe
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a799ee51032cf00099462a9

@netlify

netlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 5b5fffe
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a799ee5f04007000827ecef

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 2 duplication

Metric Results
Complexity 0
Duplication 2

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@skevetter
skevetter marked this pull request as ready for review August 10, 2026 13:43
@skevetter
skevetter merged commit 0f657c7 into main Aug 10, 2026
67 checks passed
@skevetter
skevetter deleted the cmd-reviewer/apply-flag-names branch August 10, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant