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

Workflows: Re-enable manually triggered workflows on forks #32821

Merged

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Jun 18, 2021

Description

Re-enable manually triggered workflows on forks, to allow for better testability of changes to those workflows.

See #32114 (comment) for background.

How has this been tested?

Fork GB, and try to trigger release creation on your fork (using this branch). It's what I did to test #32560, so see the links to GHA workflows on my fork under the "How has this been tested?" section of that PR 😬

@ockham ockham added the [Type] Build Tooling Issues or PRs related to build tooling label Jun 18, 2021
@ockham ockham requested review from desrosj and a team June 18, 2021 15:35
@ockham ockham self-assigned this Jun 18, 2021
@ockham ockham changed the title Workflows: Allow point releases after a new RC is out Workflows: Re-enable manually triggered workflows on forks Jun 18, 2021
Base automatically changed from update/workflow-to-allow-later-point-release to trunk June 23, 2021 17:55
Most of these job are only run manually anyway, so we shouldn't need to prohibit them from running on forks.
Furthermore, these checks make it much harder to test changes to this workflow on a fork.
See #32114 (comment)
@ockham ockham force-pushed the update/build-workflow-reenable-manual-trigger-on-forks branch from 77100e7 to 244bd02 Compare June 23, 2021 17:58
Copy link
Contributor

@desrosj desrosj left a comment

Choose a reason for hiding this comment

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

It seems like with the other recent changes made elsewhere, the first job in this workflow will always run regardless of where the run is being requested. I think we'll need to revise this a bit to account for that.

I think that compute-stable-branch could check for the WordPress/Gutenberg repository. I don't know if there's any benefit for allowing this to run on forks.

@ockham
Copy link
Contributor Author

ockham commented Jun 23, 2021

It seems like with the other recent changes made elsewhere, the first job in this workflow will always run regardless of where the run is being requested. I think we'll need to revise this a bit to account for that.

Thanks @desrosj, good spot -- I forgot about the newly added step when rebasing 😅

I think that compute-stable-branch could check for the WordPress/Gutenberg repository. I don't know if there's any benefit for allowing this to run on forks.

It's required for the manually triggered workflow (to select the release branches from which we allow publishing a release, per #32560). For that reason, I'd like to be able to run it on forks also -- otherwise, we won't be able to test this workflow on forks once again 😅

I'll guard with a github.event_name == 'workflow_dispatch' check, as for the other steps. That way, it'll only be run when triggered manually (but not on PR creation, or pushing a commit).

@ockham
Copy link
Contributor Author

ockham commented Jun 23, 2021

I'll guard with a github.event_name == 'workflow_dispatch' check, as for the other steps. That way, it'll only be run when triggered manually (but not on PR creation, or pushing a commit).

d3a6583

@ockham ockham requested a review from desrosj July 5, 2021 11:47
@ockham
Copy link
Contributor Author

ockham commented Jul 6, 2021

@desrosj Would you mind giving this another quick look? 😊 🙏

Copy link
Contributor

@desrosj desrosj left a comment

Choose a reason for hiding this comment

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

This looks good!

My only question is around compute-stable-branches only running on workflow_dispatch. Is this correct? I guess I assumed that the version bumps and packaging happened automatically when tagging/releases occurred.

@ockham
Copy link
Contributor Author

ockham commented Jul 7, 2021

This looks good!

Thank you! 🎉

My only question is around compute-stable-branches only running on workflow_dispatch. Is this correct?

Yep! 👍

I guess I assumed that the version bumps and packaging happened automatically when tagging/releases occurred.

We were considering that kind of flow at some point, but decided for the current flow instead: The release is triggered manually, the workflow creates the version bump commit, builds the plugin, and attaches it as an asset to a release draft. The tag is only created by GH once the release is published. (That's more of a GH feature than a GH Actions one; it's possible to specify a tag that doesn't exist yet in a release draft, and GH will happily create it for the given ref when the release is published).

@ockham ockham merged commit 2f09068 into trunk Jul 7, 2021
@ockham ockham deleted the update/build-workflow-reenable-manual-trigger-on-forks branch July 7, 2021 15:30
@github-actions github-actions bot added this to the Gutenberg 11.1 milestone Jul 7, 2021
desrosj added a commit that referenced this pull request Jul 13, 2021
* Remove repository checks

Most of these job are only run manually anyway, so we shouldn't need to prohibit them from running on forks.
Furthermore, these checks make it much harder to test changes to this workflow on a fork.
See #32114 (comment)

* Run build job only on manual trigger, or on gutenberg repo

* Only run compute-stable-branches branch if triggered manually

(cherry picked from 2f09068)
sarayourfriend pushed a commit that referenced this pull request Jul 15, 2021
* Remove repository checks

Most of these job are only run manually anyway, so we shouldn't need to prohibit them from running on forks.
Furthermore, these checks make it much harder to test changes to this workflow on a fork.
See #32114 (comment)

* Run build job only on manual trigger, or on gutenberg repo

* Only run compute-stable-branches branch if triggered manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants