Skip to content

[ci] Run CodeQL security analysis on every PR - #347

Merged
wangtiance merged 2 commits into
ThinkFlowLab:mainfrom
wangtiance:codex/ci-pr-security-scan
Nov 16, 2026
Merged

wangtiance merged 2 commits into
ThinkFlowLab:mainfrom
wangtiance:codex/ci-pr-security-scan

Conversation

@wangtiance

@wangtiance wangtiance commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Implements PR3 of #273: run source security analysis on every PR, including drafts and documentation-only changes.

  • Add independent Python and JavaScript/TypeScript CodeQL security-extended jobs using pinned official Actions and build-mode: none; no application dependency installation, application build or model calls.
  • Scan PRs, main pushes for the merged baseline, and manual dispatches. Each language has a 30-minute limit; neither cancels the other on failure.
  • Add a uniquely named CodeQL / checks aggregate that rejects failed, cancelled, skipped or missing analysis receipts.
  • Address review feedback with workflow-level concurrency in CodeQL, Release checks and DSH plugin checks: same-PR updates cancel obsolete runs; different workflows/PRs and non-PR runs stay isolated. Non-PR cancellation is disabled and each run has its own group.
  • Document scan execution versus the separate Code scanning results alert check, fork policy and administrator setup in Chinese and English.

Validation

  • 106 CI security/scope/summary/profile/layer tests passed (--noconftest -p ci_profile; avoids unrelated application fixtures in this local environment).
  • Shared pre-commit checks passed against the exact staged blobs and then the entire committed PR diff, including actionlint.
  • npm run check:i18n: 3,014 keys, zero problems.
  • Fetched upstream main and rebased before publishing; base is the merge of [ci] skip heavy checks for proven documentation-only PRs #346.
  • First hosted CodeQL run passed on this fork PR: Python 1m00s, JavaScript/TypeScript 1m49s, and the stable aggregate 4s. Both language analyses and result uploads succeeded: https://github.com/ThinkFlowLab/OpenDirector/actions/runs/43816711874 . This was the initial commit; the latest concurrency revision (629e03a) has started fresh CodeQL, Release checks and DSH plugin checks, with results pending.

Repository configuration and remaining scope

This workflow does not configure branch protection. CodeQL / checks proves successful execution/upload; GitHub's separate Code scanning results / CodeQL check evaluates alert severity on PR changes. An administrator must confirm advanced setup without a conflicting default setup, verify fork uploads and alert thresholds, and require both checks. The current account has no repository administration permission; reading default setup returned HTTP 403, so that setting is unverified.

merge_group support remains PR6 and repository enforcement remains PR7 from #273. Dependency/container scanning and changes to ready/merge/nightly selection are outside this PR.

Refs #273

## summary

- Analyze Python and JavaScript/TypeScript independently on every PR,
  with main baseline scans and pinned official Actions.
- Require successful analysis receipts in a uniquely named aggregate;
  document alert checks and pending administrator enforcement.
- Add workflow policy and aggregate-command regression coverage.

## validation

- 106 CI policy, scope, summary, profile and layer tests passed.
- Shared pre-commit checks passed against exact staged blobs.
- npm run check:i18n passed.

Refs: ThinkFlowLab#273
@wangtiance wangtiance added ready ready label to trigger CI type:ci Build, test and release automation area:ci Continuous integration and checks area:docs Documentation / 文档 labels Nov 16, 2026
@github-actions
github-actions Bot requested a review from wuzhf9 November 16, 2026 06:26
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@@ -0,0 +1,54 @@
name: CodeQL

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When PRs increase and pushes are frequent, old commits keep occupying runners, causing new checks to queue up. Configuring concurrency and cancel-in-progress: true for the same PR can cancel outdated runs and free up runners. It is also recommended to cover CodeQL, CI, and DSH plugin checks at the same time.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in 629e03a

## summary

- Group CodeQL, Release checks and DSH plugin runs by workflow,
  event and PR number so updates cancel obsolete PR checks.
- Keep non-PR runs isolated by run ID without cancellation.
- Document concurrency boundaries in Chinese and English.

## validation

- 106 related CI tests passed.
- Shared static checks passed against the exact staged blobs.
@wangtiance
wangtiance requested a review from yenuo26 November 16, 2026 07:29

@yenuo26 yenuo26 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.

LGTM

@wangtiance
wangtiance merged commit 94afbc3 into ThinkFlowLab:main Nov 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Continuous integration and checks area:docs Documentation / 文档 ready ready label to trigger CI type:ci Build, test and release automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants