Skip to content

[Sync] Update project files from source repository (cc3b19e) - #351

Merged
mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-bitcoin-20260822-003200-cc3b19e
Aug 22, 2026
Merged

mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-bitcoin-20260822-003200-cc3b19e

Conversation

@mrz1836

@mrz1836 mrz1836 commented Aug 22, 2026

Copy link
Copy Markdown
Member

What Changed

  • MATRIX_OS: ${{ matrix.os }} → ${{ matrix.os }} (.github/actions/setup-benchstat/action.yml)

  • Added WINDOWS = $(jq -r ' (.github/actions/setup-benchstat/action.yml)

  • Added a new validate-matrix preflight job in .github/workflows/fortress-test-matrix.yml that runs before test execution to validate the caller-provided test matrix on a Linux runner and reject unsupported Windows runners

  • Refactored shell variable handling in .github/actions/setup-benchstat/action.yml to route GitHub Actions expressions through env: blocks instead of direct ${{ }} interpolation in scripts for improved shell safety

  • Moved GO_VERSION from inline script assignment to env block (GO_VERSION: ${{ inputs.go-version }})

  • Added multiple new environment variables including TEST_MATRIX, MATRIX_NAME, MATRIX_GO_VERSION, RACE_DETECTION_ENABLED, CODE_COVERAGE_ENABLED, REDIS_ENABLED, REDIS_VERSION, REDIS_CACHE_HIT, REDIS_IMAGE_SIZE, REDIS_CACHE_OP_TIME, REDIS_CONNECTION_TIME, and TEST_EXIT_CODE

  • Changed variable references in scripts from direct interpolation to environment variable expansion (e.g., RACE from ${{ inputs.race-detection-enabled || 'false' }} to ${RACE_DETECTION_ENABLED:-false}, COVER from ${{ inputs.code-coverage-enabled || 'false' }} to ${CODE_COVERAGE_ENABLED:-false}, and CODE from ${{ steps.run-tests.outputs.test-exit-code }} to $TEST_EXIT_CODE)

  • Added JSON validation and Windows runner rejection logic that fails fast with clear error messages before test jobs are scheduled

Why It Was Necessary

  • Prevents shell injection vulnerabilities by routing all caller-controlled and matrix-controlled inputs through environment variables instead of direct shell interpolation
  • Provides better error handling by validating the test matrix JSON structure early and rejecting unsupported Windows configurations before service containers (which are Linux-only) are initialized during GitHub Actions job setup
  • Ensures failures are caught in the preflight validation stage with clear error messages rather than cryptic service container initialization failures that occur before in-step guards can run

Testing Performed

  • Validation logic includes JSON syntax checking using jq empty to fail fast on malformed test matrix inputs
  • Windows runner detection validates both classic matrix shapes and include-based matrix configurations by extracting OS values from the JSON structure
  • Gate mechanism implemented via needs: validate-matrix ensures the test-go job and all its matrix legs are blocked from starting if preflight validation fails

Impact / Risk

  • Low Risk: Changes are defensive improvements that add validation without modifying core test execution logic
  • Breaking Change: None - the validation enforces constraints that should already be met by existing configurations
  • Developer Experience: Failures now surface faster with clearer error messages during the preflight stage rather than during job setup, reducing wasted CI time and improving debuggability

Copilot AI lite review requested due to automatic review settings August 22, 2026 00:32
@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/M Medium change (51-200 lines) labels Aug 22, 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

This PR hardens the GoFortress CI reusable workflow by validating the caller-provided test matrix up front and by reducing direct GitHub Actions expression interpolation inside bash scripts to improve shell safety and failure clarity.

Changes:

  • Added a validate-matrix preflight job that parses inputs.test-matrix and rejects Windows runners before test-go (and its service containers) can be scheduled.
  • Refactored several workflow steps to pass caller/matrix-controlled values via env: variables rather than ${{ }} interpolation inside run: blocks.
  • Updated the setup-benchstat composite action to source GO_VERSION from env: instead of assigning it inline in the script.

Reviewed changes

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

File Description
.github/workflows/fortress-test-matrix.yml Adds preflight matrix validation and routes matrix/inputs into env vars for safer bash execution.
.github/actions/setup-benchstat/action.yml Moves GO_VERSION assignment into env: for consistent shell-safety handling.

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

@mrz1836
mrz1836 merged commit 49294c4 into master Aug 22, 2026
25 checks passed
@github-actions
github-actions Bot deleted the chore/sync-files-go-bitcoin-20260822-003200-cc3b19e branch August 22, 2026 00:47
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/M Medium change (51-200 lines) update General updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants