Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
description: 'Runner to use for the workflow'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
build_runner_type:
description: 'Optional runner override for the Build jobs only (prepare/notify stay on runner_type). Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
filter_paths:
description: 'Newline-separated list of path prefixes to filter. If not provided, builds from root.'
type: string
Expand Down Expand Up @@ -277,7 +281,7 @@ jobs:
build:
needs: prepare
if: needs.prepare.outputs.has_builds == 'true'
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.build_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
name: Build ${{ matrix.app.name }}
permissions:
contents: read
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/go-pr-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ on:
description: 'GitHub runner type'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
lint_runner_type:
description: 'Optional runner override for the Lint jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
test_runner_type:
description: 'Optional runner override for the Tests jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
coverage_runner_type:
description: 'Optional runner override for the Coverage jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
build_runner_type:
description: 'Optional runner override for the Build jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
filter_paths:
description: 'JSON array of paths to monitor for changes (e.g., ["apps/api", "apps/worker"]). If empty, treats repo as single-app and runs against root directory.'
type: string
Expand Down Expand Up @@ -143,7 +159,7 @@ jobs:
name: Lint (${{ matrix.app.name }})
needs: detect-changes
if: needs.detect-changes.outputs.has_changes == 'true' && inputs.enable_lint
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.lint_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -335,7 +351,7 @@ jobs:
name: Tests (${{ matrix.app.name }})
needs: detect-changes
if: needs.detect-changes.outputs.has_changes == 'true' && inputs.enable_tests
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.test_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -514,7 +530,7 @@ jobs:
name: Coverage (${{ matrix.app.name }})
needs: [detect-changes, tests]
if: needs.detect-changes.outputs.has_changes == 'true' && inputs.enable_coverage
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.coverage_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -795,7 +811,7 @@ jobs:
name: Build (${{ matrix.app.name }})
needs: detect-changes
if: needs.detect-changes.outputs.has_changes == 'true' && inputs.enable_build
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.build_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
strategy:
fail-fast: false
matrix:
Expand Down
42 changes: 38 additions & 4 deletions .github/workflows/go-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
description: 'GitHub runner type to use'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
gate_runner_type:
description: 'Optional runner override for the umbrella utility jobs only (Detect non-doc changes and the Go Analysis / Security / Lib Version result gates). Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
dry_run:
description: 'Preview metadata validations without posting comments or labels'
required: false
Expand Down Expand Up @@ -82,12 +86,32 @@ on:
description: 'Target branches that require source branch validation (pipe-separated)'
type: string
default: 'main'
pr_checks_summary_runner_type:
description: 'Optional runner override for the PR Checks Summary job only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''

# ----------------- Go analysis (go-pr-analysis.yml) -----------------
go_version:
description: 'Go version to use'
type: string
default: '1.23'
lint_runner_type:
description: 'Optional runner override for the Go analysis Lint jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
test_runner_type:
description: 'Optional runner override for the Go analysis Tests jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
coverage_runner_type:
description: 'Optional runner override for the Go analysis Coverage jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
build_runner_type:
description: 'Optional runner override for the Go analysis Build jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
golangci_lint_version:
description: 'GolangCI-Lint version'
type: string
Expand Down Expand Up @@ -158,6 +182,10 @@ on:
description: 'Path to Trivy ignore file (e.g., .trivyignore.yaml)'
type: string
default: ''
security_scan_runner_type:
description: 'Optional runner override for the security_scan jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
enable_docker_scan:
description: 'Build and scan a Docker image with Trivy. Set to false for repos without a root Dockerfile (e.g. monorepos with Dockerfiles under components/ or cmd/).'
type: boolean
Expand Down Expand Up @@ -229,6 +257,7 @@ jobs:
uses: ./.github/workflows/pr-validation.yml
with:
runner_type: ${{ inputs.runner_type }}
pr_checks_summary_runner_type: ${{ inputs.pr_checks_summary_runner_type }}
dry_run: ${{ inputs.dry_run }}
pr_title_types: ${{ inputs.pr_title_types }}
pr_title_scopes: ${{ inputs.pr_title_scopes }}
Expand All @@ -248,7 +277,7 @@ jobs:
changes:
name: Detect non-doc changes
if: contains(fromJSON('["opened","edited","synchronize","reopened","ready_for_review"]'), github.event.action)
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.gate_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
permissions:
contents: read
pull-requests: read
Expand All @@ -270,6 +299,10 @@ jobs:
uses: ./.github/workflows/go-pr-analysis.yml
with:
runner_type: ${{ inputs.runner_type }}
lint_runner_type: ${{ inputs.lint_runner_type }}
test_runner_type: ${{ inputs.test_runner_type }}
coverage_runner_type: ${{ inputs.coverage_runner_type }}
build_runner_type: ${{ inputs.build_runner_type }}
go_version: ${{ inputs.go_version }}
golangci_lint_version: ${{ inputs.golangci_lint_version }}
golangci_lint_args: ${{ inputs.golangci_lint_args }}
Expand Down Expand Up @@ -300,7 +333,7 @@ jobs:
name: Go Analysis
needs: [changes, go-analysis]
if: always()
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.gate_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
steps:
- name: Aggregate Go Analysis result
uses: LerianStudio/github-actions-shared-workflows/src/validate/result-gate@v1
Expand All @@ -316,6 +349,7 @@ jobs:
uses: ./.github/workflows/pr-security-scan.yml
with:
runner_type: ${{ inputs.runner_type }}
security_scan_runner_type: ${{ inputs.security_scan_runner_type }}
ignore_file: ${{ inputs.ignore_file }}
enable_docker_scan: ${{ inputs.enable_docker_scan }}
dockerfile_path: ${{ inputs.dockerfile_path }}
Expand All @@ -333,7 +367,7 @@ jobs:
name: Security
needs: [changes, security]
if: always()
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.gate_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
steps:
- name: Aggregate security result
uses: LerianStudio/github-actions-shared-workflows/src/validate/result-gate@v1
Expand All @@ -359,7 +393,7 @@ jobs:
name: Lib Version
needs: [changes, lib-version]
if: always()
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.gate_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
steps:
- name: Aggregate Lib Version result
uses: LerianStudio/github-actions-shared-workflows/src/validate/result-gate@v1
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ on:
description: 'GitHub runner type to use'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
build_runner_type:
description: 'Optional runner override for the Build jobs only (forwarded to build.yml; prepare/notify stay on runner_type). Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
release_runner_type:
description: 'Optional runner override for the Release (publish) jobs only (forwarded to release.yml as publish_runner_type). Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
dry_run:
description: 'Reserved. Downstream release/build/gitops workflows do not yet expose a dry-run mode.'
required: false
Expand Down Expand Up @@ -393,6 +401,7 @@ jobs:
uses: ./.github/workflows/release.yml
with:
runner_type: ${{ inputs.runner_type }}
publish_runner_type: ${{ inputs.release_runner_type }}
semantic_version: ${{ inputs.semantic_version }}
enable_changelog: ${{ inputs.enable_changelog }}
enable_major_tag: ${{ inputs.enable_major_tag }}
Expand Down Expand Up @@ -433,6 +442,7 @@ jobs:
release_version: ${{ github.ref_type == 'branch' && needs.release.outputs.new_release_version || '' }}
checkout_ref: ${{ github.ref_type == 'branch' && needs.release.outputs.new_release_git_tag || '' }}
runner_type: ${{ inputs.runner_type }}
build_runner_type: ${{ inputs.build_runner_type }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Forward build_runner_type to every build call.

Line 445 forwards the override to the primary build call. The extra_build job also calls .github/workflows/build.yml but does not pass this input. Callers that set build_runner_type therefore get inconsistent runner selection, and extra builds fall back to vars.GENERAL_RUNNERS or runner_type.

Add the same mapping to the extra_build call.

Proposed fix
       runner_type: ${{ inputs.runner_type }}
+      build_runner_type: ${{ inputs.build_runner_type }}
       enable_dockerhub: ${{ (matrix.group.enable_dockerhub == null && inputs.enable_dockerhub == true) || matrix.group.enable_dockerhub == true }}
🤖 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/go-release.yml at line 445, Update the extra_build
invocation in the release workflow to forward inputs.build_runner_type using the
same build_runner_type mapping already present in the primary build call,
ensuring both build calls honor the caller’s runner selection override.

enable_dockerhub: ${{ inputs.enable_dockerhub }}
enable_ghcr: ${{ inputs.enable_ghcr }}
enable_gitops_artifacts: ${{ inputs.enable_gitops_artifacts }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/js-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
description: 'GitHub runner type to use'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
release_runner_type:
description: 'Optional runner override for the Release (publish) jobs only (forwarded to release.yml as publish_runner_type). Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
dry_run:
description: 'Run semantic-release in dry-run mode (no tags/releases created) and preview the backmerge instead of applying it'
required: false
Expand Down Expand Up @@ -299,6 +303,7 @@ jobs:
uses: ./.github/workflows/release.yml
with:
runner_type: ${{ inputs.runner_type }}
publish_runner_type: ${{ inputs.release_runner_type }}
dry_run: ${{ inputs.dry_run }}
semantic_version: ${{ inputs.semantic_version }}
enable_changelog: ${{ inputs.enable_changelog }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pr-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
description: 'GitHub runner type to use'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
security_scan_runner_type:
description: 'Optional runner override for the security_scan jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
filter_paths:
description: 'Paths to monitor for changes (newline separated). If not provided, treats as single app repo'
type: string
Expand Down Expand Up @@ -161,7 +165,7 @@ jobs:
security_scan:
needs: prepare_matrix
if: needs.prepare_matrix.outputs.matrix != '[]'
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.security_scan_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
strategy:
max-parallel: 1
fail-fast: false
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
description: 'GitHub runner type to use'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
pr_checks_summary_runner_type:
description: 'Optional runner override for the PR Checks Summary job only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
dry_run:
description: Preview validations without posting comments or labels
required: false
Expand Down Expand Up @@ -174,7 +178,7 @@ jobs:
# ----------------- PR Checks Summary -----------------
pr-checks-summary:
name: PR Checks Summary
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.pr_checks_summary_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
needs: [blocking-checks, advisory-checks]
if: always()

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ on:
description: 'Runner to use for the workflow'
type: string
default: 'blacksmith-4vcpu-ubuntu-2404'
publish_runner_type:
description: 'Optional runner override for the Release (publish) jobs only. Empty = vars.GENERAL_RUNNERS, then runner_type.'
type: string
default: ''
filter_paths:
description: 'Newline-separated list of path prefixes to filter. If not provided, treats as single app repo.'
type: string
Expand Down Expand Up @@ -185,7 +189,7 @@ jobs:
publish_release:
needs: prepare
if: needs.prepare.outputs.has_changes == 'true' && needs.prepare.outputs.should_skip != 'true'
runs-on: ${{ vars.GENERAL_RUNNERS || inputs.runner_type }}
runs-on: ${{ inputs.publish_runner_type || vars.GENERAL_RUNNERS || inputs.runner_type }}
environment:
name: create_release
name: Release ${{ matrix.app.name }}
Expand Down
2 changes: 2 additions & 0 deletions config/deployment-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ apps:
- br-slc
- br-ccs
- br-sisbajud
- br-consignado-gw
- streaming-hub

# Test/mock infrastructure
Expand Down Expand Up @@ -178,6 +179,7 @@ clusters:
- br-slc
- br-ccs
- br-sisbajud
- br-consignado-gw
- mock-btg-server
- backoffice-console
- cs-platform
Expand Down
1 change: 1 addition & 0 deletions docs/build-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
| Input | Type | Default | Description |
|-------|------|---------|-------------|
| `runner_type` | string | `firmino-lxc-runners` | GitHub runner type |
| `build_runner_type` | string | `''` | Optional runner override for the Build jobs only (prepare/notify stay on `runner_type`); empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` |
| `filter_paths` | string | `''` | Newline-separated list of path prefixes. If empty, builds from root (single-app mode) |
| `path_level` | string | `2` | Directory depth for app name extraction |
| `enable_dockerhub` | boolean | `true` | Enable pushing to DockerHub |
Expand Down
4 changes: 4 additions & 0 deletions docs/go-pr-analysis-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ jobs:
| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `runner_type` | GitHub runner type | No | `firmino-lxc-runners` |
| `lint_runner_type` | Optional runner override for the Lint jobs only; empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | No | `''` |
| `test_runner_type` | Optional runner override for the Tests jobs only; empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | No | `''` |
| `coverage_runner_type` | Optional runner override for the Coverage jobs only; empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | No | `''` |
| `build_runner_type` | Optional runner override for the Build jobs only; empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | No | `''` |
| `filter_paths` | JSON array of paths to monitor for changes. If empty, treats repo as single-app. | No | `''` |
| `path_level` | Directory depth level to extract app name | No | `2` |
| `normalize_to_filter` | Collapse every changed file under a `filter_paths` entry into that one component (`working_dir` = the filter itself) instead of the `path_level`-trimmed directory. With `false`, a change deeper than `path_level` segments inside a filtered component spawns a bogus matrix entry rooted at that subdirectory — no testable package, so no `coverage.txt`, and the coverage job fails with "Artifact not found". | No | `true` |
Expand Down
7 changes: 7 additions & 0 deletions docs/go-pr-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ The `go-analysis`, `security` and `lib-version` pipelines each have a `*-gate` a
| Input | Description | Type | Default |
|-------|-------------|------|---------|
| `runner_type` | GitHub runner type | string | `blacksmith-4vcpu-ubuntu-2404` |
| `gate_runner_type` | Optional runner override for the umbrella utility jobs only (Detect non-doc changes + Go Analysis / Security / Lib Version result gates); empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | string | `''` |
| `lint_runner_type` | Optional runner override for the Go analysis Lint jobs only | string | `''` |
| `test_runner_type` | Optional runner override for the Go analysis Tests jobs only | string | `''` |
| `coverage_runner_type` | Optional runner override for the Go analysis Coverage jobs only | string | `''` |
| `build_runner_type` | Optional runner override for the Go analysis Build jobs only | string | `''` |
| `security_scan_runner_type` | Optional runner override for the security_scan jobs only | string | `''` |
| `pr_checks_summary_runner_type` | Optional runner override for the PR Checks Summary job only | string | `''` |
| `dry_run` | Preview metadata validations without posting comments/labels | boolean | `false` |
| `run_go_analysis` | Run the Go analysis pipeline | boolean | `true` |
| `run_security` | Run the security scan pipeline | boolean | `true` |
Expand Down
2 changes: 2 additions & 0 deletions docs/go-release-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ A third layout needs `release_single_app: true`: **one semantic-release tag for
| Input | Description | Type | Default |
|-------|-------------|------|---------|
| `runner_type` | GitHub runner type | string | `blacksmith-4vcpu-ubuntu-2404` |
| `build_runner_type` | Optional runner override for the Build jobs only (forwarded to build.yml; prepare/notify stay on `runner_type`); empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | string | `''` |
| `release_runner_type` | Optional runner override for the Release (publish) jobs only (forwarded to release.yml as `publish_runner_type`); empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | string | `''` |
| `dry_run` | Reserved (downstream workflows have no dry-run mode yet) | boolean | `false` |
| `ignore_globs` | Space-separated globs treated as docs/meta for the branch-push gate | string | `*.md docs/* .github/* LICENSE* .gitignore` |
| `semantic_version` | semantic-release version | string | `23.0.8` |
Expand Down
1 change: 1 addition & 0 deletions docs/js-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Mirrors the [`go-release`](./go-release-workflow.md) umbrella for Go services
| Input | Description | Type | Default |
|-------|-------------|------|---------|
| `runner_type` | GitHub runner type | string | `blacksmith-4vcpu-ubuntu-2404` |
| `release_runner_type` | Optional runner override for the Release (publish) jobs only (forwarded to release.yml as `publish_runner_type`); empty falls back to `vars.GENERAL_RUNNERS`, then `runner_type` | string | `''` |
| `dry_run` | Run semantic-release and build in dry-run mode (no tags/releases/images created); also skips the E2E test job entirely | boolean | `false` |
| `ignore_globs` | Space-separated globs treated as docs/meta for the branch-push gate | string | `*.md docs/* .github/* LICENSE* .gitignore` |
| `semantic_version` | semantic-release version | string | `23.0.8` |
Expand Down
Loading