GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for dependency caching by mbg · Pull Request #2383 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Jul 22, 2024

Copy link
Copy Markdown
Member

Work-in-progress to add support for dependency caching to the init Action.

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.

All reactions
@mbg mbg self-assigned this Jul 22, 2024
henrymercer
henrymercer reviewed Jul 23, 2024
View reviewed changes

@henrymercer henrymercer left a comment

Copy link
Copy Markdown
Contributor

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.

Looks good so far, some initial comments:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/dependency-caching.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/dependency-caching.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/dependency-caching.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/dependency-caching.ts
// with an empty string.
const globber = await makeGlobber(cacheConfig.hash);

if ((await globber.glob()).length === 0) {

@henrymercer henrymercer Jul 23, 2024

Copy link
Copy Markdown
Contributor

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.

Does this mean we list files twice (once here and once in cacheKey)? Might not be a performance problem in practice.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mbg mbg Jul 24, 2024

Copy link
Copy Markdown
Member Author

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.

Yes, it does. I looked at this before your review but, unfortunately, the hashFiles implementation in @action/glob isn't exposed in a way that we can just throw an existing array of paths at it, so we'd have to copy the implementation (or a variant of it, depending on how much we care about the intricacies of theirs).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

henrymercer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread src/dependency-caching.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/init-action-post.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/init-action.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg force-pushed the mbg/add/dependency-caching branch from 04e457d to c07c5b0 Compare September 24, 2024 10:15
github-advanced-security[bot]
github-advanced-security AI found potential problems Oct 7, 2024
View reviewed changes
Comment thread src/dependency-caching.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg force-pushed the mbg/add/dependency-caching branch from a2bb99e to ff98043 Compare October 7, 2024 10:46
@mbg
mbg force-pushed the mbg/add/dependency-caching branch from c898cb9 to ad48d53 Compare October 14, 2024 17:48
henrymercer
henrymercer previously approved these changes Oct 28, 2024
View reviewed changes

@henrymercer henrymercer left a comment

Copy link
Copy Markdown
Contributor

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, this LGTM to start shipping disabled by default! Some final minor suggestions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/caching-utils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/caching-utils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/dependency-caching.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/dependency-caching.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mbg
mbg dismissed henrymercer’s stale review via ba64dbe October 29, 2024 12:05
mbg added 22 commits October 29, 2024 12:06
@mbg
Add dependency-caching input to Action
1a7989f
@mbg
Add dependencyCachingEnabled to Config
1922a48
@mbg
Add explicit dependency on @actions/glob
19e7c25
@mbg
Add caching utils
51d90f4
@mbg
Add bare-bones dependency caching functions
2b7af49
@mbg
Store and restore dependency caches in init Action
f64038f
@mbg
Add caching configuration for C#
5e11d57
@mbg
Add caching configuration for Go
9d1353f
@mbg
Ensure that we have files to calculate the hash for the cache key from
5afaeed
@mbg
Add documentation for CacheConfig
f0bcca1
@mbg
Rename makeGlobber parameter
259cc5a
@mbg
Move isDefaultSetup to actions-util.ts and change implementation
471ed9f
@mbg
Store dependency caches in analyze Action
5b057af
@mbg
Skip uploading empty caches
f3714ae
@mbg
Add env var alternative to dependency-caching input
1338dbc
@mbg
Add environment variable for custom dependency cache prefix
8f657e8
@mbg
Add message when no cache was found for a language
c0b5869
@mbg
Fix import ordering
7d69964
@mbg
Support Paket
668531e
@mbg
Add CachingKind enum to control whether to restore or store caches
79faaf1
@mbg
Disable dependency caching by default on hosted runners for now
0cb7129
@mbg
Use common getTotalCacheSize for TRAP caching
21e6a62
mbg added 2 commits October 29, 2024 12:10
@mbg
Remove part about deprecated values in docs for getCachingKind
ed74b24
@mbg
Document future cache size considerations
bab8f1d
@mbg
mbg force-pushed the mbg/add/dependency-caching branch from ba64dbe to bab8f1d Compare October 29, 2024 12:10
@mbg
mbg marked this pull request as ready for review October 29, 2024 12:10
@mbg
mbg requested a review from a team as a code owner October 29, 2024 12:10
@mbg

mbg commented Oct 29, 2024

Copy link
Copy Markdown
Member Author

@henrymercer I have addressed your comments and rebased the PR branch on main to resolve the merge conflicts. 21e6a62 onwards are the changes in response to your comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

henrymercer
henrymercer approved these changes Oct 29, 2024
View reviewed changes

@henrymercer henrymercer left a comment

Copy link
Copy Markdown
Contributor

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, looking forward to seeing the results of this internally!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
mbg merged commit dfc2731 into main Oct 29, 2024
@mbg
mbg deleted the mbg/add/dependency-caching branch October 29, 2024 16:09
@mbg
mbg restored the mbg/add/dependency-caching branch October 29, 2024 16:09
@mbg
mbg deleted the mbg/add/dependency-caching branch October 29, 2024 16:09
This was referenced Nov 8, 2024
Merge main into releases/v3 #2585
Merged
Merge releases/v3 into releases/v2 #2587
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@henrymercer henrymercer henrymercer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mbg mbg

Labels

None yet

Projects

None yet

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.

3 participants

@mbg @henrymercer @github-advanced-security
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.