Skip to content

[STEP-2562] Report what each command finds in xcodebuild_options - #362

Open
lpusok wants to merge 1 commit into
STEP-2562-6-diagnosticsfrom
STEP-2562-7-command-findings
Open

lpusok wants to merge 1 commit into
STEP-2562-6-diagnosticsfrom
STEP-2562-7-command-findings

Conversation

@lpusok

@lpusok lpusok commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The command's own findings join the parser's, each with its fix:

  • RejectedOption: a flag the command's policy refuses (mode switching, test-only); the
    message says whether xcodebuild refuses or ignores it there;
  • ActionInOptions: a build action (clean, build) in the options; the command sets its own;
  • PreferStepInput: -allowProvisioningUpdates on its own; xcodebuild needs the API key flags
    the Step adds when automatic code signing is enabled, so it points at that input;
  • what the merge resolved: RepeatedOption (xcodebuild will refuse it), and the informational
    RedundantOption and Override, which Fail lets through;
  • a "-flag=value" next to the Step's "-flag value", which xcodebuild ignores; for a switch
    the fix is to remove it.

ExampleArchive shows the call site steps-xcode-archive ends up with.

🤖 Generated with Claude Code

The command's own findings join the parser's, each with its fix:

- RejectedOption: a flag the command's policy refuses (mode switching, test-only); the
  message says whether xcodebuild refuses or ignores it there;
- ActionInOptions: a build action (clean, build) in the options; the command sets its own;
- PreferStepInput: -allowProvisioningUpdates on its own; xcodebuild needs the API key flags
  the Step adds when automatic code signing is enabled, so it points at that input;
- what the merge resolved: RepeatedOption (xcodebuild will refuse it), and the informational
  RedundantOption and Override, which Fail lets through;
- a "-flag=value" next to the Step's "-flag value", which xcodebuild ignores; for a switch
  the fix is to remove it.

ExampleArchive shows the call site steps-xcode-archive ends up with.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

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.

🟡 Changes recommended

Validation can reject valid manual authentication and accept malformed switch overrides.

2 open findings
What changed in this PR

Adds command-aware diagnostics for user-supplied xcodebuild_options.

Changes:

  • Reports policy violations, collisions, redundant options, and malformed flag forms.
  • Adds validation tests and an archive usage example.
  • Integrates merge results into command diagnostics.
File Description
xcodecommand/​command.go Passes merge context into diagnostics.
xcodecommand/​diagnostic.go Adds command and collision diagnostics.
xcodecommand/​diagnostic_test.go Tests validation kinds and messages.
xcodecommand/​example_test.go Demonstrates archive option merging.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +144 to +145
hint, ok := stepInputFlags[o.Key()]
if !ok || slices.ContainsFunc(derived, func(d Option) bool { return d.Key() == o.Key() }) {
Comment on lines +186 to +187
case overridden:
diagnostics = append(diagnostics, Diagnostic{Kind: Override, Message: fmt.Sprintf("%q replaces the Step's default %q.", c.user.join(), c.derived)})
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.

2 participants