-
Notifications
You must be signed in to change notification settings - Fork 113
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
update the github action for release notes to use the release note labels to automate release note generation #613
update the github action for release notes to use the release note labels to automate release note generation #613
Conversation
d832378
to
4cb6265
Compare
An example of the release notes I get in
|
4cb6265
to
e52cd4f
Compare
I believe this PR's test runs will benefit from @SaschaSchwarze0 's #614 |
.github/workflows/release.yaml
Outdated
PR_NUM=$(echo $pr | cut -d';' -f3) | ||
PR_RELEASE_NOTE=$(wget -q -O- https://api.github.com/repos/shipwright-io/build/issues/${PR_NUM:1} | jq .body -r | grep -oPz '(?s)(?<=```release-note..)(.+?)(?=```)' | grep -avP '\W*(Your release note here|action required: your release note here|NONE)\W*') | ||
echo -e "$PR_NUM by $AUTHOR: $PR_RELEASE_NOTE" >> Changes.md | ||
done < last-300-prs-with-release-note.txt |
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.
Can we move this to a bash script that we keep in-tree - example under /hack
?
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.
Presumably ... just to be clear, what is motivating your ask here?
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.
Doing some research on how to do it, it seems perhaps that putting the shell script in the .github
folder or .github/actions
folder might be more "approved" or "best practice".
From some github dev forums:
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.
+1 on externalizing this into a script.
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.
ok @adambkaplan @qu1queee I've moved the logic to a script file, following the github actions guidance from https://gh.neting.ccmunity/t/running-a-bash-script/141584
/refresh |
let's see if I have to close/reopen this to refresh the e2e list after #614 merged |
/retest |
/skip |
/close |
@gabemontero: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@gabemontero: Reopened this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
yep closing / reopening was needed to clear out the new defunct tests |
ok all green e2e's ... thanks @SaschaSchwarze0 now circling back to pulling new changes into a separate shell script @adambkaplan @qu1queee my first thought is to update the new script to deal with PR kind labels in a separate PR, once the use of the prow plugin has merged and there a couple of PRs with both release notes and kind labels to test with |
e52cd4f
to
3b099b2
Compare
ok @adambkaplan @qu1queee e2e's are green and new logic broken out into a script file let the opinions on how to write bash commence :-) |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gabemontero The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
final nits
@@ -0,0 +1,52 @@ | |||
# this script assumes the GITHUB_TOKEN and PREVIOUS_TAG environment variables have been 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.
Needs a shebang?
# this script assumes the GITHUB_TOKEN and PREVIOUS_TAG environment variables have been set; | |
#! /bin/sh | |
# this script assumes the GITHUB_TOKEN and PREVIOUS_TAG environment variables have been 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.
updated / squashed / pushed @adambkaplan
git log --pretty=format:"%h - %s - %an" ${{ github.event.inputs.tags }}..HEAD | grep -v "Merge pull" >> Changes.md | ||
echo -e "## Features\n\n## Fixes\n\n## Backwards incompatible changes\n\n## Docs\n\n## Misc\n\n## Thanks" >> Changes.md - name: Draft Release | ||
# might not be necessary but make sure | ||
chmod +x "${GITHUB_WORKSPACE}/.github/draft_release_notes.sh" |
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 may want to ensure that the checked-in bash script has +x permissions. I believe git preserves those.
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.
gmontero ~/go/src/github.com/shipwright-io/build (release-note-2)$ ls -la .github/draft_release_notes.sh
-rwxrwxr-x. 1 gmontero gmontero 3127 Feb 24 12:36 .github/draft_release_notes.sh
gmontero ~/go/src/github.com/shipwright-io/build (release-note-2)$
3b099b2
to
d7409dd
Compare
updates pushed @adambkaplan I'll update the PR on whether tests are green if you are waiting on that for lgtm |
@gabemontero let me check this today, not sure why you approve your own pr, I find this strange. EDIT: I delegated this to Matthias. |
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.
Thanks for the release notes automation. This is awesome. I am looking forward to it. Pretty sure this is help enormously. I ran shellcheck
against the file and highlighted some of the issues. Nothing blocking, I think. The only thing I would like to look into is the seemingly trailing extra text.
d7409dd
to
34705d1
Compare
pushed an update with the changes @HeavyWombat recommended - thanks !! explanations in the comment threads for changes that were not pulled in |
…bels to automate release note generation
34705d1
to
fe5916c
Compare
/lgtm |
Changes
The first stage in automating release notes.
As I indicated in the mailing list and slack, if we force use of the kind label in our PRs, I can make a subsequent PR to this that will sort release notes by kind
This borrows from upstream tekton, but translates from being encapsulated by github actions to tekton tasks, as well as makes a few other simplifications given the "simpler nature" of our project.
/assign @adambkaplan
/assign @qu1queee
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes