Skip to content

fix(ci): keep CodeQL Action versions consistent - #728

Closed
seonghobae wants to merge 1 commit into
mainfrom
fix/codeql-action-version-consistency
Closed

fix(ci): keep CodeQL Action versions consistent#728
seonghobae wants to merge 1 commit into
mainfrom
fix/codeql-action-version-consistency

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Problem

The central default branch mixes CodeQL Action 4.37.0 for init/analyze with 4.37.4 for upload-sarif. The existing repository contract test_codeql_action_steps_use_one_version_per_workflow therefore fails during coverage evidence for otherwise unrelated pull requests.

Change

  • update every github/codeql-action/init and analyze reference in .github/workflows/codeql-pr.yml to the already pinned 4.37.4 SHA used by the workflow's related CodeQL actions;
  • update init and analyze in .github/workflows/scheduled-security-scan.yml to the same 4.37.4 SHA already used by upload-sarif;
  • preserve all permissions, detection logic, SARIF gates, categories, and fail-closed behavior.

TDD / verification basis

The failing contract already exists on main. Before the change, the exact workflow blobs contain both 99df26d... (4.37.0) and f205ea1... (4.37.4). After this two-file change, each workflow uses only f205ea1c3313d32999d8d6a48b4f6530d4437b38 for CodeQL Action steps.

Current-head GitHub Actions and the existing contract test remain authoritative before merge.

Scope and supersession

Changed files only:

  • .github/workflows/codeql-pr.yml
  • .github/workflows/scheduled-security-scan.yml

This clean PR supersedes #723, whose branch also accumulated unrelated Strix dependency and cryptography lock changes. Those dependency changes are intentionally excluded from this workflow-consistency fix.

Summary by CodeRabbit

  • 개선 사항
    • 보안 분석 워크플로를 최신 버전으로 업데이트하여 코드 보안 검사 안정성을 향상했습니다.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d99197fa-bfd1-4c57-9c52-f57a4d383fba

📥 Commits

Reviewing files that changed from the base of the PR and between 3f65dbe and 8d698cf.

📒 Files selected for processing (2)
  • .github/workflows/codeql-pr.yml
  • .github/workflows/scheduled-security-scan.yml

📝 Walkthrough

Walkthrough

PR 분석, merge preview 분석, 예약 보안 스캔에서 사용하는 CodeQL 액션을 v4.37.0에서 v4.37.4로 업데이트했습니다. 기존 분석 설정은 유지됩니다.

Changes

CodeQL 액션 업데이트

Layer / File(s) Summary
CodeQL 워크플로 버전 업데이트
.github/workflows/codeql-pr.yml, .github/workflows/scheduled-security-scan.yml
PR 헤드, merge preview, 예약 보안 스캔의 CodeQL initanalyze 액션을 v4.37.4로 변경했습니다. 언어, 빌드 모드, 오류 무시 및 분석 카테고리 설정은 유지됩니다.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested labels: dependencies, github_actions

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 두 워크플로의 CodeQL Action 버전 일관성 유지라는 주요 변경 사항을 명확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/codeql-action-version-consistency

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please review exact head 8d698cf5bbf68e31ecaeb76f1b9044f7361ba5dd. Verify the existing CodeQL-version consistency contract, the two-file scope, immutable full-SHA pins, unchanged permissions/SARIF gates/categories, and current-head security checks. Approve only if no blocking finding remains.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 8d698cf5bbf68e31ecaeb76f1b9044f7361ba5dd. The final scope is exactly the two canonical CodeQL workflows, and every completed exact-head security check is green.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected_head='8d698cf5bbf68e31ecaeb76f1b9044f7361ba5dd'

printf '%s\n' '== Checked-out commit =='
git rev-parse HEAD
git status --short

printf '%s\n' '== Pull request metadata =='
gh pr view 728 --repo ContextualWisdomLab/.github \
  --json number,url,headRefOid,baseRefOid,changedFiles,files,statusCheckRollup \
  --jq '{number,url,headRefOid,baseRefOid,changedFiles,files:[.files[].path],checks:[.statusCheckRollup[]|{name,status,conclusion,detailsUrl}]}'

actual_head="$(git rev-parse HEAD)"
if [ "$actual_head" != "$expected_head" ]; then
  printf 'ERROR: checked-out commit is %s, expected %s\n' "$actual_head" "$expected_head" >&2
  exit 1
fi

base="$(gh pr view 728 --repo ContextualWisdomLab/.github --json baseRefOid --jq .baseRefOid)"

printf '%s\n' '== Changed files and diff summary =='
git diff --name-status "$base" "$expected_head"
git diff --stat "$base" "$expected_head"

printf '%s\n' '== Exact workflow diff =='
git diff --no-ext-diff --unified=80 "$base" "$expected_head" -- \
  .github/workflows/codeql-pr.yml \
  .github/workflows/scheduled-security-scan.yml

printf '%s\n' '== CodeQL action pins in resulting workflows =='
rg -n -C2 'uses:\s*github/codeql-action/(init|analyze|upload-sarif)@' \
  .github/workflows/codeql-pr.yml \
  .github/workflows/scheduled-security-scan.yml

