GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add feature flag to skip computing baseline file coverage information on PRs by henrymercer · Pull Request #3424 · github/codeql-action Conversation
|
| 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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
| // 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.
The reason will be displayed to describe this comment to others. Learn more.
Could you move this to a separate function and add some unit tests for it?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Agreed. I think it'd make sense to do that in the CLI. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
| // 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.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding the tests!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.