-
Notifications
You must be signed in to change notification settings - Fork 111
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
refactor (actions): make better use of variables, secrets and versions #3393
Conversation
Remove repeated instances of global environment variables. Do not print ENV variables on the terminal as GitHub Actions already shows it.
As actions get recurrent fixes, using a specific version causes more maintance on the pipelines. On the other hand, using @master versions could make some action unreliable, as breaking changes might be included without further notice, and even change behavior on a daily basis.
A whole step with refex was being used to extract different variables from GitHub's environment. This gets depecrated in favor of using `rlespinasse/github-slug-action@v4` which has slug URL variables. A SLUG on a variable will: - put the variable content in lower case - replace any character by - except 0-9, a-z, ., and _ - remove leading and trailing - character - limit the string size to 63 characters This changes also takes care of using the Head or Base branch for deployments. This will allow us tomerge of workflows, as most steps on this deployment actions are very similar, with little variations between workflows.
Codecov Report
@@ Coverage Diff @@
## main #3393 +/- ##
==========================================
- Coverage 78.34% 78.30% -0.04%
==========================================
Files 267 267
Lines 31526 31576 +50
==========================================
+ Hits 24698 24727 +29
- Misses 6828 6849 +21 |
I think @dconnolly and @conradoplg have the most experience with this CI configs, so I'll leave the reviews to them. I just want to make sure we're going to check all these jobs work after the refactor? |
Agreed on moving away from action@master/main. The other actions are pinned to specific versions but only because we have Dependabot configured to propose Action updates as they become available |
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!
As @dconnolly mentioned I think we can keep referring to specific versions and bump them with dependabot, so that we can review the changes in the actions before using new versions. I'll leave approval to @dconnolly
Reverting commit 8c93409
@dconnolly reverted to specific action versions for approval |
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.
LGTM!
@gustavovalverde the Google Cloud Build may have timed out again, I've kicked it off, if it fails again maybe rebase this branch onto main the get the timeout bump |
I've opened #3416 for this bug, and nominated it for the stable release candidate epic. Can you please copy and paste one or two failure logs into that ticket? |
Motivation
ENV and Secrets: Using regex to extract information from GitHub environments is noisy and error-prone, and it restrict flexibility or increases complexity when more specific versions of specific variables are needed, for example, using a cleaned version of the branch name without special characters and with a specific max length (to be used in URL or image tags).
Actions versions: As actions get recurrent fixes, using a specific version causes more maintenance on the pipelines. And using
master
versions could make some action unreliable, as breaking changes might be included without further notice, and even change behavior on a daily basis.Designs
A whole step with regex was being used to extract different variables from GitHub's environment. This gets deprecated in favor of using
rlespinasse/github-slug-action@v4
which has slug URL variables.A SLUG on a variable will:
This change also takes care of using the Head or Base branch for deployments. This will allow us to potentially merge workflows, as most steps on this deployment actions are very similar, with little variations between workflows.
Related: #3359
Solution
rlespinasse/github-slug-action@v4
Review
@conradoplg @dconnolly @teor2345
Reviewer Checklist
Follow Up Work
Accomplish the same behavior of CD, Manual Deploy, Regenerate test state, Test and Zcashd Manual Deploy with fewer YAMLs