-
Notifications
You must be signed in to change notification settings - Fork 101
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
GitHub workflow to build and deploy standalone plugins #686
GitHub workflow to build and deploy standalone plugins #686
Conversation
push: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
paths: | ||
- '.github/workflows/deploy-standalone-plugins.yml' | ||
pull_request: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
- 'feature/**' | ||
paths: | ||
- '.github/workflows/deploy-standalone-plugins.yml' | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize |
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.
I assume you have these here for testing, but I think we'll need to change this trigger to something different like a release, or the addition of a tag, or something. What do you think?
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 makes sense.
Performance Lab uses:
on:
release:
types:
- published
WordPress Beta Tester uses:
on:
push:
tags:
- "*"
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.
Yes @joemcgill, Once we have thoroughly tested the workflow, we must update it with a release
or push tags
.
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.
@mukeshpanchal27 Can you please add both versions of the code here so that we can proceed with the full code review? You can comment out the version which we should eventually use (on release or manual dispatch), and then add a TODO
comment to get rid of the current triggers here before we merge this.
Thanks, @mukeshpanchal27, this looks like it's headed in the right direction. What are the remaining blockers, and can I help you resolve them in someway? At minimum it seems like we're waiting on the first plug-in to be available on the.org repo, but we also need to decide on how this is getting triggered. Is that something that you want to figure out, or are you looking for direction on? Any other concerns? |
Thanks, @joemcgill for your review.
|
If Performance Lab will have releases that shouldn't trigger the workflow, Some combination of these might work: on:
push:
branches:
- 'trunk'
paths:
- 'modules/**'
tags:
- '*' Needs some thought though. |
This is a tricky one. We should be confident that the script is going to work even before we have a released plugin to use this with. You can already see that the environment variables are being set correctly when you look at the failed task now, so I think we're good here. Once we have an official plugin SVN repo to test with, we can keep things as is and manually execute the workflow with this forked version of the script so we can see the whole process without pushing a new commit.
I agree. For now, I still think it makes sense for us to execute these anytime a new release is published, since that is most likely the way we will want to use this task. If there are exceptions where we need to push out a manual release of either the performance lab plugin or one of the standalone plugins, we can do that manually without using this automated process. That said, I'm happy for us to come up with a better way of doing this in an automated fashion, and @costdev's suggestion is one option we should consider. |
From the issue:
☝️ This seems to provide good guidance here.
From the issue:
For now, if all of the above sections are met, I think we could use this: on:
release:
types: [published]
workflow_dispatch:
inputs:
slug:
type: string
description: 'The slug of the plugin to deploy' From there, updated plugins will be deployed when:
|
Thanks both for your feedback. @joemcgill We got official approval for |
That’s great news that we have approval. As long as we have an SVN repo we should be able to test the workflow, we just don’t want to actually commit the new files to that repo until we’ve finished the whole build process. |
@joemcgill The workflow is now https://github.com/WordPress/performance/actions/runs/4582789944/jobs/8093233503?pr=686 ✅ and deploy process working look good. Can you please review it. Thanks! |
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.
@mukeshpanchal27 This looks great for the most part.
In a few places, it would be great if you could explain which changes are meant to be temporary (before the merge of this PR) and which changes are meant to be actually merged. Please use code comments to make that clear from the code itself - there are a few places where I have questions about what you intend to get merged vs what is just temporary.
push: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
paths: | ||
- '.github/workflows/deploy-standalone-plugins.yml' | ||
pull_request: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
- 'feature/**' | ||
paths: | ||
- '.github/workflows/deploy-standalone-plugins.yml' | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize |
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.
@mukeshpanchal27 Can you please add both versions of the code here so that we can proceed with the full code review? You can comment out the version which we should eventually use (on release or manual dispatch), and then add a TODO
comment to get rid of the current triggers here before we merge this.
#SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
#SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
SVN_PASSWORD: SVN_PASSWORD | ||
SVN_USERNAME: SVN_USERNAME |
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.
Why are these two lines commented out?
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.
Because if somehow the workflow starts working, then it will not commit the code in SVN because of wrong access. I'll update it once everything is finalised. Thanks.
@felixarntz The The next steps here, as I see it, are to update the |
Thanks for clarifying @joemcgill. In that case, some of my feedback above does not need to be actioned. That said, two most critical things to work out from my perspective:
|
Thanks @felixarntz.
In that case, I suggest we go ahead with what @costdev proposed for a manual workflow:
Since |
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.
@mukeshpanchal27 I have no other feedback aside from what @joemcgill and @felixarntz have provided, other than a nit pick suggestion to clean up a comment, most specifically the first person speech aspect, which I think we should always avoid in comments.
Thanks @joemcgill, SGTM!
Makes sense to me. It would still be good to annotate in the PR code with comments which blocks of code are temporary vs which code should eventually be merged. |
@felixarntz In the 5d4e5c0 i set |
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.
@mukeshpanchal27 Thank you for the updates, this looks great now.
Consider the code approved from my side, of course pending the final changes following the TODO comments.
We also still have to make a decision outside of this PR on the assets to use, but conceptually setting ASSETS_DIR
to a module-specific assets directory certainly makes more sense than pointing to the same directory that the PL plugin uses.
@joemcgill @felixarntz In 748df3b commit, I update PR so it will set the matrix for the release workflow conditional base. Note: For manual triggers, we don't use plugin names, so I have not included them. |
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.
@mukeshpanchal27 this is looking good to me now.
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.
Think this looks good to me too @mukeshpanchal27! Thanks! 👍
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 is a clever way to use the inputs of the manual workflow. Nice work @mukeshpanchal27. I say we go with this for our dry run, and we can decide if we want to improve the way the inputs are working before finalizing the whole feature.
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.
@mukeshpanchal27 One last question here, but this is looking basically ready to merge.
cc @joemcgill
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.
One last thing here before we merge this pull request (thanks @joemcgill).
Co-authored-by: Felix Arntz <[email protected]>
Summary
Fixes #638
Relevant technical choices
For now, this PR adds a new GitHub workflow that triggers push and pull requests, which we update after the approach is approved by other members.
The main purpose is that I have to use the 10up deploy action so the PR reads the
plugins.json
file and sets metric values for each module that we list in that file.I have commented out the original
SVN_USERNAME
andSVN_PASSWORD
so we can test workflow.Thank you, @joemcgill for all of your advice, and thank you, @costdev for all of your assistance in setting up the matrix for GHA.
Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.