Skip to content

[Sync] Update project files from source repository (ca0ff0d) - #350

Merged
mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-bitcoin-20260821-163710-ca0ff0d
Aug 21, 2026
Merged

mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-bitcoin-20260821-163710-ca0ff0d

Conversation

@mrz1836

@mrz1836 mrz1836 commented Aug 21, 2026

Copy link
Copy Markdown
Member

What Changed

  • Replaced the fallback-based parsing logic for BENCHSTAT_LATEST_MIN_GO in .github/actions/setup-benchstat/action.yml with a strict regex validation that fails fast on invalid input
  • Changed from sed-based parsing with silent fallback to 1.26 defaults to a BASH_REMATCH-based approach that exits with a clear error message when the version cannot be parsed
  • Added a new guard step at the beginning of .github/workflows/fortress-test-matrix.yml that explicitly blocks Windows runners with a clear error message
  • The new guard step uses shell: bash to detect windows* in matrix.os and exits immediately before other bash-only steps can fail in confusing ways

Why It Was Necessary

  • The old sed-based parsing would silently fall back to hard-coded 1.26 defaults on malformed input, which could select incompatible builds once benchstat requires Go 1.27+ without surfacing the configuration error
  • The old regex allowed invalid inputs like "127" or "1.2z" to pass through, and typos in version strings would go undetected
  • The fortress test matrix workflow is bash-only but could be invoked with Windows runners from caller-provided inputs, causing confusing partial failures under PowerShell instead of clear upfront error messages

Testing Performed

  • Validated that the new regex pattern correctly matches valid Go versions (e.g., "1.26", "1.27.x", "1.26.3") and rejects invalid ones
  • Confirmed that malformed BENCHSTAT_LATEST_MIN_GO values now trigger immediate failure with the clear error message instead of silent fallback
  • Verified that the Windows runner guard runs under Git Bash on Windows runners and emits the expected error before any other steps execute

Impact / Risk

  • Low Risk: Changes improve error detection by failing fast on invalid configuration rather than silently using stale defaults
  • Breaking Change: Workflows that previously relied on silent fallback to 1.26 for malformed BENCHSTAT_LATEST_MIN_GO values will now fail explicitly—this is intentional to surface configuration errors
  • Developer Experience: Both changes provide clearer, more actionable error messages when configuration is invalid or incompatible runners are used

Copilot AI lite review requested due to automatic review settings August 21, 2026 16:37
@mrz1836 mrz1836 self-assigned this Aug 21, 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 21, 2026
@github-actions github-actions Bot added update General updates size/S Small change (11-50 lines) labels Aug 21, 2026

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.

Pull request overview

Updates CI configuration with strict benchstat Go-version validation and a Windows-runner guard.

Changes:

  • Replaces silent version fallback with regex validation.
  • Adds Bash-based Windows runner detection.
  • The workflow guard requires redesign because service containers initialize before steps, and direct matrix interpolation creates shell-injection risk.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Summary
.github/workflows/fortress-test-matrix.yml Adds a Windows guard, but has a moderate issue (4 votes): service setup may fail before the guard runs. It also has a critical issue (4 votes): matrix values are interpolated unsafely into shell code.
.github/actions/setup-benchstat/action.yml Replaces fallback parsing with strict minimum Go-version validation.
Suppressed comments (1)

.github/workflows/fortress-test-matrix.yml:148

  • matrix.os is a runs-on label, not a reliable representation of the operating system. For example, a Windows self-hosted runner can be selected by self-hosted or a custom label, and the lowercase windows* pattern will then miss it and allow the Bash-only steps to continue. Use the runner's RUNNER_OS value (Windows) for this check, retaining matrix.os only for the diagnostic message.
          if [[ "$MATRIX_OS" == windows* ]]; then

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

@mrz1836
mrz1836 merged commit 82695a0 into master Aug 21, 2026
24 checks passed
@github-actions
github-actions Bot deleted the chore/sync-files-go-bitcoin-20260821-163710-ca0ff0d branch August 21, 2026 18:27
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/S Small change (11-50 lines) update General updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants