fix: pin the E2E backend SHA in the frontend contract
Frontend CI / unit (test, type-check, build) (push) Successful in 1m54s
Frontend CI / browser E2E (frontend + pinned backend) (push) Successful in 5m9s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-22 13:01:49 +03:30
co-authored by Cursor
parent e3f0457dc9
commit bb29cc6bdb
3 changed files with 12 additions and 8 deletions
+7 -5
View File
@@ -18,20 +18,22 @@ if (!existsSync(contractPath)) {
process.exit(1)
}
/** @type {{ repositoryUrl: string; checkoutPath: string; localRef?: string }} */
/** @type {{ repositoryUrl: string; checkoutPath: string; localRef?: string; pinnedRef?: string }} */
const contract = JSON.parse(readFileSync(contractPath, 'utf8'))
const envRef = process.env.E2E_BACKEND_REF?.trim()
let ref = envRef
if (isCi) {
if (!ref) {
if (isCi && !ref) {
ref = contract.pinnedRef?.trim()
if (!/^[0-9a-f]{40}$/i.test(ref ?? '')) {
console.error(
'E2E backend ref is required in CI. Set repository variable E2E_BACKEND_REF to a full commit SHA (or immutable tag). Silent fallback to main is disabled.',
'E2E backend ref is required in CI. Set E2E_BACKEND_REF or pinnedRef in e2e/backend.contract.json to a full commit SHA. Silent fallback to main is disabled.',
)
process.exit(1)
}
} else if (!ref) {
console.log('E2E_BACKEND_REF unset; using committed pinnedRef')
} else if (!isCi && !ref) {
ref = contract.localRef?.trim()
if (!ref) {
console.error(