Skip to content

Mark Swift incompatible OS as configuration error#3801

Open
henrymercer wants to merge 3 commits intomainfrom
henrymercer/swift-incompatible-os
Open

Mark Swift incompatible OS as configuration error#3801
henrymercer wants to merge 3 commits intomainfrom
henrymercer/swift-incompatible-os

Conversation

@henrymercer
Copy link
Copy Markdown
Contributor

Reduce monitor noise by treating the incompatible OS error on Swift as a configuration error rather than an issue with the CodeQL Action.

@henrymercer henrymercer requested a review from a team as a code owner April 2, 2026 17:48
Copilot AI review requested due to automatic review settings April 2, 2026 17:48
@github-actions github-actions bot added the size/XS Should be very easy to review label Apr 2, 2026
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

This PR reduces monitoring noise by classifying CodeQL CLI’s “Swift analysis is only supported on macOS” / [incompatible-os] failure as a configuration error (so it’s treated as a user/workflow issue rather than an action failure).

Changes:

  • Added a new CliConfigErrorCategory.SwiftIncompatibleOs and matching patterns to recognize the Swift incompatible-OS error.
  • Added an AVA test to ensure the incompatible-OS Swift error is wrapped into a ConfigurationError.
  • Updated generated lib/ artifacts to reflect the TypeScript changes.

Reviewed changes

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

Show a summary per file
File Description
src/cli-errors.ts Adds SwiftIncompatibleOs category and regex candidates so the error is treated as a configuration error.
src/cli-errors.test.ts Adds coverage asserting Swift incompatible-OS stderr is wrapped as ConfigurationError.
lib/upload-sarif-action.js Generated bundle update reflecting new CLI error category.
lib/upload-sarif-action-post.js Generated bundle update reflecting new CLI error category.
lib/upload-lib.js Generated bundle update reflecting new CLI error category.
lib/start-proxy-action-post.js Generated bundle update reflecting new CLI error category.
lib/setup-codeql-action.js Generated bundle update reflecting new CLI error category.
lib/resolve-environment-action.js Generated bundle update reflecting new CLI error category.
lib/init-action.js Generated bundle update reflecting new CLI error category.
lib/init-action-post.js Generated bundle update reflecting new CLI error category.
lib/autobuild-action.js Generated bundle update reflecting new CLI error category.
lib/analyze-action.js Generated bundle update reflecting new CLI error category.
lib/analyze-action-post.js Generated bundle update reflecting new CLI error category.

mbg
mbg previously approved these changes Apr 2, 2026
Copy link
Copy Markdown
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

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

This looks good to me, but couldn't we catch this earlier on / before we ever invoke the CLI? Or is this specifically to catch the case where there's no languages input but we are running on macOS and there's Swift code in the repo?

@henrymercer
Copy link
Copy Markdown
Contributor Author

This looks good to me, but couldn't we catch this earlier on / before we ever invoke the CLI? Or is this specifically to catch the case where there's no languages input but we are running on macOS and there's Swift code in the repo?

We could, but AFAICT the information about compatible OSes is not machine readable, so this would mean duplicating the knowledge about incompatible OSes between the CLI and the Action.

@mbg
Copy link
Copy Markdown
Member

mbg commented Apr 8, 2026

We could, but AFAICT the information about compatible OSes is not machine readable, so this would mean duplicating the knowledge about incompatible OSes between the CLI and the Action.

Isn't Swift just a special case in that regard or do we have other language/OS pairs that are not compatible? If it's just a special case for Swift, then I wouldn't be overly opposed to adding a check for that in the Action so that we can fail earlier.

@henrymercer
Copy link
Copy Markdown
Contributor Author

Looks like we already taught the Action about it, but it was a warning rather than a configuration error. Let's update that.

@github-actions github-actions bot added size/S Should be easy to review and removed size/XS Should be very easy to review labels Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Should be easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants