diff --git a/changelog/README.md b/changelog/README.md index c88d08f..6823045 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -189,7 +189,7 @@ Each PR produces a file at `docs/changelog/{filename}.yaml` on the PR branch (wh ## Uploading to S3 -Changelog files on the default branch can be uploaded to S3. Files land in a **private bucket** (`elastic-docs-v3-changelog-bundles-private`), which is the internal source of truth. A scrubber Lambda automatically mirrors sanitized copies (with private repository references removed) to the **public bucket** served via CloudFront CDN. Changelogs are uploaded under `{product}/changelog/{filename}.yaml`. +Changelog files on the default branch can be uploaded to S3. Files land in a **private bucket** (`elastic-docs-v3-changelog-bundles-private`), which is the internal source of truth. A scrubber Lambda automatically mirrors sanitized copies (with private repository references removed) to the **public bucket** served via CloudFront CDN. Changelog entries are uploaded once per authoring repository under `changelog/{repo}/{filename}.yaml` (the repo is resolved from `--repo`, `bundle.repo` in `changelog.yml`, or the git remote origin). ### 1. Add the upload workflow @@ -270,7 +270,7 @@ Setting up bundling comes down to two choices: **how the bundle is delivered** a | Your goal | Workflow | What you get | | --- | --- | --- | -| Make the bundle available to docs rendering | [`changelog-bundle.yml`](#setup-1) | Uploads the bundle to S3 (`{product}/bundle/{file}`) | +| Make the bundle available to docs rendering | [`changelog-bundle.yml`](#setup-1) | Uploads the bundle to S3 (`bundle/{product}/{file}`) | | Commit the bundle into your repository | [`changelog-bundle-pr.yml`](#bundle-pr-workflow-opt-in) | Opens a PR with the scrubbed bundle fetched from the CDN | | Both | run `changelog-bundle.yml`, then `changelog-bundle-pr.yml` | Upload first, then open the PR | @@ -294,7 +294,7 @@ Each mode has a complete, copy-pasteable workflow file under [Setup](#setup-1). By default, the bundle command sources the individual changelog entries from the **public CDN**, scoped to the bundle's product(s), rather than from the local `bundle.directory`. This means a bundle reflects the same sanitized entries that have been published to S3, and a repository can produce a bundle without keeping every entry file checked out locally. -CDN sourcing requires a resolvable product (from a profile's `products`/`output_products`, or `--input-products`) so the per-product registry (`{product}/changelog/registry.json`) can be located. When no product can be resolved (e.g. an option-mode PR/issue-only filter), the command automatically falls back to local sourcing. +CDN sourcing locates each authoring repo's entry registry (`changelog/{repo}/registry.json`), resolved from `--repo`, `bundle.repo` in `changelog.yml`, or the git remote origin, to discover that repo's published entries. When the source repo can't be resolved (e.g. an option-mode PR/issue-only filter), the command automatically falls back to local sourcing. To always source entries from the local `bundle.directory` instead, set `use_local_changelogs: true` in the `bundle` section of your `docs/changelog.yml`. Passing an explicit `--directory`/`output` also forces local sourcing. @@ -467,7 +467,9 @@ If your changelog configuration is not at `docs/changelog.yml`, pass the path ex ### Output -The primary workflow (`changelog-bundle.yml`) uploads the bundle to the `elastic-docs-v3-changelog-bundles` S3 bucket under `{product}/bundle/{filename}`. The bundle is available to downstream rendering workflows immediately after upload. +The primary workflow (`changelog-bundle.yml`) uploads the bundle to the `elastic-docs-v3-changelog-bundles` S3 bucket under `bundle/{product}/{filename}`. The bundle is available to downstream rendering workflows immediately after upload. + +> **Note:** Bundles are keyed by product, so a shared product (e.g. `cloud-serverless`) bundled by more than one repository shares the `bundle/{product}/` prefix. To avoid one repo's bundle overwriting another's, give each bundle a repo-qualified filename such as `{repo}-{dateOrVersion}.yaml` (e.g. `my-repo-2026-03.yaml`). ### Bundle PR workflow (opt-in) diff --git a/changelog/bundle-fetch/README.md b/changelog/bundle-fetch/README.md index e2d9330..0e6950d 100644 --- a/changelog/bundle-fetch/README.md +++ b/changelog/bundle-fetch/README.md @@ -9,10 +9,12 @@ sanitized bundle that the `changelog-bundle` workflow previously uploaded to S3 Lambda mirrored to the public CDN), so the resulting PR carries the scrubbed copy rather than a raw, locally-generated one. Pair it with [`bundle-pr`](../bundle-pr) which opens the pull request. -Fetching from the CDN requires a resolvable product to scope the URL (`{base}/{product}/bundle/{file}`), +Fetching from the CDN requires a resolvable product to scope the URL (`{base}/bundle/{product}/{file}`), so use a profile with `products`/`output_products`. PR/issue-only option-mode bundles cannot be located on the CDN — use the [`changelog-bundle`](../README.md) workflow for those. +> **Note:** Bundles are keyed by product, so a shared product (e.g. `cloud-serverless`) is published by more than one repository under the same `bundle/{product}/` prefix. To avoid collisions, bundles should use a repo-qualified filename such as `{repo}-{dateOrVersion}.yaml` (e.g. `my-repo-2026-03.yaml`); fetch the specific file that matches the bundle you want. + ## Inputs | Name | Description | Required | Default | diff --git a/changelog/bundle-upload/README.md b/changelog/bundle-upload/README.md index ce0bee8..6444b6f 100644 --- a/changelog/bundle-upload/README.md +++ b/changelog/bundle-upload/README.md @@ -26,4 +26,6 @@ steps: output: docs/releases/v9.2.0.yaml ``` -This action is typically used as the second job in the `changelog-bundle.yml` reusable workflow, after `bundle-create` generates the artifact. The S3 key for each bundle is `{product}/bundle/{filename}`, where the product is read from the bundle's YAML `products` array. +This action is typically used as the second job in the `changelog-bundle.yml` reusable workflow, after `bundle-create` generates the artifact. The S3 key for each bundle is `bundle/{product}/{filename}`, where the product is read from the bundle's YAML `products` array. + +> **Note:** Bundles are keyed by product, so a shared product (e.g. `cloud-serverless`) published by more than one repository shares the `bundle/{product}/` prefix. To avoid collisions, give each bundle a repo-qualified filename such as `{repo}-{dateOrVersion}.yaml` (e.g. `my-repo-2026-03.yaml`). diff --git a/changelog/upload/action.yml b/changelog/upload/action.yml index b212a01..59d9957 100644 --- a/changelog/upload/action.yml +++ b/changelog/upload/action.yml @@ -131,9 +131,13 @@ runs: shell: bash env: CONFIG: ${{ inputs.config }} + REPO_NAME: ${{ github.event.repository.name }} + OWNER: ${{ github.repository_owner }} run: | docs-builder changelog upload \ --artifact-type changelog \ --target s3 \ --s3-bucket-name elastic-docs-v3-changelog-bundles-private \ - --config "$CONFIG" + --config "$CONFIG" \ + --repo "$REPO_NAME" \ + --owner "$OWNER"