Skip to content

ci: Run CodeQL from a workflow that skips test code - #15166

Closed
HyeockJinKim wants to merge 1 commit into
mainfrom
ci/codeql-ignore-tests
Closed

HyeockJinKim wants to merge 1 commit into
mainfrom
ci/codeql-ignore-tests

Conversation

@HyeockJinKim

Copy link
Copy Markdown
Collaborator

Summary

  • CodeQL runs as GitHub default setup, which has no path filter, so test code is analyzed and reported (e.g. a test assertion flagged as py/incomplete-url-substring-sanitization).
  • Move CodeQL to .github/workflows/codeql.yml with .github/codeql/codeql-config.yml ignoring tests/** and src/ai/backend/test/**, the same paths DevSkim skips.
  • Languages, build modes and categories match the current default setup analyses, so existing alerts carry over:
Language Build mode Category
actions none /language:actions
go autobuild /language:go
python none /language:python
  • github/codeql-action is pinned to v4.38.2 (2892aa5).

Merge note

Code scanning rejects analyses from a workflow while default setup is enabled, so the CodeQL jobs on this PR are expected to fail at upload. Disable default setup when merging (Settings → Code security → CodeQL analysis → Switch to advanced, or gh api -X PATCH repos/lablup/backend.ai/code-scanning/default-setup -f state=not-configured).

🤖 Generated with Claude Code

CodeQL default setup has no path filter, so test code is analyzed and
reported. Move the analysis to a workflow with the same languages,
build modes and categories, and ignore tests/ and src/ai/backend/test/.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 03:12
@HyeockJinKim
HyeockJinKim requested a review from a team as a code owner October 1, 2026 03:12
@github-actions github-actions Bot added the size:M 30~100 LoC label Oct 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The workflow, pinned CodeQL version, categories, and path exclusions are consistent and complete.

Review effort: Balanced
Findings: None

What changed in this PR

Moves CodeQL to advanced setup so Python test paths are excluded while preserving existing analysis categories.

Changes:

  • Adds scheduled, push, and PR CodeQL analysis for Actions, Go, and Python.
  • Adds test-path exclusions matching DevSkim.
File Description
.github/​workflows/​codeql.yml Defines the advanced CodeQL workflow.
.github/​codeql/​codeql-config.yml Excludes test directories from analysis.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@HyeockJinKim

Copy link
Copy Markdown
Collaborator Author

Closing: keep CodeQL default setup; test-code alerts will be dismissed as 'used in tests' instead.

@HyeockJinKim
HyeockJinKim deleted the ci/codeql-ignore-tests branch October 1, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants