Skip to content

Enable codeql scanning#1532

Merged
bioball merged 3 commits intoapple:mainfrom
bioball:enable-codeql
Apr 20, 2026
Merged

Enable codeql scanning#1532
bioball merged 3 commits intoapple:mainfrom
bioball:enable-codeql

Conversation

@bioball
Copy link
Copy Markdown
Member

@bioball bioball commented Apr 17, 2026

This enables security vulnerability scanning using CodeQL.

Comment thread .github/codeql.pkl

jobs {
for (scan in scans) {
["analyze-\(scan.language)"] {
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.

Isn't it better/easier to go with a matrix build instead of multiple jobs? 🤔 🤷‍♂️
It's the same outout, so it actually doesn't matter. Just my initial thought about it 😂

Copy link
Copy Markdown
Member Author

@bioball bioball Apr 17, 2026

Choose a reason for hiding this comment

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

Matrices feel like a poor man's for loop that we can express much more easily with Pkl. And, you get actual Pkl dot access this way, rather than a stringy typed value ("${{ matrix.language }}" vs. scan.language). I think this ends up as basically the same thing? Each turns into its own job execution regardless.

Comment thread .github/codeql.pkl
"main"
}
}
schedule {
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.

Is there a reason not to run this on push or PR? Having this able to block PRs would be very handy. I'd be interested in adding at least one custom query to block a problem pattern in CliCommand.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was concerned about how long these things take to run. But, we can play around with it and see what happens!

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.

Analysis for java-kotlin finished within a minute of the gradle-check job, so I think this would probably be okay to enable on PRs. A <1m delay in exchange for better security enforcement on PRs seems okay to me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added PRs

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

@bioball bioball merged commit a33e431 into apple:main Apr 20, 2026
21 checks passed
@bioball bioball deleted the enable-codeql branch April 20, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants