Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/scripts/test-generate-integration-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_unqualified_producer_permissions_or_context_drift_cannot_generate_green
elif mutation == "missing":
job["name"] = "not-the-required-context"
elif mutation == "checkout":
job = documents["v2-ci.yml"]["jobs"]["build-go"]
checkout = next(step for step in job["steps"] if str(step.get("uses", "")).startswith("actions/checkout@"))
checkout.setdefault("with", {})["ref"] = "other-head"
else:
Expand Down
16 changes: 9 additions & 7 deletions .github/scripts/test-native-queue-workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,22 @@ def test_gosec_concurrency_fits_the_runner_cpu_limit(self):
# gosec defaults -concurrency to runtime.NumCPU(), which inside a
# runner pod is the NODE's vCPU count, not the pod's cgroup limit.
# Unbounded, every worker type-checks and builds SSA for its own
# package at once, and the pod is OOM-killed or evicted mid-Scan:
# "runner lost communication", hivecommons/hive#16040. The pod CPU
# limit is a ceiling, not a memory proof: it only guarantees gosec
# never runs more workers than the pod can schedule.
# package at once, a plausible source of runner memory pressure
# in hivecommons/hive#16040. The pod CPU limit is a ceiling, not an
# OOM diagnosis or memory proof: it only bounds worker fanout.
values = yaml.safe_load(
(ROOT / "src/deploy/ci-runners/lke/hive-runners-lke-values.yaml").read_text())
runner = next(c for c in values["template"]["spec"]["containers"]
if c["name"] == "runner")
cpu = str(runner["resources"]["limits"]["cpu"])
cpu_limit = int(cpu[:-1]) // 1000 if cpu.endswith("m") else int(float(cpu))
for file in ("go-security-analysis.yml",
"integration-technical-go-security-analysis.yml"):
for file, job in (
("go-security-analysis.yml", "gosec"),
("integration-technical-go-security-analysis.yml", "gosec"),
("integration-candidate.yml", "security-gosec"),
):
with self.subTest(file=file):
steps = workflow(file)["jobs"]["gosec"]["steps"]
steps = workflow(file)["jobs"][job]["steps"]
scan = next(s for s in steps if s.get("name") == "Scan")["run"]
match = re.search(r"\bgosec\b.*\s-concurrency[ =](\d+)\b", scan)
self.assertIsNotNone(match, f"gosec must pass an explicit -concurrency: {scan!r}")
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ jobs:
self_hosted: true
qemu: true
timeout_minutes: 75
runs-on: ${{ matrix.qemu && fromJSON(vars.HIVE_ARM64_RUNNER || vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || ((github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON(vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || 'ubuntu-latest') }}
# Public PRs use the same free native ARM64 VM as the Podman arm64 lane.
# Explicit ARM64 overrides and all release/push runner selection stay intact.
runs-on: ${{ matrix.qemu && fromJSON(vars.HIVE_ARM64_RUNNER || (github.event_name == 'pull_request' && github.event.repository.private == false && '["ubuntu-24.04-arm"]' || vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]')) || ((github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON(vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || 'ubuntu-latest') }}
timeout-minutes: ${{ matrix.timeout_minutes }}
steps:
- name: Checkout repository
Expand All @@ -293,7 +295,7 @@ jobs:
fetch-tags: true

- name: Set up QEMU for arm64 emulation
if: matrix.qemu
if: matrix.qemu && runner.arch != 'ARM64'
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
platforms: arm64
Expand Down Expand Up @@ -439,6 +441,7 @@ jobs:
else
IMG=hive-freshness-probe:local
docker buildx build --load \
--platform "${{ matrix.platform }}" \
-f src/Dockerfile \
--build-arg BASE_REGISTRY="$BASE_REGISTRY" \
--build-arg GIT_HASH="$EXPECTED_SHA" \
Expand Down Expand Up @@ -681,7 +684,7 @@ jobs:
self_hosted: true
qemu: true
timeout_minutes: 75
runs-on: ${{ matrix.qemu && fromJSON(vars.HIVE_ARM64_RUNNER || vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || ((github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON(vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || 'ubuntu-latest') }}
runs-on: ${{ matrix.qemu && fromJSON(vars.HIVE_ARM64_RUNNER || (github.event_name == 'pull_request' && github.event.repository.private == false && '["ubuntu-24.04-arm"]' || vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]')) || ((github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON(vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || 'ubuntu-latest') }}
timeout-minutes: ${{ matrix.timeout_minutes }}
steps:
- name: Checkout repository
Expand All @@ -690,7 +693,7 @@ jobs:
ref: ${{ needs.gate.outputs.sha }}

- name: Set up QEMU for arm64 emulation
if: matrix.qemu
if: matrix.qemu && runner.arch != 'ARM64'
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
platforms: arm64
Expand Down Expand Up @@ -890,7 +893,7 @@ jobs:
self_hosted: true
qemu: true
timeout_minutes: 75
runs-on: ${{ matrix.qemu && fromJSON(vars.HIVE_ARM64_RUNNER || vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || ((github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON(vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || 'ubuntu-latest') }}
runs-on: ${{ matrix.qemu && fromJSON(vars.HIVE_ARM64_RUNNER || (github.event_name == 'pull_request' && github.event.repository.private == false && '["ubuntu-24.04-arm"]' || vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]')) || ((github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && fromJSON(vars.HIVE_RUNNER_LABELS || '["ubuntu-latest"]') || 'ubuntu-latest') }}
timeout-minutes: ${{ matrix.timeout_minutes }}
steps:
- name: Checkout repository
Expand All @@ -904,7 +907,7 @@ jobs:
fetch-tags: true

- name: Set up QEMU for arm64 emulation
if: matrix.qemu
if: matrix.qemu && runner.arch != 'ARM64'
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
platforms: arm64
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/go-security-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,16 @@ jobs:
# v0.25.0, which does not COMPILE under Go 1.25 ("invalid array length").
# The failure looks like a scan failure but is a build failure in the
# tool itself — do not downgrade to "fix" a finding.
- name: Restore pinned gosec binary
id: gosec-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/hive-ci-tools/gosec
key: hive-gosec-${{ runner.os }}-${{ runner.arch }}-v2.29.0-${{ hashFiles('src/go.mod') }}
- name: Install gosec
if: steps.gosec-cache.outputs.cache-hit != 'true'
env:
GOBIN: ${{ runner.temp }}/hive-ci-tools
run: go install github.com/securego/gosec/v2/cmd/gosec@v2.29.0

# -exclude-generated: generated files are not hand-maintained, so a
Expand All @@ -256,14 +265,17 @@ jobs:
# -concurrency 4: gosec defaults to runtime.NumCPU(), which in a runner
# pod is the NODE's 32 vCPUs, not the pod's 6-CPU limit
# (src/deploy/ci-runners/lke/hive-runners-lke-values.yaml). Each worker
# type-checks and builds SSA for its own package, so 32 at once pushed
# the pod far past its 3Gi request and it was killed mid-Scan — the
# "runner lost communication" failures of #16040. Keep this at or below
# the runner CPU limit (test-native-queue-workflows.py enforces it).
# type-checks and builds SSA for its own package, so 32 at once can
# create memory pressure. This bounds a plausible contributor to the
# "runner lost communication" failures of #16040, not a proven OOM
# diagnosis. Keep this at or below the runner CPU limit
# (test-native-queue-workflows.py enforces it).
- name: Scan
working-directory: src
continue-on-error: true
run: gosec -concurrency 4 -exclude-generated ./... ./crux/...
# Unlike go test/vet, gosec recursively discovers nested modules.
# Listing ./crux/... too scans every Crux directory twice.
run: '"${{ runner.temp }}/hive-ci-tools/gosec" -concurrency 4 -exclude-generated ./...'

golangci-lint:
needs: required-context-scope
Expand Down
Loading
Loading