printf '%s\n' '== Parent and head workflow permission/SARIF/category context =='
for rev in "$base" "$expected_head"; do
  printf '\n-- %s --\n' "$rev"
  git show "${rev}:.github/workflows/codeql-pr.yml" | \
    rg -n -C3 '^(permissions:|\s+permissions:)|upload-sarif|sarif|category:|fail|uses:\s*github/codeql-action/' || true
  git show "${rev}:.github/workflows/scheduled-security-scan.yml" | \
    rg -n -C3 '^(permissions:|\s+permissions:)|upload-sarif|sarif|category:|fail|uses:\s*github/codeql-action/' || true
done

printf '%s\n' '== Check runs for exact head =='
gh api "repos/ContextualWisdomLab/.github/commits/${expected_head}/check-runs?per_page=100" \
  --jq '.check_runs[] | [.name,.status,.conclusion,.details_url] | `@tsv`'

printf '%s\n' '== GitHub Actions runs for exact head =='
gh run list --repo ContextualWisdomLab/.github --commit "$expected_head" --limit 100 \
  --json databaseId,name,workflowName,status,conclusion,event,url,startedAt,updatedAt \
  --jq '.[] | [.databaseId,.workflowName,.name,.event,.status,.conclusion,.url] | `@tsv`'

Length of output: 55047


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/.github'
head='8d698cf5bbf68e31ecaeb76f1b9044f7361ba5dd'
pip_job='91910729968'

printf '%s\n' '== Failed pip-audit job metadata and annotations =='
gh api "repos/${repo}/actions/jobs/${pip_job}" \
  --jq '{name,status,conclusion,started_at,completed_at,html_url,steps:[.steps[]|{name,status,conclusion,number}]}' \
  || true
gh api "repos/${repo}/check-runs/${pip_job}/annotations?per_page=100" \
  --jq '.[] | {path,start_line,end_line,annotation_level,message,title}' \
  || true

printf '%s\n' '== Failed pip-audit job log tail =='
gh run view 30882962649 --repo "$repo" --job "$pip_job" --log-failed 2>&1 | tail -250 || true

printf '%s\n' '== Locate CodeQL version consistency contract =='
rg -n -i -C3 \
  'test_codeql_action_steps_use_one_version_per_workflow|codeql[-_ ]action.*(version|consistent)|one version per workflow' \
  . \
  -g '!**/.git/**' \
  -g '!**/node_modules/**' \
  -g '!**/dist/**' \
  -g '!**/build/**' \
  || true

printf '%s\n' '== Static CodeQL action SHA consistency validation =='
python3 - <<'PY'
from pathlib import Path
import re
files = (
    Path(".github/workflows/codeql-pr.yml"),
    Path(".github/workflows/scheduled-security-scan.yml"),
)
pattern = re.compile(
    r"^\s*uses:\s*github/codeql-action/(init|analyze|upload-sarif)@([0-9a-f]{40})\b",
    re.M,
)
expected = "f205ea1c3313d32999d8d6a48b4f6530d4437b38"
for file in files:
    entries = pattern.findall(file.read_text(encoding="utf-8"))
    shas = {sha for _, sha in entries}
    print(f"{file}: steps={len(entries)} shas={sorted(shas)}")
    if not entries or shas != {expected}:
        raise SystemExit(f"FAIL: {file} does not use only the expected CodeQL SHA")
print("PASS: each canonical CodeQL workflow uses only the expected immutable SHA")
PY

printf '%s\n' '== Current exact-head non-success and pending checks =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | select(.status != "completed" or (.conclusion != "success" and .conclusion != "neutral" and .conclusion != "skipped")) | [.name,.status,.conclusion,.details_url] | `@tsv`'

Length of output: 27110


@seonghobae, I found no source-level finding in the two workflow files.

  • Commit 8d698cf5bbf68e31ecaeb76f1b9044f7361ba5dd is the reviewed head.
  • The scope is exactly the two requested workflows.
  • All seven CodeQL action steps now use the immutable f205ea1c3313d32999d8d6a48b4f6530d4437b38 SHA.
  • The static conditions of test_codeql_action_steps_use_one_version_per_workflow pass.
  • Permissions, SARIF gates, categories, and fail-closed behavior are unchanged.
  • The CodeQL PR workflow completed successfully for actions and python.

I cannot approve this head yet.

pip-audit (Python dependency audit) failed. It reports vulnerabilities in aiohttp==3.14.1 and cryptography==49.0.0 from the Strix requirement files. coverage-evidence is also still queued. The claim that all completed exact-head security checks are green is therefore not correct.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

Temporarily closing to respect dependency order and stop spending queued checks on a PR that cannot pass the current hard gate. Exact-head CodeQL, Semgrep, Security Scan, OSV, Scorecard, Secret Scan, and SBOM all succeeded, but Python Security failed because the current Strix locks still contain aiohttp==3.14.1 (fixed in 3.14.3) and cryptography==49.0.0 (fixed in 50.0.0). A focused two-file supply-chain PR will land first; this branch is preserved and will then be reopened/replayed on the clean main branch for exact-head validation and independent approval.

@seonghobae seonghobae closed this Aug 4, 2026
auto-merge was automatically disabled August 4, 2026 06:41

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant