fix(go-pr-analysis): warn when custom_checks is enabled but empty - #626
Conversation
Summary by CodeRabbit
WalkthroughChangesCustom checks execution
Integration test command documentation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🛡️ CodeQL Analysis ResultsLanguages analyzed: ✅ No security issues found. 🔍 View full scan logs | 🛡️ Security tab |
🔍 Lint Analysis
|
🔍 PR Validation Summary✅ PR Mergeable — no blocking failures
|
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
Actionable comments posted: 1
🤖 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 @.github/workflows/go-pr-validation.yml:
- Around line 279-284: Complete the truncated explanatory comment above the
reusable workflow configuration by finishing the final sentence with a clear
reference to the downstream workflow, while preserving the existing explanation
and synchronization note.
🪄 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.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b6c30d97-3c4b-4b94-b76c-b5441ee6fe1a
📒 Files selected for processing (2)
.github/workflows/go-pr-analysis.yml.github/workflows/go-pr-validation.yml
Description
Two follow-ups from the CodeRabbit review on #625 (the
develop→mainpromotion carrying #623 and #624).1.
custom_checksenabled but empty no longer skips silentlyThe job was gated on
inputs.custom_checks != '', so a caller that setenable_custom_checks: trueand forgot the list got a silently absent job — a gate reporting coverage it never provided. Dropped that clause from theif:and added an early guard in the run step:Whitespace-stripped, so a list containing only newlines warns too. Costs a runner spin-up on a misconfigured repo; that seemed clearly better than a gate that quietly claims to have run.
2. Corrected a misleading comment on the
integration_test_commandfallbackThe comment claimed empty "falls through to go-pr-analysis's own default". It does not — the umbrella substitutes the same literal. The code is correct and load-bearing; only the comment was wrong.
The reviewer's proposed fix was to drop the fallback and pass the input through as-is. That would break callers: a reusable-workflow
defaultapplies only when the input is omitted, and awith:mapping cannot conditionally omit a key. An empty string therefore arrives atgo-pr-analysisas'', and its integration-tests job doesrun: ${{ inputs.integration_test_command }}— an emptyrun:is a workflow validation error. Every umbrella caller withenable_integration_tests: trueand no explicit command would fail.So the literal has to be repeated. The comment now says that, and says why, and flags it as a keep-in-sync duplicate.
Type of Change
fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)Breaking Changes
None. Change 1 only affects a configuration that was previously a silent no-op — it now emits a warning and still exits 0, so no currently-passing PR starts failing. Change 2 is comment-only.
Testing
@this-branchor the beta tagParsed both workflows and asserted the
custom-checksif:no longer referencescustom_checks, that the guard is the first thing in the run step, and that the forwardedintegration_test_commandexpression is unchanged. Ran the guard's bash condition against three inputs — empty, newlines-only, and a real target list — confirming the first two warn and exit 0 while the third proceeds.The happy path was already exercised end to end on
LerianStudio/caradhrasPR #34, whereCustom Checks (caradhras)rancheck-migrations,check-goroutinesandcheck-e2e-vetand agreed with the bespoke jobs kept as a control on the same commit.Related Issues
Follow-up to #623 / #624, reviewed on #625.