Mark Swift incompatible OS as configuration error#3801
Mark Swift incompatible OS as configuration error#3801henrymercer wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
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.SwiftIncompatibleOsand 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
left a comment
There was a problem hiding this comment.
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. |
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. |
Reduce monitor noise by treating the incompatible OS error on Swift as a configuration error rather than an issue with the CodeQL Action.