From 0bb100a2b8049a95a7b4c3bea812b695ce266597 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Mon, 8 Sep 2025 18:34:03 -0700 Subject: [PATCH 01/12] initial CHANGELOG implementation --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..d1532cd11c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +> **Note:** This CHANGELOG was created starting after version 2.11.4. Earlier changes are not documented here. + +## Unreleased From 965b758a6037779abb5e88917e83e7d804542dbe Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Tue, 9 Sep 2025 18:32:26 -0700 Subject: [PATCH 02/12] add PR build check for changelog --- .github/workflows/pr-build.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 389d6140cd..af130d91e8 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -8,6 +8,37 @@ env: TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test-v2 jobs: + changelog-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check CHANGELOG + run: | + # Check if PR is from bot + if [[ "${{ github.event.pull_request.user.login }}" == "aws-application-signals-bot" ]]; then + echo "Skipping: PR from aws-application-signals-bot" + exit 0 + fi + + # Check for Skip Changelog label + if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "Skip Changelog"; then + echo "Skip Changelog label found - check passed" + exit 0 + fi + + # Fetch base branch and check for CHANGELOG modifications + git fetch origin ${{ github.base_ref }} + if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -q "CHANGELOG.md"; then + echo "CHANGELOG.md entry found - check passed" + exit 0 + fi + + echo "It looks like you didn't add an entry to CHANGELOG.md. If this change affects the SDK behavior, please update CHANGELOG.md and link this PR in your entry. If this PR does not need a CHANGELOG entry, you can add the 'Skip Changelog' label to this PR." + exit 1 + testpatch: name: Test patches applied to dependencies runs-on: aws-otel-java-instrumentation_ubuntu-latest_32-core From 20609176af969b9f1756837d6e3e9b7bc23f2793 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Tue, 9 Sep 2025 18:32:45 -0700 Subject: [PATCH 03/12] update CHANGELOG in pre-release workflow --- .github/workflows/pre-release-prepare.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pre-release-prepare.yml b/.github/workflows/pre-release-prepare.yml index 9e4c634467..359390ef1d 100644 --- a/.github/workflows/pre-release-prepare.yml +++ b/.github/workflows/pre-release-prepare.yml @@ -94,6 +94,15 @@ jobs: git commit -am "Update version to ${VERSION}" git push origin "v${VERSION}_release" + - name: Update CHANGELOG for release + if: github.event.inputs.is_patch != 'true' + run: | + # Replace "## Unreleased" with "## ${VERSION} - $(date +%Y-%m-%d)" for new releases + sed -i "s/## Unreleased/## ${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md + git add CHANGELOG.md + git commit -m "Update CHANGELOG for version ${VERSION}" + git push origin "v${VERSION}_release" + - name: Create pull request against the release branch env: GITHUB_TOKEN: ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }} From 6e3d810a7511dff4916bee1e1e774c20410d5d0c Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sat, 13 Sep 2025 17:23:50 -0700 Subject: [PATCH 04/12] add instructions to CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1532cd11c..009a8a4ab8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,10 @@ All notable changes to this project will be documented in this file. > **Note:** This CHANGELOG was created starting after version 2.11.4. Earlier changes are not documented here. +For any change that affects end users of this package, please add an entry under the **Unreleased** section. Briefly summarize the change and provide the link to the PR. Example: +- add SigV4 authentication for HTTP exporter + ([#1019](https://github.com/aws-observability/aws-otel-java-instrumentation/pull/1019)) + +If your change does not need a CHANGELOG entry, add the "skip changelog" label to your PR. + ## Unreleased From 26a7f6cf493e452d33c57d6f383d5214ef4fa425 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sat, 13 Sep 2025 17:25:11 -0700 Subject: [PATCH 05/12] fix changelog update --- .github/workflows/pre-release-prepare.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-release-prepare.yml b/.github/workflows/pre-release-prepare.yml index 359390ef1d..5e35e353a3 100644 --- a/.github/workflows/pre-release-prepare.yml +++ b/.github/workflows/pre-release-prepare.yml @@ -98,7 +98,7 @@ jobs: if: github.event.inputs.is_patch != 'true' run: | # Replace "## Unreleased" with "## ${VERSION} - $(date +%Y-%m-%d)" for new releases - sed -i "s/## Unreleased/## ${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md + sed -i "s/## Unreleased/## Unreleased\n\n## v${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md git add CHANGELOG.md git commit -m "Update CHANGELOG for version ${VERSION}" git push origin "v${VERSION}_release" From 88f9b27bddf9790551df7dd08886f857ba3c8656 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sat, 13 Sep 2025 17:26:05 -0700 Subject: [PATCH 06/12] modify check in PR build --- .github/workflows/pr-build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index af130d91e8..8d3484ab54 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -17,15 +17,20 @@ jobs: - name: Check CHANGELOG run: | - # Check if PR is from bot + # Check if PR is from workflows bot or dependabot if [[ "${{ github.event.pull_request.user.login }}" == "aws-application-signals-bot" ]]; then - echo "Skipping: PR from aws-application-signals-bot" + echo "Skipping check: PR from aws-application-signals-bot" + exit 0 + fi + + if [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then + echo "Skipping check: PR from dependabot" exit 0 fi # Check for Skip Changelog label - if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "Skip Changelog"; then - echo "Skip Changelog label found - check passed" + if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "skip changelog"; then + echo "Skipping check: Skip Changelog label found" exit 0 fi From 6457a95f61e6013da2cd89b2c1e6475d52b88886 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sat, 13 Sep 2025 17:31:05 -0700 Subject: [PATCH 07/12] update post release workflow --- .github/workflows/post-release-version-bump.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/post-release-version-bump.yml b/.github/workflows/post-release-version-bump.yml index 7f619bbbe9..9ca8e470fd 100644 --- a/.github/workflows/post-release-version-bump.yml +++ b/.github/workflows/post-release-version-bump.yml @@ -6,6 +6,10 @@ on: version: description: 'Version number (e.g., 1.0.1)' required: true + is_patch: + description: 'Is this a patch? (true or false)' + required: true + default: 'false' env: AWS_DEFAULT_REGION: us-east-1 @@ -100,8 +104,19 @@ jobs: sed -i'' -e "s/val adotVersion = \".*\"/val adotVersion = \"${DEV_VERSION}\"/" version.gradle.kts VERSION="${{ github.event.inputs.version }}" sed -i'' -e 's/adot-autoinstrumentation-java:v2.*"/adot-autoinstrumentation-java:v'$VERSION'"/' .github/workflows/daily-scan.yml + + # for patch releases, avoid merge conflict by manually resolving CHANGELOG with main + if [[ "${{ github.event.inputs.is_patch }}" == "true" ]]; then + git fetch origin main + git show origin/main:CHANGELOG.md | sed -n '/## Unreleased/,/^## v[0-9]/p' | sed '$d' | tail -n +2 | sed '/^$/d' > /tmp/unreleased_content.txt + + # Insert the content right after the existing "## Unreleased" header + sed -i '/## Unreleased/r /tmp/unreleased_content.txt' CHANGELOG.md + fi + git add version.gradle.kts git add .github/workflows/daily-scan.yml + git add CHANGELOG.md git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION" git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}" From adceb393384424f872acc3a20d159f6696988154 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sat, 13 Sep 2025 17:32:16 -0700 Subject: [PATCH 08/12] fix lint issue --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 009a8a4ab8..5b90c1e12f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. > **Note:** This CHANGELOG was created starting after version 2.11.4. Earlier changes are not documented here. For any change that affects end users of this package, please add an entry under the **Unreleased** section. Briefly summarize the change and provide the link to the PR. Example: + - add SigV4 authentication for HTTP exporter ([#1019](https://github.com/aws-observability/aws-otel-java-instrumentation/pull/1019)) From 145f6093a3a6d67414b1acc3938366cfdef414b4 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sat, 13 Sep 2025 17:45:50 -0700 Subject: [PATCH 09/12] delete comment --- .github/workflows/pre-release-prepare.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pre-release-prepare.yml b/.github/workflows/pre-release-prepare.yml index 5e35e353a3..3459ef288d 100644 --- a/.github/workflows/pre-release-prepare.yml +++ b/.github/workflows/pre-release-prepare.yml @@ -97,7 +97,6 @@ jobs: - name: Update CHANGELOG for release if: github.event.inputs.is_patch != 'true' run: | - # Replace "## Unreleased" with "## ${VERSION} - $(date +%Y-%m-%d)" for new releases sed -i "s/## Unreleased/## Unreleased\n\n## v${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md git add CHANGELOG.md git commit -m "Update CHANGELOG for version ${VERSION}" From 57b8e44aa1ed1085960f101aab307f085322b1aa Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Tue, 16 Sep 2025 15:22:39 -0700 Subject: [PATCH 10/12] minor fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b90c1e12f..4732100a6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -> **Note:** This CHANGELOG was created starting after version 2.11.4. Earlier changes are not documented here. +> **Note:** This CHANGELOG was created starting after version 2.11.5. Earlier changes are not documented here. For any change that affects end users of this package, please add an entry under the **Unreleased** section. Briefly summarize the change and provide the link to the PR. Example: From b9617c9a606f984d1da9abf6c9f8c0e18bf60589 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Tue, 16 Sep 2025 15:28:52 -0700 Subject: [PATCH 11/12] minor pr build fixes --- .github/workflows/pr-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 8d3484ab54..d3d716bc85 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,6 +1,12 @@ name: PR Build on: pull_request: + types: + - opened + - reopened + - synchronize + - labeled + - unlabeled branches: - main - "release/v*" @@ -28,9 +34,9 @@ jobs: exit 0 fi - # Check for Skip Changelog label + # Check for skip changelog label if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "skip changelog"; then - echo "Skipping check: Skip Changelog label found" + echo "Skipping check: skip changelog label found" exit 0 fi From 6369bc5cf2bc197be4e3d8ceaf99c2ea5ab6a61e Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Tue, 16 Sep 2025 15:30:31 -0700 Subject: [PATCH 12/12] fix post-release workflow updates to CHANGELOG --- .../workflows/post-release-version-bump.yml | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/post-release-version-bump.yml b/.github/workflows/post-release-version-bump.yml index 9ca8e470fd..6413b86d14 100644 --- a/.github/workflows/post-release-version-bump.yml +++ b/.github/workflows/post-release-version-bump.yml @@ -106,12 +106,13 @@ jobs: sed -i'' -e 's/adot-autoinstrumentation-java:v2.*"/adot-autoinstrumentation-java:v'$VERSION'"/' .github/workflows/daily-scan.yml # for patch releases, avoid merge conflict by manually resolving CHANGELOG with main - if [[ "${{ github.event.inputs.is_patch }}" == "true" ]]; then + if [[ "${{ github.event.inputs.is_patch }}" == "true" ]]; then + # Copy the patch release entries + sed -n "/^## v${VERSION}/,/^## v[0-9]/p" CHANGELOG.md | sed '$d' > /tmp/patch_release_section.txt git fetch origin main - git show origin/main:CHANGELOG.md | sed -n '/## Unreleased/,/^## v[0-9]/p' | sed '$d' | tail -n +2 | sed '/^$/d' > /tmp/unreleased_content.txt - - # Insert the content right after the existing "## Unreleased" header - sed -i '/## Unreleased/r /tmp/unreleased_content.txt' CHANGELOG.md + git show origin/main:CHANGELOG.md > CHANGELOG.md + # Insert the patch release entries after Unreleased + awk -i inplace '/^## v[0-9]/ && !inserted { system("cat /tmp/patch_release_section.txt"); inserted=1 } {print}' CHANGELOG.md fi git add version.gradle.kts @@ -132,4 +133,14 @@ jobs: By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \ --head prepare-main-for-next-dev-cycle-${VERSION} \ - --base main \ No newline at end of file + --base main + + - name: Force our CHANGELOG to override merge conflicts + run: | + git merge origin/main || true + git checkout --ours CHANGELOG.md + git add CHANGELOG.md + if ! git diff --quiet --cached; then + git commit -m "Force our CHANGELOG to override merge conflicts" + git push origin "prepare-main-for-next-dev-cycle-${VERSION}" + fi \ No newline at end of file