chore: Keep CLI minimum-version reminders accurate#1224
Conversation
Keep the shell script as a thin GitHub Actions entrypoint while the Go command owns diff inspection and reminder comment upsert or resolution. This makes the warning behavior testable in the Go CLI codebase instead of leaving it in a large shell script.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR migrates the CLI minimum version warning logic from a shell script into a new Go automation module. It adds RunMinimumVersionWarning with env-to-config resolution, changed-file detection, and GitHub comment upsert/resolve behavior; provides unit tests; adds a small Go main; updates the shell wrapper to invoke the Go command; and adds a Go setup step to the workflow. ChangesMove CLI minimum version warning logic to Go
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@Packages/src/Cli`~/internal/automation/minimum_version_warning.go:
- Around line 48-58: The code is resolving the repository with
resolveMinimumVersionWarningRepository before checking config.baseRef, which
causes failures (e.g., missing GITHUB_REPOSITORY or gh) even when we should
early-skip; change the logic so you first check if config.baseRef == "" and call
writeMinimumVersionWarningLine(stdout, "Skipping CLI minimum version comment
because no base ref was provided.") and return 0 immediately, and only if a
baseRef exists call resolveMinimumVersionWarningRepository(ctx, config), assign
to config.repository, and handle its error as before; update references to
repository/config.repository accordingly so resolution happens after the
early-skip.
- Around line 231-250: minimumVersionWarningIsGoCliFile incorrectly treats
test-only files under the CLI internal/ tree as shipped changes; update
minimumVersionWarningIsGoCliFile to early-return false for files with suffix
"_test.go" (check strings.HasSuffix(changedFile, "_test.go") or inspect the
relativePath after trimming goCliPackageRoot) before the block that treats
internal/ changes as true, and add a unit test regression case asserting that an
internal *_test.go file is considered non-CLI-change (false). Ensure references
to goCliPackageRoot and the internal/ handling logic in
minimumVersionWarningIsGoCliFile are used so the fix targets the right branch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bf6b2d42-37ab-4a8e-8868-4fb2962abc82
📒 Files selected for processing (8)
.github/workflows/cli-minimum-version-warning.ymlPackages/src/Cli~/cmd/comment-cli-minimum-version-warning/main.goPackages/src/Cli~/internal/architecture/architecture_test.goPackages/src/Cli~/internal/architecture/comment_cli_minimum_version_warning_test.goPackages/src/Cli~/internal/automation/minimum_version_warning.goPackages/src/Cli~/internal/automation/minimum_version_warning_test.goscripts/comment-cli-minimum-version-warning.shscripts/test-cli-minimum-version-warning-workflow.sh
There was a problem hiding this comment.
2 issues found across 8 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Skip missing-base runs before repository resolution and ignore Go test files when deciding whether a PR changes shipped native CLI behavior.
Summary
User Impact
MINIMUM_REQUIRED_CLI_VERSION.Changes
Verification
go test ./internal/automation ./internal/architecture -run TestMinimumVersion -count=1scripts/test-comment-cli-minimum-version-warning.shscripts/test-cli-minimum-version-warning-workflow.shgit diff --checkscripts/check-go-cli.sh~/.codex/skills/codex-review/scripts/codex-review --parallel-tests "scripts/check-go-cli.sh" v3-betaCloses #1222