Title: Categorize Code Quality "not enabled" upload failure as user-error by henrymercer · Pull Request #3972 · github/codeql-action · GitHub
Open Graph Title: Categorize Code Quality "not enabled" upload failure as user-error by henrymercer · Pull Request #3972 · github/codeql-action
X Title: Categorize Code Quality "not enabled" upload failure as user-error by henrymercer · Pull Request #3972 · github/codeql-action
Description: When a repository requests Code Quality analysis but it is not enabled, the analyze/finish job fails and is reported with status=failure, when it should be user-error: this is a customer configuration problem, not a CodeQL Action bug. We saw a burst of ~290 such failures from a single org, all surfacing this miscategorization. The root cause is the code-quality SARIF upload (PUT /repos/:owner/:repo/code-quality/analysis). On a 403 it returns the message Code quality is not enabled for this repository. Please enable code quality in the repository settings.. wrapApiConfigurationError only converts a 403 into a ConfigurationError when isEnablementError matches a known pattern, and none of the existing patterns covered the Code Quality wording. So the error stayed a plain Error, and getActionsStatus mapped it to failure. This change adds a /Code Quality is not enabled/i pattern to isEnablementError, mirroring the existing /Code Scanning is not enabled/i entry. The error now becomes a ConfigurationError and is correctly categorized as user-error. The case-insensitive flag tolerates the observed lowercase wording. The existing enablement-error unit test in src/api-client.test.ts is extended with the Code Quality message. The change is intentionally surgical, with no broader error-handling refactor. Risk assessment For internal use only. Please select the risk level of this change: Low risk: Documentation/test-only and telemetry categorization only; no change to upload behavior or control flow beyond how an already-failing case is labelled. Which use cases does this change impact? Workflow types: Managed - Impacts users with dynamic workflows (Default Setup, Code Quality, ...). Products: Code Quality - The changes impact analyses when analysis-kinds: code-quality. Environments: Dotcom - Impacts CodeQL workflows on github.com and/or GitHub Enterprise Cloud with Data Residency. GHES - Impacts CodeQL workflows on GitHub Enterprise Server. How did/will you validate this change? Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files). The existing enablement-error test is extended with the Code Quality message. If something goes wrong after this change is released, what are the mitigation and rollback strategies? Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix. The blast radius is limited to how an already-failing upload is categorized in telemetry. How will you know if something goes wrong after this change is released? Telemetry - The status report report_status.status for these Code Quality enablement failures should move from failure to user-error. Are there any special considerations for merging or releasing this change? No special considerations - This change can be merged at any time. Merge / deployment checklist Confirm this change is backwards compatible with existing workflows. Consider adding a changelog entry for this change. Confirm the readme and docs have been updated if necessary.
Open Graph Description: When a repository requests Code Quality analysis but it is not enabled, the analyze/finish job fails and is reported with status=failure, when it should be user-error: this is a customer configurat...
X Description: When a repository requests Code Quality analysis but it is not enabled, the analyze/finish job fails and is reported with status=failure, when it should be user-error: this is a customer configurat...
Opengraph URL: https://github.com/github/codeql-action/pull/3972
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2960816c-ba65-04bf-fdac-0c69a2b4e63a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E2C2:14CAC9:1D71160:283927A:6A4C105F |
| html-safe-nonce | 1ecca4c6a6ee65825c2c147c100c8efeecd383301e292dc5763ec0b0b6c7c531 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkMyOjE0Q0FDOToxRDcxMTYwOjI4MzkyN0E6NkE0QzEwNUYiLCJ2aXNpdG9yX2lkIjoiMTM1ODg4Nzk0Mjk3MDE1MTAwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a8207da02365d1ec0622adc3a7a576be189d9b9db575c66de15d4979cebf7047 |
| hovercard-subject-tag | pull_request:3921066820 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/github/codeql-action/pull/3972/files |
| twitter:image | https://avatars.githubusercontent.com/u/14129055?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/14129055?s=400&v=4 |
| og:image:alt | When a repository requests Code Quality analysis but it is not enabled, the analyze/finish job fails and is reported with status=failure, when it should be user-error: this is a customer configurat... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0ccfc9e5281bfe12e38a4d632dc422843e4d5b6757917f7efda2f6567d72fea9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/github/codeql-action git https://github.com/github/codeql-action.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 259445878 |
| octolytics-dimension-repository_nwo | github/codeql-action |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 259445878 |
| octolytics-dimension-repository_network_root_nwo | github/codeql-action |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 18812876666a23a0912556e224383baa4c84cf8e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width