Skip to content
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

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

flobernd
Copy link
Member

@flobernd flobernd commented Jul 13, 2023

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.

@flobernd flobernd requested a review from swallez July 13, 2023 11:05
@flobernd flobernd marked this pull request as ready for review July 13, 2023 11:05
@flobernd flobernd requested a review from a team as a code owner July 13, 2023 11:05
@flobernd flobernd changed the title Test Automatically compile/generate output artifacts on push to main Jul 13, 2023
Comment on lines +46 to +47
make compile
make generate
Copy link
Member

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.

Copy link
Member Author

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 by make contrib with license-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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

@picandocodigo picandocodigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@flobernd flobernd merged commit 20cfefd into main Jul 17, 2023
4 checks passed
@flobernd flobernd deleted the ci-auto-compile branch July 17, 2023 09:00
@github-actions
Copy link
Contributor

The backport to 8.0 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.0 and the compare/head branch is backport-2181-to-8.0.

@github-actions
Copy link
Contributor

The backport to 8.1 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.1 and the compare/head branch is backport-2181-to-8.1.

@github-actions
Copy link
Contributor

The backport to 8.4 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.4 and the compare/head branch is backport-2181-to-8.4.

@github-actions
Copy link
Contributor

The backport to 8.2 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.2 and the compare/head branch is backport-2181-to-8.2.

@github-actions
Copy link
Contributor

The backport to 7.17 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 7.17 and the compare/head branch is backport-2181-to-7.17.

@github-actions
Copy link
Contributor

The backport to 8.7 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.7 and the compare/head branch is backport-2181-to-8.7.

@github-actions
Copy link
Contributor

The backport to 8.6 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.6 and the compare/head branch is backport-2181-to-8.6.

@github-actions
Copy link
Contributor

The backport to 8.5 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.5 and the compare/head branch is backport-2181-to-8.5.

@github-actions
Copy link
Contributor

The backport to 8.3 failed:

The process '/usr/bin/git' failed with exit code 1

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 base branch is 8.3 and the compare/head branch is backport-2181-to-8.3.

flobernd added a commit that referenced this pull request Jul 17, 2023
flobernd added a commit that referenced this pull request Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants