docs(adr-002): align Preflight entity design with Ekrem alignment decisions#2459
Closed
GeezerPelletier wants to merge 41 commits into
Closed
docs(adr-002): align Preflight entity design with Ekrem alignment decisions#2459GeezerPelletier wants to merge 41 commits into
GeezerPelletier wants to merge 41 commits into
Conversation
Captures the decision to replace /preflight/jobs and /preflight/beta/jobs with site-scoped endpoints under /sites/:siteId/preflights. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AsyncJob has no siteId index; GET /sites/:siteId/preflights requires either extending AsyncJob or a new Preflight entity in shared-data-access. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eId index AsyncJob TTL (~7 days) makes a purpose-built Preflight entity unnecessary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Existing job creation paths must not be affected; new endpoints populate siteId at creation time and query by it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Capture IMS caller identity server-side at job creation for audit purposes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sponse Per RFC 7231 §6.3.3 the created resource URL belongs in the Location response header, not a custom body field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add error response table to POST endpoint (400/403/404/500) - Disabled-site case returns 403 immediately; no job record created - Previous CANCELLED-job behavior on disabled preflight is explicitly removed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both /preflight/beta/jobs and /preflight/jobs are deprecated and run in parallel with the new endpoints until consumers migrate and a deletion milestone is agreed upon. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Confirmed by Ben: identify/suggest are no longer separate steps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dev-only override, not part of the public contract. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both fields available on IMS profile at no extra cost. Easier to extend in future without breaking API contract. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevents callers submitting a url belonging to a different site than the :siteId in the path. Returns PREFLIGHT_INVALID_REQUEST if mismatch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Id response Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…moved Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…iteId Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…resultType - Flatten GET list response from URL-grouped to flat array sorted by createdAt desc - Add optional ?url= query parameter to filter list by specific page URL server-side - Remove 50-record cap; 7-day AsyncJob TTL is the natural bound, pagination deferred - Rename createdBy.id -> createdBy.email throughout (consistent with profile field name) - Note that createdBy is stored in async job metadata at creation time - Remove resultType and resultLocation from GET by ID response; preflight results are always stored inline in async_jobs.result, never in S3 - Clarify result field: always inline, null until job completes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ght entity Rewrites the Data Model section of ADR-002 to introduce a first-class Preflight entity in spacecat-shared-data-access rather than extending the generic AsyncJob model. AsyncJob is shared by preflight, preflight-beta, site-detection, and pr-review — using it as the preflight store forces type discrimination via metadata blobs with no schema enforcement. References SITES-44650 for the spacecat-shared-data-access alignment work with @ekremney. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yncJob A dedicated Preflight table scopes every row to preflight by definition. Querying AsyncJob by siteId would require a compound (site_id, job_type) filter or composite index to isolate preflight records from the other workflows sharing the table. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The /preflight/beta/jobs endpoint was a temporary internal development path, never intended as a durable design. Calling it out as an anti-pattern is noise — it was always going away. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The /preflight/beta/jobs endpoints were an internal development path with no external consumers. This redesign is their replacement — they are removed outright, not deprecated. Only /preflight/jobs carries a deprecation timeline since it has external consumers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ions - Add asyncJobId FK field (1-to-1 with AsyncJob) to entity schema - Document controller creation flow: AsyncJob first, then Preflight with asyncJobId - Remove (indexed) annotation from url field; composite index deferred - Replace open alignment question with confirmed decisions from SITES-44675 - Clarify TTL: TTL column at 7 days, verify column name in mysticat-data-service Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…oved not deprecated Only /preflight/jobs is the legacy endpoint that continues in parallel. /preflight/beta/jobs is replaced outright by the new endpoints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This PR will trigger no release when merged. |
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.
Summary
Updates ADR-002 to reflect decisions from the SITES-44675 alignment session with @ekdogan. The ADR was previously marked as pending that alignment — this PR closes it out.
Four changes to the Data Model section:
asyncJobIdfield added to the entity schema — makes the 1-to-1 FK relationship toAsyncJobexplicit; field is never exposed to API consumersAsyncJobfirst, receivesasyncJobId, then createsPreflightwith that FK; ordering ensures the execution primitive exists before the domain record that references iturlindex annotation removed —(indexed)onurlwas inconsistent with the collection method already specifying in-memory filtering; composite(site_id, url)index is explicitly deferred (7-day TTL bounds per-site volume to a manageable size)Related
Generated with Claude Code