Skip to content

ci: update CodeQL workflow actions and add Dependabot monitoring#413

Open
jkmassel wants to merge 12 commits intotrunkfrom
jkmassel/update-codeql-v4
Open

ci: update CodeQL workflow actions and add Dependabot monitoring#413
jkmassel wants to merge 12 commits intotrunkfrom
jkmassel/update-codeql-v4

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel commented Apr 2, 2026

Summary

  • Bump actions/checkout from v4 to v5
  • Bump github/codeql-action (init, autobuild, analyze) from v3 to v4
  • Add github-actions ecosystem to Dependabot to automatically track future action version updates

Resolves GitHub Actions deprecation warnings for Node.js 20. Both v5 (checkout) and v4 (codeql-action) are drop-in replacements with no breaking changes for this workflow.

Test plan

  • Verify CodeQL workflow runs successfully on this PR
  • Confirm no Node.js deprecation warnings in workflow logs

🤖 Generated with Claude Code

Bump actions/checkout v4 → v5 and github/codeql-action v3 → v4 to
resolve GitHub Actions Node.js 20 deprecation warnings. Node.js 20
actions will be forced to Node.js 24 starting June 2, 2026.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Type] Build Tooling Issues or PRs related to build tooling label Apr 2, 2026
Add `github-actions` package ecosystem to dependabot.yml so action
version updates (checkout, codeql-action, etc.) are tracked
automatically alongside npm dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jkmassel jkmassel changed the title ci: update CodeQL workflow to Node.js 24-compatible actions ci: update CodeQL workflow actions and add Dependabot monitoring Apr 2, 2026
@jkmassel jkmassel requested review from a team and dcalhoun April 2, 2026 01:54
@jkmassel jkmassel self-assigned this Apr 2, 2026
jkmassel and others added 7 commits April 1, 2026 20:31
Set build-mode: none for the interpreted languages job (actions,
java-kotlin, javascript-typescript) and remove the autobuild step.
This ensures CodeQL extracts all Kotlin source files rather than
only those reachable from a single Gradle build (51/90 previously).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change from building only GutenbergKit and GutenbergKitHTTP to
building all targets including tests. Previously only 11/132 Swift
files were scanned.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add xcodebuild step for the Demo-iOS Xcode project so its 14 Swift
files are also scanned by CodeQL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
java-kotlin requires compilation and cannot use build-mode: none.
Use a matrix include to set the build mode per language: autobuild
for java-kotlin, none for actions and javascript-typescript.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Autobuild only compiled 51/90 Kotlin files. Replace it with a
dedicated job that runs compileDebugSources, compileDebugTestSources,
and compileDebugAndroidTestSources across both modules to ensure
full coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `compileDebugUnitTestSources` instead of the ambiguous
`compileDebugTestSources` which matches both unit and Android
test source sets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The compileDebugAndroidTestSources task fails because Espresso Web
and Compose test dependencies aren't available on the CI runner.
These instrumentation tests in the demo app aren't useful targets
for static security analysis, so just compile main and unit test
sources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

While I do not see any deprecation warnings in the CI logs, it appears the Swift CodeQL task continues to cancel due to a timeout. Here is Claude's analysis. WDYT is the most appropriate solution?

Claude analysis

Root Cause

The analyze-swift job is hitting its 30-minute timeout (codeql.yml:67). The swift build --build-tests step alone takes ~29.5 minutes, leaving no time for the subsequent "Build Demo app" step. The build got to 277/279 compilations before being killed.

Two factors contribute to the long build time:

  1. SPM dependency resolution is slow — computing the version for SVGView.git alone took 531 seconds (~9 minutes). This is a known issue with SPM when using from: ranges on repos with many tags — SPM checks every tag to find compatible versions.

  2. The build itself is large — compiling all targets including tests (279 compilation units total) plus all dependencies (SwiftSoup, SVGView, GutenbergKitHTTP, etc.) takes ~20 minutes.

And the "Build Demo app" xcodebuild step would add even more time on top of that.

Fix Options

Option 1 (simplest): Increase the timeout

Bump timeout-minutes from 30 to 60 on the analyze-swift job. This gives enough headroom for both build steps plus the CodeQL analysis step.

Option 2 (also helps): Remove --build-tests

Change swift build --build-tests to just swift build. CodeQL only needs the source code compiled for analysis — test code is typically not what you want to scan for security vulnerabilities. This would cut out ~50 compilation units and save several minutes.

Option 3 (complementary): Remove the Demo app build

The Demo app build adds more compilation time. If the Swift package build already covers the main library code, the Demo app step may be redundant for CodeQL's purposes.

jkmassel and others added 3 commits April 15, 2026 12:19
The swift build + Demo app xcodebuild completes but takes ~30m on
macos-15 runners, hitting the timeout boundary during the Demo app
build step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SPM version resolution takes ~9 minutes on a cold CI cache because
it clones each dependency mirror and parses Package.swift for every
candidate version. Caching the SPM repository mirrors across runs
avoids this.

Also removes a stale wordpress-rs pin from Package.resolved — it's
not in Package.swift and shouldn't be resolved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
swift build --build-tests compiles test targets that import UIKit,
which isn't available when building for macOS on CI. The library
targets are sufficient for CodeQL analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s security/CI automation by modernizing the CodeQL workflow action versions and enabling Dependabot to track future GitHub Actions updates, while also adjusting how CodeQL builds/analysis are executed for different languages.

Changes:

  • Bump actions/checkout to v5 and github/codeql-action steps to v4.
  • Restructure CodeQL workflow: split Kotlin into a dedicated job with an explicit Gradle build; adjust Swift job (SPM caching, broader builds, longer timeout); remove CodeQL autobuild for interpreted languages and set build-mode: none.
  • Add Dependabot updates for the github-actions ecosystem.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
Package.resolved Updates SwiftPM lock state and removes an unused/stray pin (wordpress-rs).
.github/workflows/codeql.yml Upgrades actions and changes CodeQL job structure/build behavior across languages.
.github/dependabot.yml Enables Dependabot monitoring for GitHub Actions version updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to +58
analyze-kotlin:
name: Analyze (java-kotlin)
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: java-kotlin

- name: Build Android project
run: cd android && ./gradlew compileDebugSources compileDebugUnitTestSources

Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

This PR introduces additional workflow behavior beyond version bumps: it splits out a new analyze-kotlin job and adds an explicit Android Gradle build step. Please call this out in the PR description/test plan (it can affect CI time/failure modes) so reviewers understand the scope increase.

Copilot uses AI. Check for mistakes.
Comment on lines 31 to +35
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v3
build-mode: none
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The PR description claims only action bumps with no behavioral changes, but this workflow change also removes the CodeQL autobuild step and explicitly sets build-mode: none for the interpreted-language matrix. Please update the PR description/test plan to reflect these workflow behavior changes (and confirm they don’t reduce JS/TS extraction coverage compared to the previous autobuild-based setup).

Copilot uses AI. Check for mistakes.
run: swift build

- name: Build Demo app
run: xcodebuild build -project ios/Demo-iOS/Gutenberg.xcodeproj -scheme Gutenberg -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💭 Just wondering, would it make sense to check in the Demo app Package.resolved, now that this job builds the Xcode project? That would make dependency resolution for this step reproducible.

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

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants