-
Notifications
You must be signed in to change notification settings - Fork 73
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
Automatically compile/generate output artifacts on push to main
#2181
Conversation
6f0d815
to
d34fa15
Compare
d34fa15
to
44ac492
Compare
44ac492
to
30c9880
Compare
main
make compile | ||
make generate |
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 make contrib
target does a few more things, such as checking licenses, running a linter, fixing the format, and also generating the typescript version.
Having an action change the source code is not common and we may consider that part (code formatting) as a check, but in this particular case I think it can actually help "casual" contributors to easily contribute to the spec. So we may even go further and replace e.g. the licence-check
called by make contrib
with license-add
.
Finally, what about adding a new make target that does all this so that this action only calls that single target? This may ease maintenance.
I'll let @picandocodigo look a the GitHub machinery around this.
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
make contrib
target does a few more things, such as checking licenses, running a linter, fixing the format, and also generating the typescript version.
This new workflow only runs on pushes to main
. Direct pushes should never occur due to branch protection, which means that all these checks have already run as part of the PR checks and review process.
I think it can actually help "casual" contributors to easily contribute to the spec.
👍
So we may even go further and replace e.g. the
licence-check
called bymake contrib
withlicense-add
.
I'm not sure if we should automatically modify non-generated files in general, but it's surely something to think about. On the other hand, pasting a license text is probably pretty straightforward and does not require e.g. NodeJS on the dev machine like for the compilation/generation.
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.
This new workflow only runs on pushes to
main
.
Oh, I missed that part! So this means PRs still need to pass the linter and license checks, and indeed we just need to addresses the compilation part here.
Note: if we don't include this on version branches (currently 8.[0-9]+
and 7.17
), we should keep the current behavior (fail a PR's check if compilation changes the output): we occasionally have to backport manually, and the cause is most often a merge conflict on schema.json
.
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.
Ouch, good point! I forgot about the backports in general. I think we just have to make sure this workflow runs for the version branches as well and we should be fine.
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!
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.0 8.0
# Navigate to the new working tree
cd .worktrees/backport-8.0
# Create a new branch
git switch --create backport-2181-to-8.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.0 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.1 8.1
# Navigate to the new working tree
cd .worktrees/backport-8.1
# Create a new branch
git switch --create backport-2181-to-8.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.1 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.4 8.4
# Navigate to the new working tree
cd .worktrees/backport-8.4
# Create a new branch
git switch --create backport-2181-to-8.4
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.4
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.4 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.2 8.2
# Navigate to the new working tree
cd .worktrees/backport-8.2
# Create a new branch
git switch --create backport-2181-to-8.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.2 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.17 7.17
# Navigate to the new working tree
cd .worktrees/backport-7.17
# Create a new branch
git switch --create backport-2181-to-7.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-7.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.17 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.7 8.7
# Navigate to the new working tree
cd .worktrees/backport-8.7
# Create a new branch
git switch --create backport-2181-to-8.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.7 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.6 8.6
# Navigate to the new working tree
cd .worktrees/backport-8.6
# Create a new branch
git switch --create backport-2181-to-8.6
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.6
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.6 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.5 8.5
# Navigate to the new working tree
cd .worktrees/backport-8.5
# Create a new branch
git switch --create backport-2181-to-8.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.5 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.3 8.3
# Navigate to the new working tree
cd .worktrees/backport-8.3
# Create a new branch
git switch --create backport-2181-to-8.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 20cfefd7de95b6be981095b296158a9594aa2f90
# Push it to GitHub
git push --set-upstream origin backport-2181-to-8.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.3 Then, create a pull request where the |
) (#2184) Co-authored-by: Florian Bernd <[email protected]>
) (#2185) Co-authored-by: Florian Bernd <[email protected]>
This PR removes the need to locally compile/generate the output artifacts before pushing changes.
Instead, output artifacts are created on demand when code is pushed to
main
.