Skip to content

Commit 77063bc

Browse files
committed
ci(security): raise the codeql-gate wait from 45 to 150 minutes
The gate waited 90 x 30s = 45 min for CodeQL to finish on the PR head. That is shorter than CodeQL actually takes on this repository, so the gate has been failing runs that had not failed. Measured on PR DeusData#1426, head 7b72652: the CodeQL SAST workflow completed with conclusion=success at 17:46:05, having started at 15:41:44 -- 124 minutes. The gate step ran 16:52:58 to 17:38:44 and reported "BLOCKED: CodeQL timeout" 7 minutes and 21 seconds before the scan it was waiting for succeeded. Two open contributor pull requests are red from exactly this: DeusData#1426 and DeusData#1769, both with CodeQL completed=success on their head and every other check green. Three further PRs (DeusData#1703, DeusData#1741, DeusData#1742) are also red on codeql-gate alone, but from a different cause: the CodeQL run on their head is completed=cancelled, so the gate saw a non-success conclusion and correctly exited 1 without waiting. This change does not help those and is not intended to; they need a fresh scan, most likely having been superseded by concurrency cancel-in-progress in codeql.yml. 300 x 30s = 150 min covers the measured 124 min with margin. The job already declares timeout-minutes: 240, so the wait still cannot outlive its own job. No trigger, permission or gating change: codeql-gate blocks exactly what it blocked before, and a genuine CodeQL failure still exits 1 immediately rather than waiting out the budget. Only the absence of a verdict waits longer. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 9b24332 commit 77063bc

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎.github/workflows/_security.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,25 @@ jobs:
4242
runs-on: ubuntu-latest
4343
timeout-minutes: 240
4444
steps:
45-
- name: Wait for CodeQL on current commit (max 45 min)
45+
- name: Wait for CodeQL on current commit (max 150 min)
4646
env:
4747
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
run: |
4949
# On pull_request events github.sha is the synthetic merge commit;
5050
# CodeQL runs are recorded against the PR head SHA.
5151
CURRENT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
5252
echo "Waiting for CodeQL to complete on $CURRENT_SHA..."
53-
for attempt in $(seq 1 90); do
53+
# 300 attempts x 30s = 150 min. The previous budget was 90 x 30s = 45 min,
54+
# which is shorter than CodeQL actually takes on this repository: a measured
55+
# run on PR #1426 (head 7b72652a) completed with conclusion=success after
56+
# 124 min, 7 minutes AFTER this gate had already given up. That marked at
57+
# least five contributor PRs red for a scan that passed. The job's own
58+
# timeout-minutes is 240, so 150 still leaves headroom.
59+
for attempt in $(seq 1 300); do
5460
LATEST=$(gh api "repos/${{ github.repository }}/actions/workflows/codeql.yml/runs?head_sha=$CURRENT_SHA&per_page=1" \
5561
--jq '.workflow_runs[] | "\(.conclusion) \(.status)"' 2>/dev/null | head -1 || echo "")
5662
if [ -z "$LATEST" ]; then
57-
echo " $attempt/90: no run yet..."; sleep 30; continue
63+
echo " $attempt/300: no run yet..."; sleep 30; continue
5864
fi
5965
CONCLUSION=$(echo "$LATEST" | cut -d' ' -f1)
6066
STATUS=$(echo "$LATEST" | cut -d' ' -f2)
@@ -63,7 +69,7 @@ jobs:
6369
elif [ "$STATUS" = "completed" ]; then
6470
echo "BLOCKED: CodeQL $CONCLUSION"; exit 1
6571
fi
66-
echo " $attempt/90: $STATUS..."; sleep 30
72+
echo " $attempt/300: $STATUS..."; sleep 30
6773
done
6874
echo "BLOCKED: CodeQL timeout"; exit 1
6975

0 commit comments

Comments
 (0)