-
Notifications
You must be signed in to change notification settings - Fork 414
feat(ci): Create Devnet Workflows #2053
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
feat(ci): Create Devnet Workflows #2053
Conversation
|
Tested this locally using mkdir -p /tmp/act-origin.git
git init --bare /tmp/act-origin.git
git remote set-url origin /tmp/act-origin.git
git push origin main
git push origin forks/amsterdam
git push origin eips/amsterdam/eip-7778
git push origin eips/amsterdam/eip-7708
...And then running sudo /home/marioevz/.local/bin/act workflow_dispatch -W .github/workflows/create-devnet-branch.yaml --input fork=amsterdam --input devnet_name=test/1 --input eip_numbers=7778,7708 -s GITHUB_TOKEN=<github_token> --container-options "-v /tmp:/tmp" |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2053 +/- ##
================================================
Coverage 86.07% 86.07%
================================================
Files 599 599
Lines 39527 39527
Branches 3780 3780
================================================
Hits 34021 34021
Misses 4872 4872
Partials 634 634
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 for adding this! Some comments and thoughts, I think we can make this a one-shot workflow. Let me know what you think!
Combine Workflows
I think we should merge bal-devnet-2.yaml and create-devnet-branch.yaml into one file where the inputs have defaults:
inputs:
fork:
description: 'Fork name (e.g., amsterdam)'
required: true
type: string
default: 'amsterdam'
...
eip_numbers:
description: 'Comma-separated list of EIP numbers'
required: true
type: string
default: '8024,7843,7708,7778' Where the merge-eip-branches action is included at the end! Then we rename this workflow to update-devnet-branch.yaml.
Ideally these defaults come from a config file that other workflows use (my artifact workflows), so that we only have to change one file in the future, but thats a future addition in my opinion and for another PR. Nonetheless, we'll be able to add these inputs in the github ui or command line. For example:
gh workflow run update-devnet-branch.yaml \
-f fork=amsterdam \
-f devnet_name=bal/2 \
-f eip_numbers=8024,7843,7708,7778Extra Addtions
For the merge-eip-branches action:
- We could check if
forks/amsterdamis an ancestor on the latest commit for each EIP usinggit merge-base --is-ancestor forks/amsterdam eips/amsterdam/eip-xxxx, and fail fast otherwise. - Afterwards we should also do a merge check for all EIP pairs to see which ones will have conflicts. The CI could output all the EIPs that have conflicts upon manual trigger, to fail fast - if so we will have to resolve manually. If no conflicts then continue!
Consideration
To be honest I am wondering if this can be a one shot workflow: update-devnet-branch.yaml, where we don't even need eip-rebase.yaml that has the following flow:
- Fetch all branches
- Validate all EIP inputs (i.e numeric)
- Perform ancestor check, are we rebased already?
- Auto-rebase all EIPs not already rebased. Fail fast if conflicts (have to be resolved manually).
- Push rebased EIPs:
git push --force-with-lease - EIP merge conflict check, by testing merge conflict pairs. Fail fast if conflicts that have to be performed manually.
- Create/update the devnet branch by force pushing to latests forks/.
- Merge all EIPs to devnet branch.
- Push devnet branch.
The only issue I can see here is if we have to manually resolve the EIP merge conflicts. If we merge eip-7843 into eip-7708 to resolve conflicts, then eip-7708 is no longer a clean isolated branch - it contains another EIP's code.
To keep EIP branches clean, we could create merged branches like eips/amsterdam/eip-7708+7843 that contain the resolved conflicts, while keeping the original eip-7708 and eip-7843 branches untouched. The workflow would accept these merged branches in the input (e.g., eip_numbers: 8024,7708+7843,7778) and detect them by the + in the name. Assuming we get a a merge conflict with 7708 + 7843, and 7843 + 7778, then we'd get this at a fail fast step. Once resolving manually these would all sit within eip-7708+7843+7778, and our cli command would be:
gh workflow run update-devnet-branch.yaml \
-f fork=amsterdam \
-f devnet_name=amsterdam/2 \
-f eip_numbers=8024,7708+7843+7778 |
Approved here as only cosmetic changes suggested in code reviews! |
Co-authored-by: spencer <spencer.tb@ethereum.org>
Co-authored-by: spencer <spencer.tb@ethereum.org>
Co-authored-by: spencer <spencer.tb@ethereum.org>
🗒️ Description
Creates actions and workflows to automate devnet branch creation:
Action
.github/actions/rebase-eip-branch/action.yamlRebases a given
eips/<fork>/eip-<eip-number>branch to the appropriateforks/<fork>base branch.Workflow
.github/workflows/eip-rebase.yamlUsed to dispatch action
.github/actions/rebase-eip-branch/action.yaml.The workflow aborts on any rebase conflict.
Args:
Action
.github/actions/merge-eip-branches/action.yamlMerges multiple EIP branches based on the same fork.
Workflow
.github/workflows/create-devnet-branch.yamlCreates a Devnet branch,
devnets/<devnet name>, from different EIP branches based on the same fork by dispatching.github/actions/merge-eip-branches/action.yaml.The workflow aborts on any merge conflict.
Args:
amsterdam/1,bal/2,eip1234/1, etc. Resulting branch will bedevnets/<devnet name>.eip/<fork>/eip-<eip_number>must exist and ideally be rebased on the latestforks/<fork>.Workflow
.github/workflows/bal-devnet-2.yamlShortcut for
.github/workflows/create-devnet-branch.yamlwithfork=amsterdam,devnet_name=bal/2andeip_numbers=8024,7843,7708,7778.Args: None
🔗 Related Issues or PRs
N/A.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture