Move synthetics into assembler-preview job, remove standalone synthetics job - #3952
Merged
Conversation
Mpdreamz
force-pushed
the
feat/synthetics-preview
branch
from
August 27, 2026 14:59
f51caf7 to
41021c2
Compare
The synthetics CI job was cloning ~30 repos and running a full assembler build on a 2-core ubuntu-latest runner, taking 20+ minutes and routinely failing on git-fetch timeouts before the tests even ran. The assembler-preview job already builds and deploys the assembled site to S3 for every same-repo PR. Poll its GitHub deployment status until it reports success, then point the synthetics journeys at that URL instead of a local server. Fork PRs skip the job because they have no assembler-preview deployment to wait for. Adds DOCS_ENV=preview to synthetics.config.ts (reads DOCS_PREVIEW_BASE_URL, which the CI step sets from the deployment's environment_url). The journeys append /docs and sub-paths to baseUrl as before, which resolves correctly against the preview path prefix. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Journeys were navigating to ${baseUrl}/docs which resolves to
.../docs/3952/docs — a path that doesn't exist in the assembled
preview output (content is served directly at the path prefix root).
Introduce params.docsRoot in synthetics.config.ts: for local/prod/
staging/edge it equals baseUrl + '/docs'; for preview it equals the
assembler-preview environment_url directly (no /docs suffix). Journeys
and accessibility audit now navigate relative to docsRoot so the same
test code works across all environments.
Also add a wait-on step before the synthetics run to let CloudFront
propagate the S3 upload before journey tests fire.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ermission
Use shell variable expansion ($ASSEMBLER_PREVIEW_PATH_PREFIX) instead
of GitHub Actions template expansion (${{ env.* }}) in the run: step
to avoid zizmor's template-injection finding. The job-level env var is
already available in the shell environment.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Mpdreamz
force-pushed
the
feat/synthetics-preview
branch
from
August 27, 2026 15:39
560c666 to
1eb28c3
Compare
Use https-get:// instead of plain https:// so wait-on performs an HTTP GET check (which follows redirects) rather than a TCP socket check, which fails on HTTPS endpoints. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
wait-on treats non-2xx as failure; CloudFront returns a 301 redirect at the root path which wait-on interprets as not ready. curl -L follows redirects and considers the final 2xx a success. 18 attempts × 10 s = up to 3 min wait, matching CloudFront's typical invalidation propagation time. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ew environment - `synthetics:test:preview` now runs only navigation-test and api-explorer journeys (excludes mcp-server which requires a live backend not deployed for PR previews) - Drop hardcoded `/docs` prefix from `href$=` selector and URL regexes in navigation-test.journey.ts: preview URLs include the full path prefix (`/elastic/docs-builder/docs/<pr>/reference/elasticsearch`) so selectors ending in `/docs/reference/elasticsearch` never matched Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ad test The injected anchor used the hardcoded href '/docs/api/', which in preview resolves to the domain root + /docs/api/ — not the assembler preview path. Pass docsRoot into page.evaluate so the href and waitForRequest predicate both use the environment-correct URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reakaleek
approved these changes
Aug 27, 2026
| working-directory: src/Elastic.Documentation.Site | ||
| run: npm ci | ||
|
|
||
| - name: Wait for preview to be live |
Member
There was a problem hiding this comment.
nit: we could use https://www.npmjs.com/package/wait-on for this. With npx wait-on ...
Member
Author
There was a problem hiding this comment.
I used that at first, the original did too but for some reason it kept timing out.
Member
Author
|
@copilot please fix the merge conflicts in this pull request. |
Co-authored-by: Mpdreamz <245275+Mpdreamz@users.noreply.github.com>
Contributor
Resolved by merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
syntheticsjob inci.ymlbuilt the entire assembled site from scratch on a 2-coreubuntu-latest— cloning ~30 repos, running the assembler, serving locally — before running journey tests against it. This took 20+ minutes and was the most frequent source of CI flakiness (git fetch timeouts, shallow lock collisions).The
assembler-previewjob already builds and deploys the full assembled site to a CloudFront-backed S3 bucket on every PR. Running synthetics against that deployed URL costs nothing extra and gives the same signal without a redundant clone.What
syntheticsjob removed fromci.yml.assembler-preview.ymlafter the S3 upload, against the known preview URL (https://docs-v3-preview.elastic.dev/${ASSEMBLER_PREVIEW_PATH_PREFIX}). No polling, no waiting — the URL is already live at that point in the job.synthetics.config.tsgains apreviewcase;synthetics:test:previewconvenience script added topackage.jsonfor local use against a preview URL.