diff --git a/.ci/changelog-upstream-update.sh b/.ci/changelog-upstream-update.sh deleted file mode 100755 index 8f4a6f23e..000000000 --- a/.ci/changelog-upstream-update.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -# this script creates and pushes a changelog entry for the upstream otel dependencies. -# it relies on the following environment variables: -# PR_TITLE: pull-request title (used in the changelog title) -# PR_URL: pull-request URL (used in the changelog entry to link to the PR) -# PR_NUMBER: pull-request number (used to name the changelog entry file) - -docs-builder changelog add \ - --concise \ - --title "${PR_TITLE}" \ - --type enhancement \ - --prs "${PR_URL}" \ - --products "edot-java" \ - -# will overwrite any prior update, if there is any -mv -v "./docs/changelog/${PR_NUMBER}.yaml" "./docs/changelog/upstream-update.yaml" - -if [[ -z "$(git status --porcelain)" ]]; then - echo "No changes to commit" -else - git add --all . - git commit -m "generate changelog entry" - git push -fi diff --git a/.github/workflows/changelog-init.yml b/.github/workflows/changelog-init.yml deleted file mode 100644 index 399a961ad..000000000 --- a/.github/workflows/changelog-init.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: changelog-init - -on: - pull_request: - types: - - opened - - synchronize - - reopened - - edited - - labeled - - unlabeled - -permissions: {} - -concurrency: - group: changelog-init-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - - # with upstream update PRs: - # - we want to automatically generate changelog - # - we do this only for update PRs which are not on a fork and have the expected label - # - we need to do this before the "validate" job, which should pass and make changelog-submit to be skipped (as the changelog already exists) - # this is because changelog-submit is triggered by workflow_run and otherwise we can't control ordering. - upstream-update: - permissions: - contents: write - pull-requests: write - if: > - contains(github.event.pull_request.labels.*.name, 'changelog:upstream-update') - && github.event.pull_request.head.repo.fork == false - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - - name: Git setup - uses: elastic/oblt-actions/git/setup@v1 - - name: Docs builder setup - uses: elastic/docs-actions/docs-builder/setup@v1 - - - name: Generate changelog entry - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - PR_TITLE: ${{ github.event.pull_request.title }} - PR_URL: ${{ github.event.pull_request.html_url }} - run: .ci/changelog-upstream-update.sh - - validate: - # needs to execute even if init-upstream-update is skipped - if: ${{ always() }} - # needs to execute after init-upstream-update - needs: [ upstream-update ] - permissions: - contents: read # reusable workflow checks out the repo to read docs/changelog.yml - uses: elastic/docs-actions/.github/workflows/changelog-validate.yml@v1 diff --git a/.github/workflows/changelog-submit.yml b/.github/workflows/changelog-submit.yml deleted file mode 100644 index ad824dd3f..000000000 --- a/.github/workflows/changelog-submit.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: changelog-submit - -on: - workflow_run: - workflows: [changelog-init] - types: - - completed - -permissions: {} - -jobs: - submit: - permissions: - contents: write # commit the generated changelog file to the PR branch - pull-requests: write # post the changelog comment on the PR - id-token: write # OIDC token for the org-membership check on fork PRs - packages: read # pull the docs-builder edge image from GHCR - uses: elastic/docs-actions/.github/workflows/changelog-submit.yml@v1 diff --git a/.github/workflows/changelog-upload.yml b/.github/workflows/changelog-upload.yml deleted file mode 100644 index 07d837a0f..000000000 --- a/.github/workflows/changelog-upload.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: changelog-upload - -on: - push: - branches: [main] - -permissions: {} - -jobs: - upload: - permissions: - contents: read # checkout the pushed commit - id-token: write # OIDC token for AWS authentication - pull-requests: read # look up merged PRs for the pushed commit so fork-PR entries can be regenerated - uses: elastic/docs-actions/.github/workflows/changelog-upload.yml@v1 diff --git a/.github/workflows/pre-post-release.yml b/.github/workflows/pre-post-release.yml index d1e8be2de..d4408c2bf 100644 --- a/.github/workflows/pre-post-release.yml +++ b/.github/workflows/pre-post-release.yml @@ -74,9 +74,6 @@ jobs: with: github-token: ${{ steps.get_token.outputs.token }} - - name: Docs builder setup - uses: elastic/docs-actions/docs-builder/setup@v1 - - name: Create the release tag (post phase) if: inputs.phase == 'post' run: | @@ -102,20 +99,6 @@ jobs: if: inputs.phase == 'post' run: bash ./.ci/release/post-release.sh - - name: Generate documentation changelog bundle (pre release) - if: inputs.phase == 'pre' - # we should use the 'edot-java-release' profile to generate the bundle: - # docs-builder changelog bundle edot-java-release ${{ env.RELEASE_VERSION }} - # this does not yet allow to provide the generated content for description, so we have to use the explicit arguments. - run: | - description="$(.ci/changelog-bundle-description.sh)" - docs-builder changelog bundle \ - --input-products 'edot-java * *' \ - --output-products 'edot-java ${{ env.RELEASE_VERSION }} ga' \ - --output docs/releases/${{ env.RELEASE_VERSION }}.yaml \ - --description "${description}" - docs-builder changelog remove edot-java-release ${{ env.RELEASE_VERSION }} - - name: Push the ${{ inputs.phase }} release branch run: | git add --all diff --git a/.github/workflows/release-notes-changelog-file.yml b/.github/workflows/release-notes-changelog-file.yml new file mode 100644 index 000000000..ef2bc5d3f --- /dev/null +++ b/.github/workflows/release-notes-changelog-file.yml @@ -0,0 +1,13 @@ +name: Changelog file +on: + workflow_run: + # Must match the `name:` field of the release-notes workflow in this repo. + workflows: ["release-notes"] + types: [completed] +permissions: {} +jobs: + changelog-file: + uses: elastic/docs-actions/.github/workflows/release-notes-changelog-file.yml@v1 + permissions: + pull-requests: write + actions: read diff --git a/.github/workflows/release-notes-comments.yml b/.github/workflows/release-notes-comments.yml new file mode 100644 index 000000000..25e9f33df --- /dev/null +++ b/.github/workflows/release-notes-comments.yml @@ -0,0 +1,19 @@ +name: Changelog PR comments +on: + workflow_run: + # Must match the `name:` field of the release-notes workflow in this repo. + workflows: ["release-notes"] + types: [completed] +permissions: {} +# The PR number is stable; do not cancel — two upstreams can complete close +# together and cancelling mid-upsert risks leaving the wrong comment body. +concurrency: + group: changelog-comments-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }} + cancel-in-progress: false +jobs: + comment: + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion != 'cancelled' + uses: elastic/docs-actions/.github/workflows/release-notes-comments.yml@v1 + permissions: + pull-requests: write + actions: read diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 000000000..8c361a541 --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -0,0 +1,14 @@ +name: release-notes +on: + pull_request: + types: [opened, synchronize, reopened, edited, labeled, unlabeled] + push: + branches: [main] +permissions: {} +jobs: + release-notes: + permissions: + contents: read + pull-requests: read + packages: read + uses: elastic/docs-actions/.github/workflows/release-notes.yml@v1 diff --git a/.github/workflows/release-step-3.yml b/.github/workflows/release-step-3.yml index 40c00e1a0..37a21cda0 100644 --- a/.github/workflows/release-step-3.yml +++ b/.github/workflows/release-step-3.yml @@ -262,3 +262,47 @@ jobs: --verify-tag \ --title="Release ${{ env.RELEASE_VERSION }}" \ --notes='${{needs.generate-release-notes.outputs.notes}}' + + bundle: + name: "Generate changelog bundle" + needs: create-github-release + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + pull-requests: read + outputs: + bundle-path: ${{ steps.create.outputs.bundle-path }} + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ inputs.ref }} + persist-credentials: false + - name: Generate bundle description + id: description + run: echo "text=$(.ci/changelog-bundle-description.sh)" >> "$GITHUB_OUTPUT" + - name: Create bundle + id: create + uses: elastic/docs-actions/changelog/bundle-create-version@v1 + with: + version: ${{ env.RELEASE_VERSION_TAG }} + description: ${{ steps.description.outputs.text }} + github-token: ${{ github.token }} + + bundle-publish: + name: "Publish changelog bundle to S3" + needs: bundle + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + packages: read + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ inputs.ref }} + persist-credentials: false + - name: Publish bundle to S3 + uses: elastic/docs-actions/changelog/bundle-publish@v1 + with: + bundle-path: ${{ needs.bundle.outputs.bundle-path }} diff --git a/docs/docset.yml b/docs/docset.yml index 6197bb764..722939f1d 100644 --- a/docs/docset.yml +++ b/docs/docset.yml @@ -9,6 +9,8 @@ cross_links: toc: - toc: release-notes - toc: reference/edot-java +release_notes: + - product: edot-java subs: motlp: Elastic Cloud Managed OTLP Endpoint edot: Elastic Distribution of OpenTelemetry @@ -23,4 +25,4 @@ subs: stack: "Elastic Stack" es: "Elasticsearch" kib: "Kibana" - ls: "Logstash" \ No newline at end of file + ls: "Logstash" diff --git a/docs/release-notes/breaking-changes.md b/docs/release-notes/breaking-changes.md index b696fe2dd..36c3941bc 100644 --- a/docs/release-notes/breaking-changes.md +++ b/docs/release-notes/breaking-changes.md @@ -15,6 +15,6 @@ products: Breaking changes can impact your applications, potentially disrupting normal operations and their monitoring. Before you upgrade, carefully review the Elastic Distribution of OpenTelemetry Java breaking changes and take the necessary steps to mitigate any issues. -:::{changelog} /releases/ +:::{changelog} edot-java :type: breaking-change ::: diff --git a/docs/release-notes/deprecations.md b/docs/release-notes/deprecations.md index 00724da75..ee9ef7c81 100644 --- a/docs/release-notes/deprecations.md +++ b/docs/release-notes/deprecations.md @@ -17,6 +17,6 @@ Over time, certain Elastic functionality becomes outdated and is replaced or rem Review the deprecated functionality for Elastic Distribution of OpenTelemetry Java. While deprecations have no immediate impact, we strongly encourage you update your implementation after you upgrade. To learn how to upgrade, check out [Upgrade](docs-content://deploy-manage/upgrade.md). -:::{changelog} /releases/ +:::{changelog} edot-java :type: deprecation ::: diff --git a/docs/release-notes/index.md b/docs/release-notes/index.md index 711e27751..2da6c52d5 100644 --- a/docs/release-notes/index.md +++ b/docs/release-notes/index.md @@ -17,7 +17,7 @@ Review the changes, fixes, and more in each version of Elastic Distribution of O To check for security updates, go to [Security announcements for the Elastic stack](https://discuss.elastic.co/c/announcements/security-announcements/31). -:::{changelog} /releases/ +:::{changelog} edot-java :type: all :release-dates: ::: diff --git a/docs/release-notes/known-issues.md b/docs/release-notes/known-issues.md index a4ad7e338..d17908191 100644 --- a/docs/release-notes/known-issues.md +++ b/docs/release-notes/known-issues.md @@ -13,6 +13,6 @@ products: # Elastic Distribution of OpenTelemetry Java known issues -:::{changelog} /releases/ +:::{changelog} edot-java :type: known-issue :::