Skip to content

fix: skip go-version check when workflow has no go-version field#103

Merged
lenasolarova merged 1 commit into
RedHatInsights:masterfrom
lenasolarova:fix/go-version-check-skip-missing-version
Apr 24, 2026
Merged

fix: skip go-version check when workflow has no go-version field#103
lenasolarova merged 1 commit into
RedHatInsights:masterfrom
lenasolarova:fix/go-version-check-skip-missing-version

Conversation

@lenasolarova
Copy link
Copy Markdown
Contributor

Problem

When the check was extended to cover gotests.yml (in addition to gotests.yaml), repos whose workflows use a UBI container instead of actions/setup-go do not declare go-version:. The check then fails comparing the Dockerfile version against an empty string.

This broke the MintMaker pre-commit hooks bump PR in parquet-factory (#52) which has gotests.yml using ubi9/go-toolset — a pattern that was silently skipped before because v0.1.0 only checked for gotests.yaml.

Fix

Skip gracefully when go-version is not declared in the workflow file, consistent with how the check already handles missing workflow files and reusable workflows. Repos that do declare go-version continue to have their versions enforced as before.

The check was extended to cover gotests.yml (in addition to gotests.yaml)
but repos whose workflows use a UBI container instead of setup-go do not
declare go-version, causing the check to fail with an empty comparison.

Skip gracefully when go-version is not present, consistent with how the
check already handles missing workflow files and reusable workflows.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@lenasolarova lenasolarova requested a review from a team as a code owner April 23, 2026 12:32
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d5ad828-dec2-4bef-b962-d9cf636b579c

📥 Commits

Reviewing files that changed from the base of the PR and between ea9097f and c92e524.

📒 Files selected for processing (1)
  • go-checkers/check_go_versions.sh

Summary by CodeRabbit

  • Bug Fixes
    • Improved Go version validation to properly detect and handle cases where version information cannot be extracted from configuration files, preventing incomplete version comparisons and providing clearer feedback.

Walkthrough

The check_go_versions.sh script now validates that go-version was successfully extracted from the configuration file before proceeding with version checks. When extraction fails or the value is missing, the script emits an informational message and exits early with code 0, preventing invalid version comparisons.

Changes

Cohort / File(s) Summary
Go Version Validation
go-checkers/check_go_versions.sh
Added validation to verify go-version was successfully extracted from gotests.yaml/yml before performing version consistency checks. Exits early with status 0 if extraction fails or value is missing, preventing downstream errors.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding graceful skipping of the go-version check when the workflow file lacks a go-version field.
Description check ✅ Passed The description clearly explains the problem context, the specific issue that motivated the fix, and the solution implemented, all directly related to the changeset.
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

Comment @coderabbitai help to get the list of available commands and usage tips.

@lenasolarova lenasolarova merged commit d6b613f into RedHatInsights:master Apr 24, 2026
3 checks passed
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.

3 participants