Skip to content

test(conftest): deployed_pr reads the frontend's X-Git-Sha header - #179

Merged
saqibmanan merged 1 commit into
CIfrom
test-deployed-pr-site-header
Oct 7, 2026
Merged

saqibmanan merged 1 commit into
CIfrom
test-deployed-pr-site-header

Conversation

@saqibmanan

Copy link
Copy Markdown
Contributor

Needs DataSpaceFrontend#496, which makes the frontend send X-Git-Sha: <commit it was built from>. It's safe to merge before that deploys: until then the gated tests skip with reports no deployed commit.

Why

deployed_pr(..., workflow=...) (#175, #177) inferred the live frontend commit from the GitHub workflow-runs API. During some windows of a minute or more, that endpoint returned a weeks-old run list, so after DataSpaceFrontend#493 deployed, its tests still skipped some of the time. The re-reads added in #177 couldn't outlast those windows.

Change

  • deployed_pr("Repo#N", site="HOME_URL_DEV") (or "HOME_URL_PROD") sends a HEAD request to that site and compares its X-Git-Sha with the PR's merge commit. This mirrors the backend's /health/ git_sha mode, which is unchanged.
  • Removed the workflow= and branch= options and the run-list lookup (net -14 lines).
  • test_api_006: the #493 dev tests use site="HOME_URL_DEV", and the #495 prod aimodels case uses site="HOME_URL_PROD".

The header reports the commit actually being served, so it also stays correct after an automatic rollback, which the run-list approach did not.

Verified

case result
live dev, #493 (no header yet) skip: reports no deployed commit
local next start built with GITHUB_SHA=f7da2839… (#495's merge commit), #493 / #495 deployed / deployed
same, #496 skip: not merged yet
HOME_URL_PROD unset skip: HOME_URL_PROD is not set
backend #215 on dev / prod deployed / runs abce96fa, which doesn't include 0fe942bc yet (unchanged)
test_api_006/013/014/018 vs dev + prod 24 passed, 3 skipped (the 3 frontend-gated tests, waiting on #496)

Replaces the workflow-runs lookup, which GitHub served from a weeks-old
snapshot for minutes at a time. The live site's own header is the commit
actually served, rollbacks included (DataSpaceFrontend#496).
@saqibmanan
saqibmanan merged commit 6aea00e into CI Oct 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant