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

release: use GitHub's gh to create GitHub release #18649

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

ivanvc
Copy link
Member

@ivanvc ivanvc commented Sep 27, 2024

Implements #18604.

While we verify that this works as expected, it will create the release as a draft. Then, we can verify that it looks correct and manually publish them.

I tested this feature in my fork. Refer to the latest release (and its assets).

I introduced a scripts/release_notes.tpl.txt. Because I don't have access to edit a previous release and copy the Markdown, I manually crafted the Markdown based on what I saw and improved how we reference the version for the Docker instructions. But, because it was manual, I may have an error.

While working on importing the release notes, I realized that we had been copy-pasting the release text with a broken link.

For installation guides, please check out play.etcd.io and operating etcd. Latest support status for common architectures and operating systems can be found at supported platforms.

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ivanvc
Copy link
Member Author

ivanvc commented Sep 27, 2024

@ahrtr, @jmhbnz, @serathius, PTAL :)

@ivanvc ivanvc force-pushed the use-gh-to-publish-releases branch 3 times, most recently from c498282 to 9ea3c41 Compare September 27, 2024 23:13
@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.77%. Comparing base (5e238a0) to head (e0314f0).
Report is 8 commits behind head on main.

Current head e0314f0 differs from pull request most recent head 88d2d24

Please upload reports for the commit 88d2d24 to get more accurate results.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
Files with missing lines Coverage Δ
client/v3/maintenance.go 58.55% <ø> (ø)
client/v3/retry_interceptor.go 65.61% <ø> (ø)
client/v3/watch.go 93.83% <ø> (ø)
etcdctl/ctlv3/command/printer_json.go 0.00% <ø> (ø)
etcdctl/ctlv3/command/watch_command.go 44.08% <ø> (ø)
pkg/adt/interval_tree.go 88.72% <ø> (ø)
pkg/netutil/routes_linux.go 44.62% <ø> (ø)
server/auth/store.go 83.79% <ø> (ø)
server/etcdserver/api/membership/storev2.go 45.19% <ø> (ø)
server/etcdserver/api/v2stats/queue.go 28.20% <ø> (ø)
... and 5 more

... and 20 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #18649      +/-   ##
==========================================
- Coverage   68.80%   68.77%   -0.04%     
==========================================
  Files         420      420              
  Lines       35494    35494              
==========================================
- Hits        24423    24411      -12     
- Misses       9646     9661      +15     
+ Partials     1425     1422       -3     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e238a0...88d2d24. Read the comment docs.

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

Great work @ivanvc - A few questions but this is an awesome start.

