Skip to content

feat: add mutation plans and confirmation - #4

Merged
nobodyiam merged 5 commits into
mainfrom
codex/apollo-cli-mutation-plans-5667
Aug 30, 2026
Merged

feat: add mutation plans and confirmation#4
nobodyiam merged 5 commits into
mainfrom
codex/apollo-cli-mutation-plans-5667

Conversation

@nobodyiam

@nobodyiam nobodyiam commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

  • add a shared, redacted mutation plan for namespace, config, release, and raw OpenAPI mutations
  • show target details and a safe-default confirmation prompt in interactive table mode; require --yes for JSON and non-interactive execution
  • bind execution to the approved profile/server/output context and abort if it changes before request dispatch
  • gate namespace preflight reads behind initial approval and require a second approval when Apollo resolves a different effective namespace name
  • retain operation details in successful JSON responses and confirmation errors without exposing values, bodies, query values, or credentials
  • render empty successful mutation responses as a clear success message and remove the internal follow_up_issue field from structured errors and documentation
  • resolve public AppNamespace prefixes before mutation and redact inline or percent-encoded secrets in raw API paths
  • document confirmation behavior and stable process exit codes in both READMEs

Testing

  • cargo fmt --all -- --check
  • cargo check --locked --all-targets
  • cargo test --locked (162 tests passed)
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • verified config set and cancellation against Apollo all-in-one at localhost:8070

Closes apolloconfig/apollo#5667
Refs apolloconfig/apollo#5626

Copilot AI lite review requested due to automatic review settings August 30, 2026 09:34
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 78a3c100-0179-47e1-bd51-78086f5b52d4


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T10:50:32.636821Z c3251b8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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 introduces a redacted “mutation plan” concept for mutating OpenAPI-backed commands, adds a safer confirmation flow (interactive prompt in table mode; --yes required otherwise), and ensures successful JSON responses and confirmation errors include non-sensitive operation context.

Changes:

  • Add MutationPlan/MutationScope for redacted, structured mutation context (including sanitized request path/query parameter names for raw API calls).
  • Require explicit confirmation behavior for mutations, printing a target summary in interactive/table mode and embedding the plan in JSON outputs/errors.
  • Update integration tests and READMEs to validate/document confirmation behavior and stable exit codes.

Reviewed changes

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

Show a summary per file
File Description
tests/openapi.rs Adds/extends tests for mutation confirmation behavior, redacted plans, and operation details in JSON responses.
tests/cli.rs Aligns help text and asserts stable exit codes for JSON/parse error scenarios.
src/output.rs Adds operation-aware mutation JSON success rendering and includes optional mutation plan in structured errors.
src/mutation.rs Introduces new redacted mutation plan and sanitization/table rendering helpers with unit tests.
src/lib.rs Registers the new mutation module.
src/error.rs Extends confirmation-required errors to optionally carry a mutation plan into structured output.
src/command.rs Generates mutation plans per mutating command, centralizes confirmation, and routes mutation requests through mutation-aware rendering.
src/cli.rs Updates --yes help text to reflect confirmation semantics.
README.zh.md Documents confirmation behavior, mutation plan guarantees, and stable exit codes (Chinese).
README.md Documents confirmation behavior, mutation plan guarantees, and stable exit codes (English).

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

Comment thread src/output.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 024651c21e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/command.rs Outdated
Comment thread src/mutation.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6874e4af3a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/command.rs
Comment thread src/command.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7a8dec8a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mutation.rs Outdated
@nobodyiam
nobodyiam merged commit 816fe54 into main Aug 30, 2026
3 checks passed
@nobodyiam
nobodyiam deleted the codex/apollo-cli-mutation-plans-5667 branch August 30, 2026 10:53
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.

Add Apollo CLI mutation plans, target summaries, and TTY confirmation

2 participants