Files
orca/config/scripts/ci/e2e-failures/ci-e2e-failure-tracking.mjs
Neil 9bd6272fdf refactor(tooling): organize build, CI, and test owners (#38130)
* refactor(tooling): organize test runtime and maintenance owners

* test(tooling): preserve relocated runtime fixture dependency edges

* refactor(tooling): preserve xterm routing owner checks

* ci(tooling): include routing owner in sparse checkout

* test(tooling): preserve copied workflow dependency closures

* fix(tooling): normalize hashed JSON assets in release parity

* fix(tooling): distinguish asset aliases from literal references

* fix(tooling): frame normalized asset reference payloads

* fix(tooling): normalize decoded JSON asset references

* refactor(tooling): organize build, CI and release owners

* fix(tooling): align moved generator and workflow path contracts

* fix(tooling): update generated plugin bundle owner banners

* test(tooling): create relocated mobile verifier fixture directories

* test(tooling): copy headless detector dependency closure

* test(tooling): align native batch policy fixtures with owner path

* fix(tooling): link moved reliability command to historical evidence

* fix(tooling): preserve nested sandbox owners and canonical guide source

* fix(tooling): target release version owners in checkout fixture
2026-11-04 21:08:19 -08:00

43 lines
1.4 KiB
JavaScript

export function trackE2eFailures(failures, records, now = new Date()) {
const known = []
const untracked = []
const invalid = []
const active = (Array.isArray(records) ? records : [records]).filter((record) => {
if (!record || typeof record !== 'object' || Array.isArray(record)) {
invalid.push(record)
return false
}
const expiry = new Date(`${record.expires}T23:59:59Z`)
const valid =
typeof record.file === 'string' &&
typeof record.title === 'string' &&
typeof record.message === 'string' &&
record.message.length > 0 &&
/^@[\w-]+(?:\/[\w-]+)?$/.test(record.owner ?? '') &&
/^https:\/\/github\.com\/stablyai\/orca\/issues\/\d+$/.test(record.issue ?? '') &&
/^\d{4}-\d{2}-\d{2}$/.test(record.expires ?? '') &&
Number.isFinite(expiry.getTime()) &&
expiry.toISOString().slice(0, 10) === record.expires &&
expiry.getTime() >= now.getTime()
if (!valid) {
invalid.push(record)
}
return valid
})
for (const failure of failures) {
const record = active.find(
(entry) =>
entry.file === failure.file &&
entry.title === failure.title &&
entry.project === failure.project &&
failure.message.includes(entry.message)
)
if (record) {
known.push({ ...failure, tracking: record })
} else {
untracked.push(failure)
}
}
return { known, untracked, invalid }
}