| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR introduces a feature flag that allows skipping baseline file coverage computation for PR analyses (currently gated for internal GitHub usage), wires that through the configuration, and cleans up an unused CLI method, along with a small dependency update.
Changes:
Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.
Show a summary per file| File | Description |
|---|---|
| src/testing-utils.ts | Extends createTestConfig to set enableFileCoverageInformation: true by default so tests construct a complete Config including the new flag. |
| src/init-action.ts | Imports isAnalyzingPullRequest, computes debugMode once, and derives enableFileCoverageInformation from debug mode, PR vs non-PR, repository owner, and Feature.SkipFileCoverageOnPrs before passing it into initConfig. |
| src/feature-flags.ts | Adds the SkipFileCoverageOnPrs feature enum and its featureConfig entry, backed by the CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS env var and currently without a minimum CLI version. |
| src/config-utils.ts | Extends Config and InitConfigInputs with enableFileCoverageInformation and ensures it is carried through initActionState to the returned Config. |
| src/config-utils.test.ts | Updates createTestInitConfigInputs to include enableFileCoverageInformation: true, keeping tests aligned with the extended InitConfigInputs shape. |
| src/codeql.ts | Removes the databasePrintBaseline method from the CodeQL interface and stub, and makes databaseInitCluster conditionally include baseline-related CLI flags via a new baselineFilesOptions array and ignoringOptions for extra env options. |
| src/analyze.ts | Guards logging of analysisSummary / qualityAnalysisSummary against empty strings and logs a clear informational message when config.enableFileCoverageInformation is false. |
| src/analyze.test.ts | Simplifies the createStubCodeQL usage for the status report test by dropping the now-removed databasePrintBaseline stub. |
| package-lock.json | Bumps caniuse-lite to 1.0.30001766 (including integrity, URL, and license metadata) to eliminate build warnings. |
| lib/upload-sarif-action.js | Updates generated JS to reflect the new feature flag and baseline option wiring used by the SARIF upload action. |
| lib/upload-sarif-action-post.js | Regenerates JS to include the SkipFileCoverageOnPrs feature config for the upload post action. |
| lib/upload-lib.js | Regenerated library JS mirroring the new feature flag and conditional baseline CLI options. |
| lib/start-proxy-action.js | Generated JS updated to include the new SkipFileCoverageOnPrs entry in featureConfig. |
| lib/start-proxy-action-post.js | Generated JS updated similarly for the proxy post action’s feature configuration. |
| lib/setup-codeql-action.js | Regenerated setup action JS to mirror the new baseline option handling and feature flag definition. |
| lib/resolve-environment-action.js | Generated JS updated with the new feature flag entry. |
| lib/init-action.js | Generated JS reflecting the new enableFileCoverageInformation computation and propagation into initConfig, plus conditional baseline flags. |
| lib/init-action-post.js | Regenerated JS including the SkipFileCoverageOnPrs feature config and baseline option handling. |
| lib/autobuild-action.js | Generated JS updated to add the SkipFileCoverageOnPrs feature to the shared featureConfig. |
| lib/analyze-action.js | Generated JS mirroring the updated runQueries logging and use of config.enableFileCoverageInformation. |
| lib/analyze-action-post.js | Generated JS updated with the new feature flag config and baseline option wiring for the analyze post action. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks! A few comments, mainly about test coverage and some awkward wording in a log message.
Should we also add some telemetry here to measure what impact this has?
Sorry, something went wrong.
| // Always enable file coverage information in debug mode | ||
| debugMode || | ||
| // We're most interested in speeding up PRs, and we want to keep | ||
| // submitting file coverage information for the default branch since | ||
| // it is used to populate the status page. | ||
| !isAnalyzingPullRequest() || | ||
| // For now, restrict this feature to the GitHub org | ||
| repositoryNwo.owner !== "github" || | ||
| !(await features.getValue(Feature.SkipFileCoverageOnPrs)), |
There was a problem hiding this comment.
Could you move this to a separate function and add some unit tests for it?
Sorry, something went wrong.
There was a problem hiding this comment.
Moved to separate function 👍 Since it's just a logical expression, I don't think we can unit test this in a meaningful way.
Sorry, something went wrong.
There was a problem hiding this comment.
My reasoning here was that, while reviewing, I found it time-consuming to check that this expression produces the correct result in all cases. A short unit test which does that instead would be less error-prone and robust when making changes here down the line.
Sorry, something went wrong.
Agreed. I think it'd make sense to do that in the CLI. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for making those changes! The updated log message is much better and the new comment is helpful!
I'd probably still like to see a unit test for getFileCoverageInformationEnabled, but it's not blocking.
Sorry, something went wrong.
| // Always enable file coverage information in debug mode | ||
| debugMode || | ||
| // We're most interested in speeding up PRs, and we want to keep | ||
| // submitting file coverage information for the default branch since | ||
| // it is used to populate the status page. | ||
| !isAnalyzingPullRequest() || | ||
| // For now, restrict this feature to the GitHub org | ||
| repositoryNwo.owner !== "github" || | ||
| !(await features.getValue(Feature.SkipFileCoverageOnPrs)), |
There was a problem hiding this comment.
My reasoning here was that, while reviewing, I found it time-consuming to check that this expression produces the correct result in all cases. A short unit test which does that instead would be less error-prone and robust when making changes here down the line.
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for adding the tests!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
Products:
Environments:
How did/will you validate this change?
See https://github.com/github/codeql-action/actions/runs/21356271329
If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist