-
Notifications
You must be signed in to change notification settings - Fork 3.3k
add update-submodule script #1419
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
add update-submodule script #1419
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: roycaihw 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 |
devel/submodules.md
Outdated
``` | ||
|
||
Once updated, you should create a new PR to commit changes to the repository. | ||
Create a commit "generated python-base update" and send a PR to the main 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.
it's not obvious what is 'main' repo, better to just use 'this 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.
done
scripts/update-submodule.sh
Outdated
# | ||
# Create a commit "generated python-base update" and send a PR to the main repo. | ||
# NOTE: not all python-base changes are user-facing, and you may want to remove | ||
# some of the non-user-facing release notes from CHANGELOG.md. |
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.
is there a release-note label in PR similar to k/k? then it's the matter of automatically collecting all those notes w/o any non user-facing notes
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 to use a release-note label. I'm going to add PR template to python-base and see if we can enable release-note-required
in these repos.
|
||
# TODO(roycaihw): make the script send a PR by default (standalone mode), and | ||
# have an option to make the script reusable by other release automations. | ||
TARGET_RELEASE=${TARGET_RELEASE:-"v$(grep "^CLIENT_VERSION = \"" scripts/constants.py | sed "s/CLIENT_VERSION = \"//g" | sed "s/\"//g")"} |
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.
so TARGET_RELEASE is an env var that can be set when running the script, better put it in the Usage: section above to make it clear.
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.
done
scripts/update-submodule.sh
Outdated
curl -o "/tmp/${pull}.patch" -sSL "${pull_url}.patch" | ||
subject=$(grep -m 1 "^Subject" "/tmp/${pull}.patch" | sed -e 's/Subject: \[PATCH//g' | sed 's/.*] //') | ||
pull_uid="$submodule_repo#${pull}" | ||
release_note="- ${subject} [${pull_uid}](${pull_url})\n" |
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.
again, release note is from subject here, better to have a release note section in PR
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.
done
scripts/update-submodule.sh
Outdated
echo -e $release_notes | ||
|
||
# update changelog | ||
sed -i "${line_to_edit}i${release_notes}" CHANGELOG.md |
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.
there are 'breaking change', 'bug fix', 'new feature' etc sections in each release note section, looks that this script does not handle that.
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.
the script now uses https://github.com/kubernetes/release/tree/master/cmd/release-notes, which collects release notes from the PR description (will update PR template) and categories the release notes based on PR labels, e.g. kind/bug
scripts/update-submodule.sh
Outdated
# Usage: | ||
# scripts/update-submodule.sh | ||
# | ||
# Create a commit "generated python-base update" and send a PR to the main 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.
i don't see it creates a commit for Release notes, and also it does not send a PR, does it?
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.
it doesn't. I added a TODO and made the comment clear that the user needs to manually create the commit and PR.
copied from k/k. We should add the same template to python-base
/lgtm |
/hold |
The robot merged the PR first :( /shrug |
I'm working on adding scripts to automate the release process. This one updates python-base submodule and collects the release notes.
Example output in master branch:
/cc @yliaog