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 — Support non-lock files for C# cache key computation by mbg · Pull Request #3117 · github/codeql-action Conversation
|
| File | Description |
|---|---|
| src/feature-flags.ts | Adds the new CsharpNewCacheKey feature flag configuration |
| src/dependency-caching.ts | Core refactoring to support dynamic hash pattern generation and C# fallback logic |
| src/init-action.ts | Updates function calls to pass CodeQL and features parameters |
| src/analyze-action.ts | Updates function calls to pass CodeQL and features parameters |
| lib/* | Generated JavaScript files reflecting the TypeScript changes |
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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable from an Action perspective
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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks plausible to me!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…o a function Changing `paths` to be a function is necessary to allow `getTemporaryDirectory` to be called
Add tests for `makePatternCheck` and `checkHashPatterns`
7f81d73 to
2680455
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The new pattern for deciding which C# files to use in the cache hash LGTM!
Should we use this opportunity to also extend the list of paths that are included in the cache for C#? The setup-dotnet Action considers more paths and computes them dynamically. Now that we have getDependencyPaths as a function, it would be easy to do this.
Does this mean that we are "only" including "{working_dir}/.nuget/packages" in the cache?
The dependency manager for C# use the "scratch dir" for storing downloaded packages.
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.
I only reviewed the parts that generalise the mechanism to add a feature-flag-specific prefix to the cache key, but that looks good.
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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This generally looks good. The only blocking comment from me is the naming of the cache entries.
For PRs like this in the future, consider splitting up into a core functionality part (e.g. here, handling the addition of feature flags to the cache key), and a language-specific part (e.g. here, changing the cache key for C#).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| // If we get to this point, the `basePatterns` didn't find any files, | ||
| // and `Feature.CsharpNewCacheKey` is either not enabled or we didn't | ||
| // find any files using those patterns either. | ||
| return undefined; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The last bit isn't true since we'll return the result of makePatternCheck, even if it's undefined. It might be clearer to have a helper function that checks whether the patterns match anything, and use that here instead.
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.
For now, I have updated the comment to remove the erroneous part. I think that was leftover from a previous iteration of this function.
I did notice that we could use makePatternCheck for the base patterns check as well though, so I have done that and added test coverage for getCsharpHashPatterns.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| return `${prefix}-${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`; | ||
| // Assemble the cache key. | ||
| return `${featurePrefix}${prefix}-${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If users list cache entries using the API, I think it'd be clearer to them what those cache entries are for if we keep codeql-dependencies- at the front.
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.
As discussed elsewhere, I also thought this would be a good idea. Thanks for confirming!
I have pushed a commit which changes this, except for minify- so that we don't run into problems with that, since it's already rolled out.
Once the JAR minification experiment has concluded, we can remove all of the special handling for that along with that FF.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@michaelnebel It is |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Make the function more easily testable by allowing `makePatternCheck` to be stubbed. - Use `makePatternCheck` for base patterns as well.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We store dependencies in sub directories of the directory in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@michaelnebel Thanks for pointing this out! I have thought about this a little, and I think it may be better to make that a separate change and put it behind a separate FF. That way we can see what impact each change has separately and get this change shipped faster. |
Sorry, something went wrong.
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.