-
Notifications
You must be signed in to change notification settings - Fork 1
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
ci(.github/action): add release-candidate-ready-for-qa GitHub action #144
Conversation
| Name | Required | Description | Default | | ||
| --------------- | -------- | ---------------------------------------------------------- | ------- | | ||
| `version` | Yes | A version of the release candidate | NA | | ||
| `revision-url` | Yes | A commit revision URL | NA | |
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 shouldn't be hardcoded into the action but instead derived. It should use the current SHA of the release
branch to get the build id as the SHA is used in the build name (for example https://github.com/dequelabs/axe-core-npm/blob/develop/.github/workflows/deploy.yml#L62).
The final build name should be: the package name and version, followed by rc
and the SHA.
For example, if @axe-core/puppeteer were to deploy an RC for version 4.9.0 and the current release
brach SHA was 726e3c4
, the final name of the build QA should use is:
axe-core/puppeteer-4.9.0-rc-726e3c4
|
||
| Name | Required | Description | Default | | ||
| --------------- | -------- | ---------------------------------------------------------- | ------- | | ||
| `version` | Yes | A version of the release candidate | NA | |
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 shouldn't be hardcoded as the version changes every deploy. It will need to be taken from the package/lerna.json of the release
brach.
It should use #115. Since this is the 3rd time we've needed to use this script we should create that action first, merge it, then bring it into this action to use.
| --------------- | -------- | ---------------------------------------------------------- | ------- | | ||
| `version` | Yes | A version of the release candidate | NA | | ||
| `revision-url` | Yes | A commit revision URL | NA | | ||
| `owner` | Yes | An owner of the repository | NA | |
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 should use the same wording and requirement as
| `owner` | No | The owner of the repository e.g. dequelabs/axe-core-npm, then supply "dequelabs" | `github.context.repo.owner` | |
| `owner` | Yes | An owner of the repository | NA | | |
| `owner` | No | The owner of the repository e.g. dequelabs/axe-core-npm, then supply "dequelabs" | `github.context.repo.owner` | |
| `version` | Yes | A version of the release candidate | NA | | ||
| `revision-url` | Yes | A commit revision URL | NA | | ||
| `owner` | Yes | An owner of the repository | NA | | ||
| `repo` | Yes | A repository name | NA | |
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 should use the same wording and requirements as
| `repo` | No | The repository e.g. dequelabs/axe-core-npm, then supply "axe-core-npm" | `github.context.repo.repo` | |
| `repo` | Yes | A repository name | NA | | |
| `repo` | No | The repository e.g. dequelabs/axe-core-npm, then supply "axe-core-npm" | `github.context.repo.repo` | |
| `owner` | Yes | An owner of the repository | NA | | ||
| `repo` | Yes | A repository name | NA | | ||
| `slack-webhook` | Yes | A Slack channel webhook URL where the message will be sent | NA | | ||
| `slack-channel` | No | A Slack channel name where the message will be sent | NA | |
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 probably fine to hardcode into the action. I don't think we should be posting these release candidate build messages to different slack channels so shouldn't give the user an option. We can change that in the future if that ever happens and just have this default to api-team-releases
.
if [[ -z "${{ steps.get-release-issue.outputs.issue-url }}" ]]; then | ||
echo "::error::No release issue has been found" | ||
exit 1 | ||
fi |
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're trying to exit early if no ticket is found? If so you should use the gh run
commands to do that
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
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.
as discussed with @straker we leave the original code because it shows the correct error message
0c9bedb
to
426a6b6
Compare
Forgot to mention, we should rename this action since it does not deploy anything, just moves tickets around and posts to slack. So maybe |
I think |
The ones you and Michael suggested sound more like the name we should move too, I think its better if we remove
|
|
…ate-ready-for-qa. Change release-candidate-ready-for-qa
- uses: actions/checkout@v4 | ||
- uses: dequelabs/axe-api-team-public/.github/actions/release-candidate-ready-for-qa-v1-v1@main | ||
with: | ||
sha-rc: 4b632c61 |
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 shouldn't be an input, it should be calculated using the release
branch sha.
git checkout release
git rev-parse --short HEAD
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.
a branch name should not be hardcoded. A workflow file should take responsibility for the branch name where this action is called
- name: Get owner and repository name | ||
id: get-owner-repo-name | ||
shell: bash | ||
run: | | ||
if [[ -n "${{ inputs.owner }}" ]]; then | ||
ORGANIZATION="${{ inputs.owner }}" | ||
else | ||
IFS='/' read -r ORGANIZATION _ <<< "$GITHUB_REPOSITORY" | ||
fi | ||
|
||
if [[ -n "${{ inputs.repo }}" ]]; then | ||
REPOSITORY="${{ inputs.repo }}" | ||
else | ||
IFS='/' read -r _ REPOSITORY <<< "$GITHUB_REPOSITORY" | ||
fi | ||
|
||
echo "owner=$ORGANIZATION" >> $GITHUB_OUTPUT | ||
echo "repo=$REPOSITORY" >> $GITHUB_OUTPUT |
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.
You don't need to do this. repo
and owner
have default values in https://github.com/dequelabs/axe-api-team-public/blob/main/.github/actions/get-release-issue-v1/src/run.ts#L8-L9 so you can just forward the repo
and owner
inputs directly and let the release issue action use the defaults if none are provided.
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.
In the get-release-issue-v1 these are optional params so I leave it as in that action. Also, the repo name is used for adding a comment to an issue https://github.com/dequelabs/axe-api-team-public/blob/ci-add-deploy-release-candidate/.github/actions/release-candidate-ready-for-qa-v1/action.yml#L63
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.
Since GH_REPO
is not needed to add a comment since we provide the issue url, this step is not needed and can be removed.
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.
also, I will remove inputs.owner
, inputs.repo
because they are not needed
…ci-add-deploy-release-candidate
…e-candidate-ready-for-qa action
changed according to the review
@@ -0,0 +1,33 @@ | |||
# release-candidate-ready-for-qa-v1 | |||
|
|||
A GitHub Action to prepare already created a release candidate for QA. |
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.
A GitHub Action to prepare already created a release candidate for QA. | |
A GitHub Action that lets the QA team know a release candidate is ready for QA |
|
||
| Name | Required | Description | Default | | ||
| --------------- | -------- | ---------------------------------------------------------- | ---------------------------- | | ||
| `sha-rc` | No | SHA of the release commit from the release branch | git rev-parse --short=8 HEAD | |
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.
We'll want to specify the length since SHA could be short (8) or long (40)
| `sha-rc` | No | SHA of the release commit from the release branch | git rev-parse --short=8 HEAD | | |
| `sha-rc` | No | 8 character SHA of the release commit from the release branch | git rev-parse --short=8 HEAD | |
| --------------- | -------- | ---------------------------------------------------------- | ---------------------------- | | ||
| `sha-rc` | No | SHA of the release commit from the release branch | git rev-parse --short=8 HEAD | | ||
| `slack-webhook` | Yes | A Slack channel webhook URL where the message will be sent | NA | | ||
| `owner` | No | An owner of the repository | $GITHUB_REPOSITORY | |
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.
Should match the text in the action.yml
| `owner` | No | An owner of the repository | $GITHUB_REPOSITORY | | |
| `owner` | No | The owner of the repository e.g. dequelabs/axe-core-npm, then supply "dequelabs" | $GITHUB_REPOSITORY | |
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 will remove this because it's not needed
| `sha-rc` | No | SHA of the release commit from the release branch | git rev-parse --short=8 HEAD | | ||
| `slack-webhook` | Yes | A Slack channel webhook URL where the message will be sent | NA | | ||
| `owner` | No | An owner of the repository | $GITHUB_REPOSITORY | | ||
| `repo` | No | A repository name | $GITHUB_REPOSITORY | |
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.
Should match the text in the action.yml
| `repo` | No | A repository name | $GITHUB_REPOSITORY | | |
| `repo` | No | The repository e.g. dequelabs/axe-core-npm, then supply "axe-core-npm" | $GITHUB_REPOSITORY | |
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 will remove this because it's not needed
permissions: | ||
issues: write |
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.
Since write
permissions are needed (I assume for gh issue comment
command to write a comment), we should spell that out similar to how we've listed permissions in other repos
@@ -0,0 +1,98 @@ | |||
name: release-candidate-ready-for-qa-v1 | |||
description: Preparing a release candidate issue for QA |
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.
description: Preparing a release candidate issue for QA | |
description: Lets the QA team know a release candidate is ready for QA |
|
||
inputs: | ||
sha-rc: | ||
description: SHA of the release commit from the release branch |
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.
description: SHA of the release commit from the release branch | |
description: 8 character SHA of the release commit from the release branch |
shell: bash | ||
run: gh issue comment ${{ steps.get-release-issue.outputs.issue-url }} --body "$BODY" | ||
env: | ||
GH_REPO: ${{ steps.get-owner-repo-name.outputs.repo }} |
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.
GH_REPO
is only needed if you don't supply a url (i.e. use an issue number). Since we provide the url the repo is parsed from that. Testing in my terminal this works
GH_TOKEN=<token> gh issue comment https://github.com/dequelabs/<repo>/issues/<number> -b "hello world"
GH_REPO: ${{ steps.get-owner-repo-name.outputs.repo }} |
- name: Get owner and repository name | ||
id: get-owner-repo-name | ||
shell: bash | ||
run: | | ||
if [[ -n "${{ inputs.owner }}" ]]; then | ||
ORGANIZATION="${{ inputs.owner }}" | ||
else | ||
IFS='/' read -r ORGANIZATION _ <<< "$GITHUB_REPOSITORY" | ||
fi | ||
|
||
if [[ -n "${{ inputs.repo }}" ]]; then | ||
REPOSITORY="${{ inputs.repo }}" | ||
else | ||
IFS='/' read -r _ REPOSITORY <<< "$GITHUB_REPOSITORY" | ||
fi | ||
|
||
echo "owner=$ORGANIZATION" >> $GITHUB_OUTPUT | ||
echo "repo=$REPOSITORY" >> $GITHUB_OUTPUT |
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.
Since GH_REPO
is not needed to add a comment since we provide the issue url, this step is not needed and can be removed.
…candidate-ready-for-qa-v1 action. Change the Readme file of this action
changed according to the review
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.
@maksym-shynkarenko showed me the results of testing it in a test repo with release-like issues so we should be good to merge. We'll do another test once this is merged to verify in actual codebase.
Add the GitHub Action release-candidate-ready-for-qa
Closes: #426