-
Notifications
You must be signed in to change notification settings - Fork 100
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 cache option on setup-go action in workflows #8280
Open
brooke-hamilton
wants to merge
5
commits into
main
Choose a base branch
from
brooke-hamilton/set-go-cache
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
127b30b
set golang cache option
brooke-hamilton 8c2a076
cache setting on setup-go action
brooke-hamilton 6496f73
Merge branch 'main' into brooke-hamilton/set-go-cache
brooke-hamilton 106e56c
Merge branch 'main' into brooke-hamilton/set-go-cache
brooke-hamilton a2fdb09
Merge branch 'main' into brooke-hamilton/set-go-cache
brooke-hamilton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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 think this is true by default and does not need to be set explicitly.
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.
When this wasn't added, which means that it was true, we were getting the same error.
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 added some information here: #8147. Maybe you can find the missing link.
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 you are right: setting
cache: true
does not change the behavior because it is true by default. I put it here to be explicit because in some of our other workflows we had additional caching logic that was created before the caching feature was available on thesetup-go
action. I removed the additional caching logic fromfunctional-test-cloud.yaml
, and from the non-cloud tests in a previous PR #8280. Setting this value makes it clear that we are doing caching, in case someone looks at the workflow and thinks "why aren't we doing caching like we had before?" But if you prefer to not have this value set explicitly I will remove it.This workflow wasn't having an error, but the
functional-test-cloud.yaml
workflow was having occasional errors with cache conflicts, so I removed thecache@v4
action, which I think is now unnecessary due to caching being built into thesetup-go
action.I think that PR made sense where we did caching with the
cache@v4
action, but I still saw cache file conflicts with that step, so with this PR we can try using the built-in caching with thesetup-go
action. If we don't see good results we can revert, but so far with PR #8280 things seem OK.However, one caveat on what I said above, after PR #8280 we are still seeing caching errors with the
setup-go
action. Here is an example. I found two related issues here and here. They recommend updating our go version to > 1.23.0. We need to standardize our go version on the version set ingo.mod
anyway (because each workflow has a hard coded version that is separate fromgo.mod
). So let's discuss which version and do that in a separate PR.What do you think about this plan?
cache@v4
and set thesetup-go
action propertycache: true
. (this pr)go.mod
to use a version greater than 1.23.0 and remove hard coded go versions from the workflow. (next pr)cache: false
on thesetup-go
action.I really appreciate your feedback on this - I know you have a lot of knowledge in this area having spent significant cycles on it. ❤️
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.
The plan looks good to me. Thanks for the detailed explanation.