Skip to content

Commit f4f6eaa

Browse files
authored
Use the private bucket for uploads (#104)
1 parent 5202eb1 commit f4f6eaa

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

changelog/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Each PR produces a file at `docs/changelog/{filename}.yaml` on the PR branch (wh
181181

182182
## Uploading to S3
183183

184-
Changelog files on the default branch can be uploaded to the `elastic-docs-v3-changelog-bundles` S3 bucket under `{product}/changelogs/{filename}.yaml`, preserving the original filename as determined by the repository's `filename` strategy in `changelog.yml`. This makes them available for release bundling workflows.
184+
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}/changelogs/{filename}.yaml`.
185185

186186
### 1. Add the upload workflow
187187

@@ -218,17 +218,18 @@ jobs:
218218

219219
### 2. Enable OIDC access
220220

221-
The upload workflow authenticates to AWS via GitHub Actions OIDC. Your repository must be listed in the `elastic-docs-v3-changelog-bundles` infrastructure to have an IAM role provisioned. Contact the docs-engineering team to add your repository.
221+
The upload workflow authenticates to AWS via GitHub Actions OIDC. Your repository must be listed in the changelog bundles infrastructure to have an IAM role provisioned. Contact the docs-engineering team to add your repository.
222222

223223
### How it works
224224

225225
On each push to `main` or `master`, the upload workflow:
226226

227227
1. Checks out the pushed commit
228228
2. Sets up `docs-builder` and authenticates with AWS via OIDC
229-
3. Runs `docs-builder changelog upload`, which reads your `changelog.yml`, discovers changelog YAML files in the configured directory, and incrementally uploads them to `{product}/changelogs/{filename}.yaml` in the bucket — only files whose content has changed are transferred
229+
3. Runs `docs-builder changelog upload`, which reads your `changelog.yml`, discovers YAML files in the configured directory, and incrementally uploads them to the **private** S3 bucket — only files whose content has changed are transferred
230+
4. An SQS-triggered Lambda scrubs private repository references and writes sanitized copies to the **public** bucket behind CloudFront
230231

231-
If the changelog directory has no files (for example, because changelog generation was skipped), the command exits silently without error.
232+
If the directory has no files (for example, because changelog generation was skipped), the command exits silently without error.
232233

233234
The workflow uses a per-repository concurrency group so that rapid successive pushes queue rather than run in parallel. If a run is already in progress when a new push arrives, the in-progress run completes before the next one starts. Since `docs-builder` performs incremental uploads (skipping unchanged objects), re-runs are cheap.
234235

changelog/upload/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Generated by https://github.com/reakaleek/gh-action-readme -->
22
# <!--name-->Changelog upload<!--/name-->
33
<!--description-->
4-
Uploads changelog entries to the elastic-docs-v3-changelog-bundles S3 bucket using docs-builder's incremental upload. Intended to run on push to the default branch (main/master). Only files whose content has changed are transferred.
4+
Uploads changelog entries to the private S3 bucket (elastic-docs-v3-changelog-bundles-private) using docs-builder's incremental upload. A scrubber Lambda mirrors sanitized copies to the public CDN bucket. Intended to run on push to the default branch (main/master). Only files whose content has changed are transferred.
55
<!--/description-->
66

77
## Inputs

changelog/upload/action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Changelog upload
22
description: >
3-
Uploads changelog entries to the elastic-docs-v3-changelog-bundles S3 bucket
4-
using docs-builder's incremental upload. Intended to run on push to the default
5-
branch (main/master). Only files whose content has changed are transferred.
3+
Uploads changelog entries to the private S3 bucket
4+
(elastic-docs-v3-changelog-bundles-private) using docs-builder's incremental
5+
upload. A scrubber Lambda mirrors sanitized copies to the public CDN bucket.
6+
Intended to run on push to the default branch (main/master). Only files whose
7+
content has changed are transferred.
68
79
inputs:
810
config:
@@ -72,5 +74,5 @@ runs:
7274
docs-builder changelog upload \
7375
--artifact-type changelog \
7476
--target s3 \
75-
--s3-bucket-name elastic-docs-v3-changelog-bundles \
77+
--s3-bucket-name elastic-docs-v3-changelog-bundles-private \
7678
--config "$CONFIG"

0 commit comments

Comments
 (0)