GeezerVison is showing github.com — Automatically clean up old TRAP caches by henrymercer · Pull Request #2306 · github/codeql-action
Conversation
henrymercer
commented
May 23, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This PR implements a new feature, behind a flag, that keeps only the newest TRAP cache for each language.
We call the Actions cache APIs directly as these have not yet been added to the @actions/cache npm package.
I have added a unit test exercising most of the functionality, and have also tested this manually using a test repo. I think an integration test is probably not worth it, particularly on this repo where the databases are small enough that TRAP caching skips the upload anyway.
Merge / deployment checklist
- Confirm this change is backwards compatible with existing workflows.
- Confirm the readme has been updated if necessary.
- Confirm the changelog has been updated if necessary.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Since we'll only cleanup when running on the default branch
Comment on lines
+241
to
+246
|
|
{
|
|
|
id: 7,
|
|
|
key: "codeql-trap-1-2.0.0-swift-older",
|
|
|
created_at: "2024-02-21T14:25:00Z",
|
|
|
size_in_bytes: 300 * 1024 * 1024,
|
|
|
},
|
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.
This one wasn't deleted. Is it because the timestamp is identical to id 6? Wait...the code should only keep one cache per language. So, I'm not sure what's going on here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Ah, I see now that the reasoning for this is a bit opaque without looking at the rest of the file. We're expecting to only clean up TRAP caches for JavaScript and Ruby as these are the only ones that the getTestConfigWithTempDir config specifies as languages to analyze in this job. I'll add a comment to make this clearer.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks. That makes a lot of sense.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced May 31, 2024
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|