Documentation/contributor-guide/release.md Outdated Show resolved Hide resolved
scripts/release.sh Outdated Show resolved Hide resolved
scripts/release.sh Outdated Show resolved Hide resolved
scripts/release.sh Outdated Show resolved Hide resolved
scripts/release_notes.tpl.txt Show resolved Hide resolved
@@ -0,0 +1,91 @@
Please check out [CHANGELOG](https://github.com/etcd-io/etcd/blob/main/CHANGELOG/CHANGELOG-3.5.md) for a full list of changes. And make sure to read [upgrade guide](https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/upgrades/upgrade_3_6.md) before upgrading etcd (there may be breaking changes).
Copy link
Member

Choose a reason for hiding this comment

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

Note; we wanted to simplify the release notes. #15185

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with that issue/improvement, but I'd like to avoid scope creeping this pull request and implementing it by only creating the release with gh. I think it would be a good idea to create an umbrella issue for the improvements we want to make to the release process. I'll note this and create it when I close some of the tasks I currently have open.

Copy link
Member

Choose a reason for hiding this comment

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

We can do it separately. This PR only focuses on automating the creating github release.

Should we create separate templates for each release (including 3.5.x, 3.4.x and 3.6.x)? @ivanvc Since this PR is for the main branch, we can resolve it in followup PR if you want.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good point. I didn't realize that it has mixed links from 3.5 and 3.6 in the release notes. I'll work on it in this PR.

@ivanvc ivanvc force-pushed the use-gh-to-publish-releases branch 2 times, most recently from 2926962 to f44983c Compare October 8, 2024 21:49
@k8s-ci-robot k8s-ci-robot added the github_actions Pull requests that update GitHub Actions code label Oct 8, 2024
@ivanvc ivanvc requested a review from jmhbnz October 8, 2024 23:33
@ivanvc ivanvc marked this pull request as ready for review October 8, 2024 23:33
@henrybear327
Copy link
Contributor

/retest

scripts/release.sh Outdated Show resolved Hide resolved
@ivanvc ivanvc force-pushed the use-gh-to-publish-releases branch 2 times, most recently from fb3f41d to 17929b7 Compare October 10, 2024 22:40
@ivanvc
Copy link
Member Author

ivanvc commented Oct 10, 2024

I updated the script. It's a bit difficult to test it out locally. We could bring more improvements later on.

A sample release is the following: https://github.com/ivanvc/etcd/releases/tag/untagged-1dc492de524109e605b4

@ivanvc ivanvc requested a review from ahrtr October 10, 2024 22:42
@ivanvc
Copy link
Member Author

ivanvc commented Oct 11, 2024

/retest

scripts/release.sh Show resolved Hide resolved
scripts/release.sh Outdated Show resolved Hide resolved
scripts/release.sh Outdated Show resolved Hide resolved
@ivanvc ivanvc requested a review from ahrtr October 11, 2024 20:26
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @ivanvc for improving the release work. Nice work!

@ahrtr
Copy link
Member

ahrtr commented Oct 11, 2024

/retest

@ivanvc ivanvc changed the title [RFC] release: use GitHub's gh to create GitHub release release: use GitHub's gh to create GitHub release Oct 12, 2024
@ivanvc ivanvc requested a review from serathius October 12, 2024 04:22
@ivanvc
Copy link
Member Author

ivanvc commented Oct 12, 2024

/test pull-etcd-integration-1-cpu-amd64

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks for your effort on this @ivanvc!

# should be left without any additional mark (therefore, it doesn't need a special argument).
if [ "${BRANCH}" = "main" ]; then
gh_release_args=(--prerelease)
elif [ "${BRANCH}" = "release-3.5" ]; then
Copy link
Member

@serathius serathius Oct 24, 2024

Choose a reason for hiding this comment

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

What happens when we release 3.6, and this will not updated? Maybe we should assert that branch name and fail that if new branch is cut we need to update which is the latest?

fi

if [ "${REPOSITORY}" = "$(pwd)" ]; then
gh_repo=$(git remote get-url origin)
Copy link
Member

Choose a reason for hiding this comment

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

This assumes that people cloned etcd main repo. If they cloned fork the origin would point to it. Is there any reason we cannot just skip it?

fi

gh_repo=$(echo "${gh_repo}" | sed 's/^[^@]\+@//' | sed 's/https\?:\/\///' | sed 's/\.git$//' | tr ':' '/')
log_callout "Creating GitHub release for ${RELEASE_VERSION} on ${gh_repo}"
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want to support pushing to other repositories?

Copy link
Member Author

Choose a reason for hiding this comment

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

Re: this comment and #18649 (comment). I understand that we may want to drop supporting other repositories to simplify the process. However, the only reason I'd like to keep it, is that it's the only way to test locally without doing a release in etcd-io's repository (i.e., https://github.com/ivanvc/etcd/releases).

WDYT @jmhbnz, @ahrtr?

Copy link
Member

@jmhbnz jmhbnz Oct 24, 2024

Choose a reason for hiding this comment

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

I like the ability to test in forks, let's keep it imo.

Copy link
Member

Choose a reason for hiding this comment

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

I like the ability to test in forks, let's keep it imo.

+1

Also it's just creating a draft release, and isn't published yet. It needs the release person to manually publish it.

Copy link
Member

@serathius serathius left a comment

Choose a reason for hiding this comment

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

Couple of nits

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, ivanvc, jmhbnz, serathius

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:
  • OWNERS [ahrtr,jmhbnz,serathius]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr ahrtr merged commit a594a62 into etcd-io:main Oct 25, 2024
33 checks passed
@ivanvc ivanvc deleted the use-gh-to-publish-releases branch October 25, 2024 15:09
@ivanvc ivanvc added backport/v3.4 backport/v3.5 github_actions Pull requests that update GitHub Actions code and removed github_actions Pull requests that update GitHub Actions code labels Oct 28, 2024
@ivanvc
Copy link
Member Author

ivanvc commented Nov 11, 2024

/cherrypick release-3.5

@k8s-infra-cherrypick-robot

@ivanvc: #18649 failed to apply on top of branch "release-3.5":

Applying: release: use GitHub's gh to create GitHub release
Using index info to reconstruct a base tree...
M	.github/workflows/release.yaml
A	Documentation/contributor-guide/release.md
M	scripts/release.sh
Falling back to patching base and 3-way merge...
Auto-merging scripts/release.sh
CONFLICT (modify/delete): Documentation/contributor-guide/release.md deleted in HEAD and modified in release: use GitHub's gh to create GitHub release. Version release: use GitHub's gh to create GitHub release of Documentation/contributor-guide/release.md left in tree.
Auto-merging .github/workflows/release.yaml
CONFLICT (content): Merge conflict in .github/workflows/release.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 release: use GitHub's gh to create GitHub release

In response to this:

/cherrypick release-3.5

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-sigs/prow repository.

ivanvc added a commit to ivanvc/etcd that referenced this pull request Nov 11, 2024
Backport pull request etcd-io#18649.

Signed-off-by: Ivan Valdes <[email protected]>
ivanvc added a commit to ivanvc/etcd that referenced this pull request Nov 11, 2024
Backport pull request etcd-io#18649.

Signed-off-by: Ivan Valdes <[email protected]>
ivanvc added a commit to ivanvc/etcd that referenced this pull request Nov 11, 2024
Backport pull request etcd-io#18649.

Signed-off-by: Ivan Valdes <[email protected]>
ivanvc added a commit to ivanvc/etcd that referenced this pull request Nov 12, 2024
Backport pull request etcd-io#18649.

Signed-off-by: Ivan Valdes <[email protected]>
ivanvc added a commit to ivanvc/etcd that referenced this pull request Nov 12, 2024
Backport pull request etcd-io#18649.

Signed-off-by: Ivan Valdes <[email protected]>
hswong3i pushed a commit to alvistack/etcd-io-etcd that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

8 participants