Add GitHub Actions workflows for presubmit checks#19
Conversation
Add GitHub Actions workflows to provide quick feedback on common issues for the openshift-splat-team fork. These supplement the full OpenShift CI presubmit tests defined in openshift/release. Workflows added: - vendor-check.yml: Verify vendor/ is in sync with go.mod/go.sum - lint.yml: Run golangci-lint with existing .golangci.yaml config - format-check.yml: Verify gofmt formatting - build-test.yml: Build installer and run unit tests with coverage Each workflow includes clear error messages with remediation steps. Documented all workflows in .github/workflows/README.md. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a complete CI/CD workflow suite with four GitHub Actions workflows and supporting documentation. The workflows enforce Go module consistency, code formatting and linting, and build/test validation on ChangesGitHub Actions CI Workflows
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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: 1
🧹 Nitpick comments (1)
.github/workflows/build-test.yml (1)
55-61: 💤 Low valueConsider adding token check for private repository support.
The Codecov upload will work for public repositories without a token, but will fail silently for private repositories. While
continue-on-error: trueprevents workflow failure, you could improve this by conditionally running the upload only whenCODECOV_TOKENis available.📊 Optional improvement for private repo support
- name: Upload coverage uses: codecov/codecov-action@v4 if: success() continue-on-error: true with: + token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.out flags: unittestsThis allows the action to work with private repositories when the
CODECOV_TOKENsecret is configured, while still working for public repos when it's not set.🤖 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-test.yml around lines 55 - 61, The "Upload coverage" step using codecov/codecov-action@v4 should be made conditional on private-repo support: change the step's if to only run when the workflow succeeded and either the repo is public or a CODECOV_TOKEN secret exists (e.g. if: success() && (github.event.repository.private == false || secrets.CODECOV_TOKEN != '')), and add the token input under with (token: ${{ secrets.CODECOV_TOKEN }}) so private repos upload when the secret is provided while public repos continue to work without a token; keep continue-on-error: true and the existing file/flags settings.
🤖 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/lint.yml:
- Around line 33-34: Remove the invalid inputs `skip-pkg-cache` and
`skip-build-cache` from the golangci-lint action configuration (they are not
recognized by golangci/golangci-lint-action@v6); rely on the existing
`skip-cache` input (already set to false) instead — locate the action block
where `skip-pkg-cache` and `skip-build-cache` are defined and delete those two
keys so only supported inputs (e.g., `skip-cache`) remain.
---
Nitpick comments:
In @.github/workflows/build-test.yml:
- Around line 55-61: The "Upload coverage" step using codecov/codecov-action@v4
should be made conditional on private-repo support: change the step's if to only
run when the workflow succeeded and either the repo is public or a CODECOV_TOKEN
secret exists (e.g. if: success() && (github.event.repository.private == false
|| secrets.CODECOV_TOKEN != '')), and add the token input under with (token: ${{
secrets.CODECOV_TOKEN }}) so private repos upload when the secret is provided
while public repos continue to work without a token; keep continue-on-error:
true and the existing file/flags settings.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5afe7dd3-fdb8-412c-8198-e4f3e1dc3835
📒 Files selected for processing (5)
.github/workflows/README.md.github/workflows/build-test.yml.github/workflows/format-check.yml.github/workflows/lint.yml.github/workflows/vendor-check.yml
| skip-pkg-cache: false | ||
| skip-build-cache: false |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What are the valid inputs for golangci-lint-action version 6?
💡 Result:
For golangci-lint-action version 6, the following inputs are supported [1][2]. These inputs are configured within the with block of your GitHub Actions workflow step [1][3]. Input Options: version: The version of golangci-lint to use (e.g., v1.60, latest) [1][2]. version-file: Specifies a file from which to read the golangci-lint version (e.g.,.golangci-lint-version or.tool-versions) [4][5]. install-mode: The installation method for golangci-lint. Valid values are binary (default), goinstall, or none [5]. install-only: If set to true, the action only installs golangci-lint without running it [5]. verify: If set to true (default), the action validates the golangci-lint configuration file against its JSONSchema [5]. github-token: The token used for fetching pull request patches to display only new issues [5]. only-new-issues: If set to true and running on a pull request, the action outputs only newly found issues [5]. working-directory: The directory where golangci-lint should run; defaults to the project root [3][5]. args: Command-line arguments passed directly to the golangci-lint binary [1][3]. skip-cache: If set to true, all caching functionality is disabled [5]. skip-save-cache: If set to true, the action will not save caches, though it may still restore existing ones [5]. cache-invalidation-interval: Specifies the number of days before cache invalidation [4][5]. problem-matchers: Forces the use of embedded problem matchers [4][5]. Note that version 6 of this action removed the annotations option and the default github-actions output format [1][4]. Additionally, users must ensure that actions/setup-go is executed in a prior step, as the action no longer handles Go installation directly [1][4].
Citations:
- 1: https://github.com/golangci/golangci-lint-action/blob/v6.0.0/README.md
- 2: https://github.com/golangci/golangci-lint-action/tree/v6.5.0
- 3: https://github.com/golangci/golangci-lint-action?tab=readme-ov-file
- 4: https://github.com/golangci/golangci-lint-action
- 5: https://github.com/golangci/golangci-lint-action/blob/main/action.yml
Remove invalid action inputs.
The inputs skip-pkg-cache and skip-build-cache are not recognized by golangci/golangci-lint-action@v6. These will be ignored by the action. Caching is controlled by the skip-cache input (already set to false on line 32).
Proposed fix
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --config .golangci.yaml --timeout 10m
skip-cache: false
- skip-pkg-cache: false
- skip-build-cache: false📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| skip-pkg-cache: false | |
| skip-build-cache: false | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: latest | |
| args: --config .golangci.yaml --timeout 10m | |
| skip-cache: false |
🧰 Tools
🪛 actionlint (1.7.12)
[error] 33-33: input "skip-pkg-cache" is not defined in action "golangci/golangci-lint-action@v6". available inputs are "args", "cache-invalidation-interval", "github-token", "install-mode", "only-new-issues", "problem-matchers", "skip-cache", "skip-save-cache", "verify", "version", "working-directory"
(action)
[error] 34-34: input "skip-build-cache" is not defined in action "golangci/golangci-lint-action@v6". available inputs are "args", "cache-invalidation-interval", "github-token", "install-mode", "only-new-issues", "problem-matchers", "skip-cache", "skip-save-cache", "verify", "version", "working-directory"
(action)
🤖 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/lint.yml around lines 33 - 34, Remove the invalid inputs
`skip-pkg-cache` and `skip-build-cache` from the golangci-lint action
configuration (they are not recognized by golangci/golangci-lint-action@v6);
rely on the existing `skip-cache` input (already set to false) instead — locate
the action block where `skip-pkg-cache` and `skip-build-cache` are defined and
delete those two keys so only supported inputs (e.g., `skip-cache`) remain.
Update workflows and linter config to exclude vendor/ directory from code quality checks, as vendor contains third-party dependencies that should not be linted or format-checked. Changes: - .golangci.yaml: Add ^vendor to exclude-dirs list - format-check.yml: Update gofmt and goimports to skip vendor/ - README.md: Document vendor exclusion in all relevant workflows Only vendor-check.yml should verify vendor/ is in sync with go.mod. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add GitHub Actions workflows to provide quick feedback on common issues for the openshift-splat-team fork. These supplement the full OpenShift CI presubmit tests defined in openshift/release.
Workflows added:
Each workflow includes clear error messages with remediation steps. Documented all workflows in .github/workflows/README.md.
Summary by CodeRabbit