-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix the GitHub actions cron job #11256
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
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.
So this is a bit of a hacky way to generate a unique cache key for scheduled jobs, but not for pull request jobs.
So when a pull request gets build the cache-key will be something like:
That way the cache can be reused across multiple pull requests (remember, for pull requests we do not use akka snapshots, but stable versions. So if the pr base branch did not change between pull requests we are absolutely fine reusing the cache containing the local published Play artifacts)
For schedules jobs however we always want to create a new cache for each workflow run, since we don't know if the akka(-http) snapshot version changed between two nightly runs (so the cache is effectively only used by the scripted jobs after it got filled by the publish local step). The key will then look like:
I did test this expression here: https://github.com/mkurz/release-drafter-test/runs/6209442291?check_suite_focus=true#step:8:10 (you can have a look in the workflow file)
I can not see in the docs how to achieve that in another way, since we can't have
if
conditions within expressions (also no elvis operator): https://docs.github.com/en/actions/learn-github-actions/expressionsIf someone has a nicer way to do that, please let me know 😉
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.
As another variant, we can to use the Akka versions. Something like
For PR's it will be
play-published-local-jdk8-55238a2b--
and for shedulerplay-published-local-jdk8-55238a2b-2.6.19+52-00c1da99-SNAPSHOT-10.1.15+4-8e825ed4-SNAPSHOT
.PS: But I like your variant and don't see a matter to change it. Only one moment, that we should understand that
run_id
will not change if we will re-run failed shedule action. (https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables)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, but the akka version might also not have changed when you re-run the workflow, so it's similiar (if not the same in most cases). Also, when a job fails the post hook to fill the cache will not run anyway, so this should not be a problem at all.