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

[RFC] release: use GitHub's gh to create GitHub release #18649

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

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

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ivanvc
Once this PR has been reviewed and has the lgtm label, please assign serathius for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

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

@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.82%. Comparing base (c86c93c) to head (b9263b1).
Report is 2 commits behind head on main.

Current head b9263b1 differs from pull request most recent head b682e1b

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

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

Additional details and impacted files

see 23 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #18649      +/-   ##
==========================================
+ Coverage   68.77%   68.82%   +0.05%     
==========================================
  Files         420      420              
  Lines       35535    35535              
==========================================
+ Hits        24438    24456      +18     
+ Misses       9668     9649      -19     
- Partials     1429     1430       +1     

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 c86c93c...b682e1b. 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
local gh_version
gh_version=$(gh --version | head -n1 | awk 'match($0,/([0-9]+\.){2}[0-9]+/) {print substr($0,RSTART,RLENGTH)}')
if [ "$(cut -d. -f1 <(echo "${gh_version}"))" -lt "2" ] || [ "$(cut -d. -f2 <(echo "${gh_version}"))" -lt "57" ]; then
log_error "The minimum version required for gh is 2.57.0, got ${gh_version}"
Copy link
Member

Choose a reason for hiding this comment

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

Curious - Why do we have a dependency on this version? Is it purely from a standpoint of what we have tested?

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 was having issues with gh auth status's exit code (the exit code was 0 even when it failed). I swear I saw a pull request/a release note for this behavior in 2.57.0 (which is also the latest version). But I just tested again with multiple versions and went back all the way to 2.37.0, and it works as expected.

So, I'm fine removing this check.

log_error "The minimum version required for gh is 2.57.0, got ${gh_version}"
exit 1
fi
if [ "${DRY_RUN}" != "true" ] && ! gh auth status &>/dev/null; then
Copy link
Member

Choose a reason for hiding this comment

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

Should we validate gh auth status irrespective of DRY_RUN? If I was using DRY_RUN=true I would still want to know that I had a problem with gh.

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 avoided the check because it would fail when running on the CI. One option would be to add a new execution flag (i.e., --no-github-release) so we can set that in the release test and still keep it green. WDYT?

maybe_run gh release create "${RELEASE_VERSION}" \
--repo "${gh_repo}" \
--draft \
--prerelease \
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 want to be marking as pre-release? I think this would depend on which branch we were creating a release for? I.e. if we were publishing an alpha/rc for 3.6.0 vs publishing a patch release for 3.5 or 3.4.

Copy link
Member Author

Choose a reason for hiding this comment

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

For main, it should be --prerelease, for release-3.5, it should be --latest and for release-3.4, it should not have an additional option.

I'm open to documenting it or adding a branch check. Let me know your thoughts.

docker exec etcd-gcr-${ETCD_VER}/usr/local/bin/etcdctl endpoint health
docker exec etcd-gcr-${ETCD_VER}/usr/local/bin/etcdctl put foo bar
docker exec etcd-gcr-${ETCD_VER}/usr/local/bin/etcdctl get foo
```
Copy link
Member

Choose a reason for hiding this comment

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

Here is the markdown for a recent release if you wanted to diff it:
release.txt

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, it looks the same. I guess, maybe it would be a good idea to update the second paragraph (at least in the two latest release [3.5.16 and 3.4.34]) to the following (to address the broken links):

For installation guides, please check out [play.etcd.io](http://play.etcd.io) and [operating etcd](https://etcd.io/docs/v3.6/op-guide). Latest support status for common architectures and operating systems can be found at [supported platforms](https://github.com/etcd-io/website/blob/main/content/en/docs/v3.5/op-guide/supported-platform.md).

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.

4 participants