Skip to content

feat: harden config diff and apply semantics - #5

Merged
nobodyiam merged 3 commits into
mainfrom
codex/apollo-cli-config-sync-5668
Aug 30, 2026
Merged

feat: harden config diff and apply semantics#5
nobodyiam merged 3 commits into
mainfrom
codex/apollo-cli-config-sync-5668

Conversation

@nobodyiam

@nobodyiam nobodyiam commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

  • define config synchronization as a conservative merge: create and update source keys while preserving target-only keys; reject unexpected server-side deletes
  • capture the complete paginated source snapshot inside config apply, derive a detailed redacted plan, and compare the same source plus fully paginated target state before synchronization to detect observable stale changes
  • return stable source/target scopes and create/update/delete/unchanged counts without exposing config values
  • skip the synchronize request for empty-source and no-op plans, returning a deterministic no-op success result
  • validate pagination completeness and target identity, reject unsupported cross-namespace apply, and redact config-sync HTTP error bodies
  • document merge, two-stage approval, advisory diff, no-op, stale-plan, pagination, and the current synchronize contract non-atomic check/write limitation in both READMEs

Testing

  • cargo fmt --check
  • cargo test (177 tests passed)
  • cargo clippy --all-targets --all-features -- -D warnings
  • git diff --check
  • Apollo all-in-one smoke at localhost:8070 using LOCAL/default and LOCAL/cli5668-target: preview reported create=1, update=1, delete=0, unchanged=1; apply preserved the target-only key; repeated apply returned result=no-op

Refs apolloconfig/apollo#5668
Refs apolloconfig/apollo#5626

Copilot AI lite review requested due to automatic review settings August 30, 2026 11:27
@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: 6b991fb1-5538-4bf0-a4cf-e7c791c2341d


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-30T11:54:04.042760Z ae09d36 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 hardens the config diff / config apply workflow by defining and enforcing conservative merge semantics, improving safety around stale plans, pagination completeness, and redaction of config values and error bodies.

Changes:

  • Implement conservative merge assessment and apply flow with stable scopes + create/update/delete/unchanged counts, plus deterministic no-op handling.
  • Add stricter pagination validation for source snapshots and stronger target identity validation for diff/apply.
  • Update CLI help + READMEs and expand OpenAPI/CLI tests for the new contract and redaction behavior.

Reviewed changes

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

Show a summary per file
File Description
tests/openapi.rs Updates and adds tests for redacted outputs, new diff/apply semantics, no-op, stale-plan, pagination validation, and error-body redaction.
tests/cli.rs Verifies updated --help text for conservative merge semantics.
src/mutation.rs Extends mutation plan metadata to include config-sync strategy/behavior and change counts; exposes MutationScope::render_table.
src/http.rs Adds an OpenAPI request mode that redacts error bodies entirely to prevent leaking secrets from server errors.
src/error.rs Introduces a structured stale_plan error variant with conflict categorization and operation context.
src/command.rs Implements snapshot capture, diff assessment parsing/validation, stale-plan checks, no-op handling, and new structured diff/apply outputs.
src/cli.rs Updates config diff/apply help text to document conservative merge behavior and no-op/deletion expectations.
README.zh.md Documents the conservative merge contract, output fields, no-op/stale-plan behavior, and redaction guarantees (ZH).
README.md Documents the conservative merge contract, output fields, no-op/stale-plan behavior, and redaction guarantees (EN).

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

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: 160714948f

ℹ️ 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: 39e4eec8da

ℹ️ 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
@nobodyiam
nobodyiam merged commit 49e7ddd into main Aug 30, 2026
3 checks passed
@nobodyiam
nobodyiam deleted the codex/apollo-cli-config-sync-5668 branch August 30, 2026 11: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.

2 participants