Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .ci/scripts/generate-test-plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,22 @@ MAJOR="${BASH_REMATCH[1]}"
MINOR="${BASH_REMATCH[2]}"
PATCH="${BASH_REMATCH[3]}"

BRANCH="${MAJOR}.${MINOR}"

if (( PATCH == 0 )); then
echo "Error: Cannot infer previous tag for x.y.0 releases. Patch version must be >= 1"
exit 1
if (( MINOR == 0 )); then
echo "Error: Cannot infer previous tag for x.0.0 releases"
exit 1
fi
PREVIOUS_MINOR=$((MINOR - 1))
PREVIOUS_TAG=$(git tag -l "v${MAJOR}.${PREVIOUS_MINOR}.*" | sort -V | tail -1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure if the base tag detection logic is 100% correct. And at the very least it should not depend on when the generate test plan script is run. It is not a simple question though, under the existing 2 active minors model - how do you decide if a change should show up in minor changelog, e.g. 9.4.0?

  • Obviously, if a change is merged to 9.4 (either before or after FF) but not 9.3, it should be in 9.4.0 changelog
  • But what if a bugfix is merged and due to be released in both 9.3.x and 9.4.0?

if [[ -z "${PREVIOUS_TAG}" ]]; then
echo "Error: Could not find any tags for v${MAJOR}.${PREVIOUS_MINOR}.*"
exit 1
fi
else
PREVIOUS_TAG="v${MAJOR}.${MINOR}.$((PATCH - 1))"
fi

BRANCH="${MAJOR}.${MINOR}"
PREVIOUS_TAG="v${MAJOR}.${MINOR}.$((PATCH - 1))"
OUTPUT_FILE="build/test-plan-${VERSION}.md"
REPO_CACHE_DIR="build/test-plan-repos"

Expand All @@ -35,8 +44,13 @@ if ! git rev-parse "${PREVIOUS_TAG}" >/dev/null 2>&1; then
fi

if ! git rev-parse "origin/${BRANCH}" >/dev/null 2>&1; then
echo "Error: Release branch origin/${BRANCH} does not exist in this repository"
exit 1
if (( PATCH == 0 )) && git rev-parse "origin/main" >/dev/null 2>&1; then
echo "Release branch origin/${BRANCH} not found, falling back to origin/main"
BRANCH="main"
else
echo "Error: Release branch origin/${BRANCH} does not exist in this repository"
exit 1
fi
fi

echo "Upcoming release: v${VERSION}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: create-test-plan-patch
name: create-test-plan

on:
workflow_dispatch:
inputs:
upcoming_release:
description: 'Upcoming release version (e.g., 9.2.6)'
description: 'Upcoming release version (e.g., 9.2.6 for patch, 9.2.0 for minor)'
required: true
type: string

Expand Down
2 changes: 1 addition & 1 deletion dev_docs/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Before merging them compare commits between latest minor and the new major versi
Create a GitHub Issue to track testing of the release branch.

Choose one way to create the initial issue:
- **Option 1 (recommended):** Run the [`create-test-plan-patch`](https://github.com/elastic/apm-server/actions/workflows/create-test-plan-patch.yml) workflow with the upcoming version, then review and adjust the generated issue content.
- **Option 1 (recommended):** Run the [`create-test-plan`](https://github.com/elastic/apm-server/actions/workflows/create-test-plan.yml) workflow with the upcoming version, then review and adjust the generated issue content.
- **Option 2:** Create it manually using the [test plan issue template](https://github.com/elastic/apm-server/issues/new?assignees=&labels=test-plan&projects=&template=test-plan.md).

The issue should include:
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/RELEASES_8x.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Run the `run-patch-release` with any `8.19.x` version.

Create a GitHub issue for testing the release branch.
Choose one way to create the initial issue:
* **Option 1 (recommended):** Run the [`create-test-plan-patch`](https://github.com/elastic/apm-server/actions/workflows/create-test-plan-patch.yml) workflow with the upcoming version, then review and adjust the generated issue content.
* **Option 1 (recommended):** Run the [`create-test-plan`](https://github.com/elastic/apm-server/actions/workflows/create-test-plan.yml) workflow with the upcoming version, then review and adjust the generated issue content.
* **Option 2:** Create it manually using the [test plan issue template](https://github.com/elastic/apm-server/issues/new?assignees=&labels=test-plan&projects=&template=test-plan.md).
The issue should contain:
* A link to all PRs in the APM Server repository that need to be tested manually to create an overview over the PRs that need testing.
Expand Down
Loading