Skip to content

ci(security): restore interim PR-triggered CodeQL coverage - #1059

Closed
seonghobae wants to merge 1 commit into
mainfrom
ci/restore-codeql-pr-coverage
Closed

ci(security): restore interim PR-triggered CodeQL coverage#1059
seonghobae wants to merge 1 commit into
mainfrom
ci/restore-codeql-pr-coverage

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

This repo currently has zero CodeQL PR coverage. .github/workflows/codeql.yml
was deleted in PR #513 (commit 479fc0556e36bd1524f6011602477c3243860dbf, merged
2026-07-11) on the assumption that ContextualWisdomLab/.github's central
required-workflow ruleset (id 18156473) already ran codeql-pr.yml here. That
assumption was verified false on 2026-09-02: ruleset 18156473 does not
actually include codeql-pr.yml.

Adds back a minimal pull_request-triggered CodeQL workflow as a temporary
safety net until an org admin fixes the ruleset (tracked separately — not
fixable from this repo).

  • CodeQL Action pinned to v4.37.8, matching the central codeql-pr.yml.
  • Language matrix (python, javascript-typescript) verified against this
    repo, not guessed: matches the existing .github/workflows/codeql-backfill.yml
    matrix and the repo's actual language breakdown (Python backend, TS/JS
    frontend; no Java/Kotlin).
  • Deliberately simpler than the central codeql-pr.yml (no merge-preview job,
    no custom SARIF gate) — this repo doesn't need that org-specific logic; a
    standard init/autobuild/analyze on the PR head restores baseline
    coverage.
  • actionlint passes clean on the new file.

Only .github/workflows/codeql.yml is touched.

Test plan

  • actionlint .github/workflows/codeql.yml — passes
  • Confirm the new "codeql-pr-interim / Analyze" check runs and completes on this PR
  • Org admin confirms ruleset 18156473 includes codeql-pr.yml, then this workflow is removed

🤖 Generated with Claude Code


Devin Review

PR #513 (commit 479fc05) deleted the local
codeql.yml on 2026-07-11, assuming ContextualWisdomLab/.github's central
required-workflow ruleset (id 18156473) already ran CodeQL PR here. Verified
false on 2026-09-02: ruleset 18156473 does not include codeql-pr.yml, leaving
this repo with zero CodeQL PR coverage.

Restores a minimal pull_request-triggered CodeQL workflow as a temporary
safety net, matching the central codeql-pr.yml's CodeQL Action version
(v4.37.8) and this repo's verified language matrix (python,
javascript-typescript — confirmed via codeql-backfill.yml and repo language
stats). Remove once an org admin confirms ruleset 18156473 covers
codeql-pr.yml (tracked separately; not fixable from this repo).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 0c57abc0-7a79-4463-9616-bdbfe3d4fb20

📥 Commits

Reviewing files that changed from the base of the PR and between 8dc7469 and 9c461c8.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Devin Review

uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 PR-head results attach to merge revision

After checkout selects the PR head, analyze defaults to the merge ref and SHA. Code scanning attributes head-only results to unscanned merged code.

Prompt for agents
The workflow checks out github.event.pull_request.head.sha, but github/codeql-action/analyze receives no ref or sha inputs. On a pull_request run, its defaults remain GITHUB_REF and GITHUB_SHA for refs/pull/<number>/merge and the synthetic merge commit. Align the analyzed checkout and upload identity: either analyze the default merge checkout, or explicitly upload the head analysis with the matching refs/pull/<number>/head ref and pull request head SHA. Verify fork pull-request handling when choosing the latter.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +41 to +45
- name: Checkout PR head
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Merge-preview coverage remains absent

checkout scans only the PR head. Repository guidance requires security scans against the merge ref, leaving base-branch interactions outside this safety net.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae seonghobae added area: ci-cd CI, GitHub Actions, checks, release, or supply chain priority: high High-priority or P1 work status: needs-review Open pull request requiring current-head review or checks type: maintenance Maintenance, build, dependency, or operational upkeep labels Sep 2, 2026 — with ChatGPT Codex Connector
@seonghobae

Copy link
Copy Markdown
Collaborator Author

Closing as redundant: the actual root-cause fix has landed.

Org ruleset 18156473 was missing codeql-pr.yml, scorecard-pr.yml, and osv-scanner-pr.yml from its required-workflow list org-wide — this PR was an interim, repository-local stopgap for that gap while it stood.

The gap has since been fixed at the root: an org administrator granted admin:org scope, and codeql-pr.yml/scorecard-pr.yml/osv-scanner-pr.yml (pinned to ContextualWisdomLab/.github@refs/heads/main) were added directly to ruleset 18156473's workflows rule. Verified live from two angles:

  • Re-reading orgs/ContextualWisdomLab/rulesets/18156473 now shows all 10 required workflow paths.
  • Re-reading a target repository's own inherited dispatch list (gh api repos/ContextualWisdomLab/aFIPC/rules/branches/master) now shows codeql-pr.yml present, confirming the central control is actually enforcing, not just present in the ruleset's own definition.

pg-erd-cloud now receives central PR-head and merge-preview CodeQL coverage the same way every other repository under the ruleset does. See ContextualWisdomLab/.github's docs/org-required-workflow-rollout.md ("Code scanning required workflow posture" section) for the full evidence trail, and PR ContextualWisdomLab/.github#1719 for the corrected rollout doc.

Closing this interim workflow in favor of the central one, per this repo's own "remove once ruleset confirmed fixed" note in the PR description.

@seonghobae seonghobae closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd CI, GitHub Actions, checks, release, or supply chain priority: high High-priority or P1 work status: needs-review Open pull request requiring current-head review or checks type: maintenance Maintenance, build, dependency, or operational upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant