-
Notifications
You must be signed in to change notification settings - Fork 353
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
Set and cache dependency directory for Java build-mode: none
#2802
Conversation
6c7fbe7
to
f8367fb
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 sets a stable dependency directory for the Java build-mode: none extractor so that dependency jars can be reliably cached.
- Adds an environment variable setting to override the default dependency directory in both JavaScript and TypeScript extraction flows.
- Exports and utilizes a helper function to determine the temporary dependency directory across multiple modules.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
File | Description |
---|---|
lib/analyze.js | Imports dependency-caching and sets the env variable for Java caching. |
src/analyze.ts | Mirrors changes in lib/analyze.js for TypeScript extraction. |
src/dependency-caching.ts | Exports getJavaTempDependencyDir with accompanying documentation. |
lib/dependency-caching.js | Exports getJavaTempDependencyDir and integrates the new caching path. |
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
On a windows self-hosted runner, there's a chance that continually caching dependencies in the temp folder will cause disk space to fill up (unless we explicitly clean after the run). In the post-init step, can you add a bit to clean up the directory? |
Thanks for highlighting that! I have added some clean-up logic, though to the post step of the I also initially thought that this probably wouldn't be much of an issue, because we only enable dependency caching on GH-hosted runners in Default Setup, but we don't currently check whether caching is enabled before setting this extractor option. We could consider adding in that check so that the behaviour is unchanged if dependency caching isn't enabled. What do you think? |
Thanks for the change.
I think the analyze step makes more sense.
I'm not too fussed either way, as long as runs on self-hosted runners don't fill up their temp folders (which both approaches seem to do). |
This PR sets an extractor option for the Java
build-mode: none
extractor (if Java is being analysed andbuild-mode: none
is set) that redirects the dependency jars to a location where it can be included in a cache.Context
Up until now, the
build-mode: none
extractor downloaded dependency jars into a scratch directory in the database directory. This gets erased before we get to storing a cache and also is potentially problematic for inclusion in a cache, since caches must be restored to the same directories from which they were created.We added an extractor option to override the path to the directory where the
build-mode: none
extractor stores the jar files.Open questions
I didn't see anything overly similar where we set specific options for other extractors and we also don't store much data outside of the database folder.
Merge / deployment checklist