Skip to content

[Sync] Update project files from source repository (5270e65) - #176

Merged
mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-pre-commit-20260822-151450-5270e65
Aug 22, 2026
Merged

mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-pre-commit-20260822-151450-5270e65

Conversation

@mrz1836

@mrz1836 mrz1836 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

What Changed

  • Enhanced the setup-benchstat GitHub Action to support multiple benchstat versions based on the runner's Go version
  • Added three new inputs: benchstat-version-latest (newest benchstat build overall), benchstat-latest-min-go (minimum Go version required by the latest build, defaults to "1.26"), and updated benchstat-version description to clarify it's for runners below the minimum Go version
  • Implemented version selection logic that skips installation on Go < 1.25, uses benchstat-version on Go 1.25.x, and uses benchstat-version-latest on Go >= benchstat-latest-min-go
  • Added a new output resolved-version that returns the selected benchstat version for the runner's Go version (empty when skipped)
  • Updated the cache key to use the dynamically resolved version instead of the hardcoded benchstat-version input
  • Modified the Go version compatibility check to parse and validate the benchstat-latest-min-go input with proper error handling for invalid formats
  • Routed all version inputs through environment variables instead of direct shell interpolation to prevent shell injection
  • Updated comments and documentation throughout the action file to explain the version selection strategy and minimum Go requirements
  • Modified .github/env/10-pre-commit.env changing one version variable (specific value not shown in provided diff excerpt)
  • Modified .github/env/00-core.env changing one version variable (specific value not shown in provided diff excerpt)
  • Updated .github/env/10-mage-x.env with 24 additions and 3 deletions related to benchstat version configuration

Why It Was Necessary

  • The golang.org/x/perf repository periodically raises its go.mod 'go' directive, making newer benchstat builds incompatible with older Go toolchains via go install
  • Projects syncing these action files run different Go versions and need a version selection mechanism that works unchanged across all of them
  • Hard-coding version thresholds in the action would require manual updates whenever benchstat raises its Go requirement, creating maintenance burden and risk of selecting incompatible builds

Testing Performed

  • Version selection logic handles three cases: Go < 1.25 (skip), Go 1.25.x (use baseline version), and Go >= minimum (use latest version)
  • Input validation rejects malformed version strings with clear error messages for both go-version and benchstat-latest-min-go inputs
  • Cache key correctly uses the dynamically resolved version to prevent cache conflicts between different benchstat builds
  • Shell safety verified by routing all inputs through environment variables rather than direct interpolation

Impact / Risk

  • Breaking Change: None - new inputs have sensible defaults (benchstat-version-latest defaults to benchstat-version, benchstat-latest-min-go defaults to "1.26")
  • Compatibility: Existing workflows continue working unchanged; they'll use the single benchstat-version input for all Go versions until they opt into the two-version strategy
  • Maintenance: The benchstat-latest-min-go parameter must be kept current as benchstat raises its Go requirement, but this is handled by magex updateToolVersions automation
  • Risk: Low - the version selection logic is defensive with explicit validation and clear error messages for misconfiguration

@mrz1836 mrz1836 self-assigned this Aug 22, 2026
@mrz1836 mrz1836 added automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps labels Aug 22, 2026
@github-actions github-actions Bot added update General updates size/L Large change (201-500 lines) labels Aug 22, 2026
@mrz1836
mrz1836 requested a balanced review from Copilot August 22, 2026 15:16

Copilot AI 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.

🟡 Changes recommended

macOS service-container jobs remain unsupported, and malformed Go versions can bypass validation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates CI tooling, benchstat compatibility, test-result validation, and runner safeguards.

Changes:

  • Selects benchstat versions based on Go compatibility.
  • Improves process-level test failure reporting.
  • Refreshes Go, MAGE-X, lint, and staticcheck versions.
File summaries
File Description
.github/workflows/fortress-test-matrix.yml Adds matrix preflight and safer shell inputs.
.github/actions/setup-benchstat/action.yml Adds adaptive benchstat version selection.
.github/actions/validate-test-results/action.yml Detects and reports process-level failures.
.github/env/00-core.env Updates the govulncheck Go version.
.github/env/10-mage-x.env Updates tools and benchstat pins.
.github/env/10-pre-commit.env Updates golangci-lint.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage Analysis

🟢 Overall Coverage: 91.5%
No Go files modified in this PR

Project coverage remains at 91.5% (3.2K/3.5K statements)

Changes: 6 config files

Coverage Metrics

Metric Value Grade Trend
Percentage 91.5% 🏆 A 📊
Statements 3.2K/3.5K 🏆 A No change
Quality Score 91.5/100 🏆 A 📈

Coverage Breakdown

█████████████░░ 91.5%

Resources


Generated via go-coverage • 2026-08-22 15:20:22 UTC

github-actions Bot added a commit that referenced this pull request Aug 22, 2026
🏷️ Generated with GoFortress
@mrz1836
mrz1836 merged commit 979de20 into master Aug 22, 2026
26 checks passed
@github-actions
github-actions Bot deleted the chore/sync-files-go-pre-commit-20260822-151450-5270e65 branch August 22, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps size/L Large change (201-500 lines) update General updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants