Skip to content

Commit 09ddba8

Browse files
authored
Merge pull request #232 from coder13/agent/codeql-dev-coverage
Run CodeQL on dev pushes
2 parents b5b67c1 + 7064708 commit 09ddba8

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
- name: Validate CI branch coverage
2222
run: scripts/test-ci-branches.sh
2323

24+
- name: Validate CodeQL branch coverage
25+
run: scripts/test-codeql-branches.sh
26+
2427
server:
2528
name: Server lint and unit tests
2629
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7+
- dev
78
- master
89
schedule:
910
- cron: '23 10 * * 1'

docs/release-workflow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Production deployment remains a separately authorized operation described in
99
1. Open each focused feature pull request against `dev`.
1010
2. Review and merge the feature into `dev`.
1111
3. Treat the resulting `dev` merge commit as the release candidate. Its push
12-
CI run must finish before promotion is considered.
12+
CI and CodeQL push runs must finish before promotion is considered.
1313
4. Open a reviewed promotion from that exact `dev` commit to `master`.
1414
5. After the promotion is merged and its `master` push CI passes, perform the
1515
separately authorized deployment procedure.
@@ -22,8 +22,8 @@ on `dev` after release-candidate validation requires a new validation run.
2222
Before approving a `dev` to `master` promotion, record or link the following in
2323
the promotion pull request:
2424

25-
- the exact `dev` commit SHA and its successful CI run, including Cypress for
26-
full-stack changes;
25+
- the exact `dev` commit SHA and its successful CI and CodeQL push runs,
26+
including Cypress for full-stack changes;
2727
- the review that approved the promotion and any issue or milestone links;
2828
- focused and broad checks relevant to the change, including checks not run;
2929
- schema migration compatibility and data-backfill evidence when persistence

scripts/test-codeql-branches.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
5+
WORKFLOW="$SCRIPT_DIR/../.github/workflows/codeql.yml"
6+
7+
for branch in dev master; do
8+
if ! awk '
9+
/^ push:/ { in_push = 1; next }
10+
in_push && /^ [^[:space:]]/ { exit }
11+
in_push && $0 == " - " branch { found = 1 }
12+
END { exit !found }
13+
' branch="$branch" "$WORKFLOW"; then
14+
echo "CodeQL must run on pushes to $branch." >&2
15+
exit 1
16+
fi
17+
done
18+
19+
echo "CodeQL push branch coverage checks passed."

0 commit comments

Comments
 (0)