-
Notifications
You must be signed in to change notification settings - Fork 428
Clean up JavaMinimizeDependencyJars feature flag
#3352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
379e7cb to
805b7e1
Compare
There was a problem hiding this 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 removes the fully rolled-out JavaMinimizeDependencyJars feature flag and simplifies the associated code. The feature flag check is replaced with a direct CodeQL version check (>= 2.23.0), and the special "minify-" cache key prefix for Java dependency caching is removed in favor of a consistent cache key format.
Key changes:
- Replaced feature flag check with direct version check in init-action logic
- Removed feature flag definition and configuration from feature-flags module
- Simplified cache key generation by removing Java-specific "minify-" prefix handling
- Removed tests for the deleted feature flag functionality
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/init-action.ts | Replaced feature flag check with CodeQL version check (>= 2.23.0) for enabling Java dependency jar minimization; added TODO for future refactoring |
| src/feature-flags.ts | Removed JavaMinimizeDependencyJars enum value and its configuration entry |
| src/dependency-caching.ts | Removed Java-specific logic for "minify-" prefix handling and simplified cache key assembly |
| src/dependency-caching.test.ts | Removed tests for the deleted Java minimization feature flag |
| lib/*.js | Auto-generated JavaScript files reflecting the TypeScript source changes |
src/init-action.ts
Outdated
| ); | ||
| } else if ( | ||
| (await features.getValue(Feature.JavaMinimizeDependencyJars, codeql)) && | ||
| (await codeQlVersionAtLeast(codeql, "2.23.0")) && // First version of the extractor to safely support this option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, non-blocking: this might be slightly clearer as a constant at the top of the file.
src/init-action.ts
Outdated
| /** First version of CodeQL where the Java extractor safely supports the option to minimize dependency jars. */ | ||
| export const CODEQL_VERSION_JAR_MINIMIZATION = "2.23.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Thanks for extracting this into a constant. Some extra thoughts:
- It may be good to extend the comment to highlight that some CLI versions before
2.23.0supportJAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARSbut that there was a subsequent fix/improvement in2.23.0. - No strong feelings, but I wonder if it would be cleaner to have this in a different file / keep the FF around but enable it by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the comment, as you suggested.
For your other point, I'll defer to you and Henry to make a decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have most of the CLI versions in codeql.ts, although there is one exception CODEQL_VERSION_ZSTD_BUNDLE which lives in setup-codeql.ts to avoid circular imports. It would be slightly better to move this to codeql.ts for consistency but I think there are few practical implications: if we're going to deprecate a CodeQL version we're going to search the codebase for CODEQL_VERSION_.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll merge what's here, but feel free to follow up and rearrange the code as you see fit.
4828993 to
d29eddb
Compare
The feature flag has been fully rolled out for some time, so we can simplify the code.
At the same time, stop using the
minify-prefix for dependency cache keys.There is still some Java-specific code to set the corresponding extractor option. I've left a TODO comment and will open an internal issue for a more principled way of handling that.
Risk assessment
For internal use only. Please select the risk level of this change:
The feature flag being removed is fully rolled out, so this PR should have no observable effects.
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, CCR, ...).Products:
analysis-kinds: code-scanning.analysis-kinds: code-quality.Environments:
github.com.How did/will you validate this change?
.test.tsfiles).pr-checks).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