chore: Require explicit CLI compatibility decisions - #1202
Conversation
Ensure CI distinguishes the bundled CLI contract version from the Unity package minimum while still forcing compatibility-sensitive changes to document whether older CLIs remain supported. - Add a Go guard that compares the package minimum with the latest CLI contract and checks PR diffs for sensitive paths. - Require either a minimum version update or a keep-decision file with a reason when sensitive files change. - Run the guard in build-and-test after Go setup with full checkout history.
📝 WalkthroughWalkthroughThis PR adds a CLI minimum-version compatibility guard that runs in CI to detect compatibility-sensitive CLI changes and enforce explicit documentation when the minimum required version is not incremented. The guard reads version constraints, detects changed files, classifies breaking changes, validates optional decision JSON, and fails the build when sensitive changes lack proper justification. ChangesGuard implementation and testing
CI integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-and-test.yml (1)
18-21: ⚡ Quick winConsider setting
persist-credentials: falsefor security hardening.As a security best practice, explicitly disable credential persistence in the checkout step to minimize the risk of token exposure in subsequent steps or artifacts. While the current risk is low (the workflow has only
contents: readpermission and doesn't publish artifacts), this change aligns with security hardening guidelines.🔒 Proposed security hardening
- name: Checkout repository uses: actions/checkout@v6 with: fetch-depth: 0 + persist-credentials: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build-and-test.yml around lines 18 - 21, Update the "Checkout repository" step (the step with name "Checkout repository" and uses: actions/checkout@v6) to explicitly disable credential persistence by adding persist-credentials: false under its with block so the runner does not persist GITHUB_TOKEN credentials to subsequent steps or side-effects.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/build-and-test.yml:
- Around line 18-21: Update the "Checkout repository" step (the step with name
"Checkout repository" and uses: actions/checkout@v6) to explicitly disable
credential persistence by adding persist-credentials: false under its with block
so the runner does not persist GITHUB_TOKEN credentials to subsequent steps or
side-effects.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 08568f1e-4b48-4279-8a03-3dd5044530cd
📒 Files selected for processing (4)
.github/workflows/build-and-test.ymlPackages/src/Cli~/cmd/cli-minimum-version-guard/main.goPackages/src/Cli~/cmd/cli-minimum-version-guard/main_test.goscripts/check-cli-minimum-version-compatibility.sh
Summary
User Impact
Changes
Verification
Closes #1200