-
Notifications
You must be signed in to change notification settings - Fork 526
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(release-minor): add apm-
prefix and create release diff between patches
#13065
Merged
v1v
merged 6 commits into
elastic:main
from
v1v:feature/update-docs-automation-for-releases
May 7, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
463ee6b
ci(release): update heading creation and compare with semver
v1v d2eabe8
revert
v1v 4656d7f
support for diff between patches
v1v 55d1fbf
use a different approach
v1v 1bd70a3
Merge branch 'main' into feature/update-docs-automation-for-releases
v1v 9f3ffbc
Merge branch 'main' into feature/update-docs-automation-for-releases
v1v File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ PROJECT_PATCH_VERSION ?= $(shell echo $(RELEASE_VERSION) | cut -f3 -d.) | |
PROJECT_OWNER ?= elastic | ||
RELEASE_TYPE ?= minor | ||
|
||
CURRENT_RELEASE ?= $(shell gh api repos/elastic/apm-server/releases/latest | jq -r '.tag_name|sub("v"; ""; "")') | ||
CURRENT_RELEASE ?= $(shell gh release list --exclude-drafts --exclude-pre-releases --limit 10 --json tagName --jq '.[].tagName|select(. | startswith("v$(PROJECT_MAJOR_VERSION)"))' | sed 's|v||g' | sort -r | head -n 1) | ||
RELEASE_BRANCH ?= $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) | ||
NEXT_PROJECT_MINOR_VERSION ?= $(PROJECT_MAJOR_VERSION).$(shell expr $(PROJECT_MINOR_VERSION) + 1).0 | ||
NEXT_RELEASE ?= $(RELEASE_BRANCH).$(shell expr $(PROJECT_PATCH_VERSION) + 1) | ||
|
@@ -79,6 +79,20 @@ https://github.com/elastic/apm-server/compare/$(RELEASE_BRANCH)\...main[View com | |
==== Added | ||
endef | ||
|
||
## Changelog template for new minors | ||
define CHANGELOG_MINOR_TMPL | ||
[[apm-release-notes-$(RELEASE_BRANCH)]] | ||
== APM version $(RELEASE_BRANCH) | ||
* <<apm-release-notes-$(RELEASE_BRANCH).0>> | ||
|
||
[float] | ||
[[apm-release-notes-$(RELEASE_BRANCH).0]] | ||
=== APM version $(RELEASE_BRANCH).0 | ||
|
||
https://github.com/elastic/apm-server/compare/v$(CURRENT_RELEASE)\...v$(RELEASE_BRANCH).0[View commits] | ||
|
||
endef | ||
|
||
####################### | ||
## Public make goals | ||
####################### | ||
|
@@ -140,8 +154,8 @@ rename-changelog: | |
$(MAKE) common-changelog | ||
@echo ">> rename-changelog" | ||
echo "$$CHANGELOG_TMPL" > changelogs/head.asciidoc | ||
@if ! grep -q 'release-notes-$(VERSION)' CHANGELOG.asciidoc ; then \ | ||
awk "NR==2{print \"* <<release-notes-$(VERSION)>>\"}1" CHANGELOG.asciidoc > CHANGELOG.asciidoc.new; \ | ||
@if ! grep -q 'apm-release-notes-$(VERSION)' CHANGELOG.asciidoc ; then \ | ||
awk "NR==2{print \"* <<apm-release-notes-$(VERSION)>>\"}1" CHANGELOG.asciidoc > CHANGELOG.asciidoc.new; \ | ||
mv CHANGELOG.asciidoc.new CHANGELOG.asciidoc ; \ | ||
fi | ||
@if ! grep -q '$(VERSION).asciidoc' CHANGELOG.asciidoc ; then \ | ||
|
@@ -157,16 +171,13 @@ update-changelog: | |
$(SED) 's#head#$(VERSION)#g' CHANGELOG.asciidoc | ||
|
||
# Common changelog file steps | ||
# TODO: changelogs/$(VERSION).asciidoc requires further manipulation to remove empty entries. | ||
.PHONY: common-changelog | ||
export CHANGELOG_MINOR_TMPL | ||
common-changelog: VERSION=$${VERSION} | ||
common-changelog: | ||
@echo ">> common-changelog" | ||
mv changelogs/head.asciidoc changelogs/$(VERSION).asciidoc | ||
$(SED) 's#head#$(VERSION)#gI' changelogs/$(VERSION).asciidoc | ||
$(SED) -E -e 's#(\...)main#\1$(VERSION)#g' changelogs/$(VERSION).asciidoc | ||
awk "NR==5{print \"\n* <<release-notes-$(VERSION).0>>\n\n[float]\n[[release-notes-$(VERSION).0]]\n=== APM version $(VERSION).0\"}1" changelogs/$(VERSION).asciidoc > changelogs/$(VERSION).asciidoc.new | ||
mv changelogs/$(VERSION).asciidoc.new changelogs/$(VERSION).asciidoc | ||
echo "$$CHANGELOG_MINOR_TMPL" > changelogs/$(VERSION).asciidoc | ||
tail -n +6 changelogs/head.asciidoc >> changelogs/$(VERSION).asciidoc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as long as |
||
|
||
## Update the references on .mergify.yml with the new minor release. | ||
.PHONY: update-mergify | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 cannot use
latest
as long as latest can point to7.17
. I've already reported to the release team (Only accessible by Elastic employees)I decided to use a different approach and filter by the major version and do some manipulation