Skip to content

Add GitHub Actions workflows for presubmit checks#19

Open
rvanderp3 wants to merge 2 commits into
mainfrom
presubmit-tests
Open

Add GitHub Actions workflows for presubmit checks#19
rvanderp3 wants to merge 2 commits into
mainfrom
presubmit-tests

Conversation

@rvanderp3

@rvanderp3 rvanderp3 commented May 15, 2026

Copy link
Copy Markdown

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.

Summary by CodeRabbit

  • Chores
    • Added GitHub Actions workflows for automated code quality checks, including linting and format verification
    • Added automated build and test execution workflow that runs on pull requests and commits
    • Added vendor dependency validation workflow
    • Added workflow documentation with remediation guidance for common failures

Review Change Stack

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>
@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@rvanderp3 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 37 minutes and 51 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fd75974-d1a3-44c0-a6be-5abdeba14d10

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce9235 and d910a90.

📒 Files selected for processing (3)
  • .github/workflows/README.md
  • .github/workflows/format-check.yml
  • .golangci.yaml
📝 Walkthrough

Walkthrough

This 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 master and main branch activity.

Changes

GitHub Actions CI Workflows

Layer / File(s) Summary
Workflow documentation and guidance
.github/workflows/README.md
README documents all four workflows, their triggers, checks, failure remediation commands, guidance for adding new workflows, and notes on upstream OpenShift CI coverage.
Go module dependency validation
.github/workflows/vendor-check.yml
vendor-check workflow runs go mod tidy and go mod vendor, failing if go.mod, go.sum, or vendor/ directory are out of sync with the repository state.
Code formatting and linting validation
.github/workflows/format-check.yml, .github/workflows/lint.yml
format-check enforces gofmt strictly and checks goimports as a warning-only best-effort step; lint runs golangci-lint with repository config and 10-minute timeout.
Build and unit test workflow
.github/workflows/build-test.yml
build job checks out, sets up Go, runs ./hack/build.sh MODE=release, and verifies the binary via ./bin/openshift-install version; unit-tests job runs go test with race detection and coverage, uploading to Codecov with non-blocking failure handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Four workflows dance with grace,
Checking code in every place,
Vendor, lint, format, and build—
Your Go project, perfectly billed!
🔄✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add GitHub Actions workflows for presubmit checks' directly and clearly describes the main change: adding four GitHub Actions workflows (vendor-check, lint, format-check, build-test) to implement presubmit checks for the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch presubmit-tests

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 and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/build-test.yml (1)

55-61: 💤 Low value

Consider 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: true prevents workflow failure, you could improve this by conditionally running the upload only when CODECOV_TOKEN is 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: unittests

This allows the action to work with private repositories when the CODECOV_TOKEN secret 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1fc515d and 2ce9235.

📒 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

Comment on lines +33 to +34
skip-pkg-cache: false
skip-build-cache: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 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:


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.

Suggested change
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>
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.

1 participant