feat: add mutation plans and confirmation - #4
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
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/MutationScopefor 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.
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
Summary
Testing
Closes apolloconfig/apollo#5667
Refs apolloconfig/apollo#5626