Skip to content

Force task re-execution in CodeQL compile step#17

Merged
IRus merged 2 commits into
mainfrom
fix/codeql-force-recompilation
Jul 19, 2026
Merged

Force task re-execution in CodeQL compile step#17
IRus merged 2 commits into
mainfrom
fix/codeql-force-recompilation

Conversation

@IRus

@IRus IRus commented Jul 19, 2026

Copy link
Copy Markdown
Member

The CodeQL job uses build-mode: manual, so its extractor only sees code that is actually compiled during the "Compile JVM Kotlin sources" step. #15 added --no-build-cache, which prevents FROM-CACHE outcomes, but Gradle can still mark the compile tasks UP-TO-DATE from restored incremental state — then kotlinc never launches, the extractor observes nothing, and the scan silently covers zero or partial Kotlin (or analyze fails with "no source code seen").

Fix: add --rerun-tasks to the same invocation. This ignores up-to-date checks for the whole task graph of the listed tasks, guaranteeing real compilation on every run. Trade-off: the step reruns every upstream task too (KSP, plugin classes, codegen), costing a few extra minutes per scan — acceptable for a weekly/PR security job where completeness matters more than speed. Dependency caching from setup-gradle is unaffected.

Verified locally by running the exact workflow command: 27 actionable tasks: 27 executed, zero UP-TO-DATE/FROM-CACHE outcomes, all listed compileKotlinJvm/classes tasks executed.

Note: this touches the same line as any sibling PR extending the module list of this step, so it may trivially conflict — resolve by keeping both the flags and the extended list.

🤖 Generated with Claude Code

IRus and others added 2 commits July 19, 2026 11:48
--no-build-cache (added in #15) stops Gradle from resolving compile
tasks FROM-CACHE, but restored incremental state can still mark them
UP-TO-DATE, in which case kotlinc never launches and CodeQL's
manual-build extractor sees no compilation. Add --rerun-tasks so the
scanned compile tasks always execute for real; dependency caching
from setup-gradle stays in effect.

Verified locally: the exact workflow command reports
"27 actionable tasks: 27 executed" with zero UP-TO-DATE/FROM-CACHE
outcomes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@IRus
IRus merged commit 2124f7e into main Jul 19, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant