[Pipelines] Port full Atlantis pipeline runtime (Phase 1)#2
Open
kdhillon wants to merge 1 commit into
Open
Conversation
…hase 1) Ports the complete pipeline runtime — PipelineService, OperationService, PipelineTimingService, all 39 operation executors, the ~26 transitively required services, serializers, the Redis op-cache, DB-backed persistence, the BullMQ worker, and the contract/timing/caching test suite — into the standalone pipelines repo. Phase 1 runs against the SHARED Atlantis Postgres + S3. Strict guardrails prevent any destructive/DDL change to the shared DB: - railway.toml start command no longer runs db:migrate (drizzle migrations exist only to stand up the local docker test DB) - cleanupDatabase refuses to TRUNCATE unless DATABASE_URL points at a local *_test database - root db:migrate script removed; db:generate retargeted to @atlantis/db Auth replaces Auth0/JWT with a trusted-identity prehandler that reads x-atlantis-user-id / x-atlantis-api-key-id forwarded by the Atlantis facade, plus an M2M shared secret (x-pipelines-internal-key). Auth fails closed in server/worker/production environments (PIPELINES_INTERNAL_API_KEY required), and the secret comparison is timing-safe. lint, build, and 141 tests across 15 files pass against the local docker DB. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Ports the full Atlantis pipeline runtime into the standalone
pipelinesrepo (Phase 1). In this phase the service runs against the SHARED Atlantis Postgres + S3; no data migration and no Atlantis-side changes are included.What was ported:
PipelineService(DB-backed),OperationService,PipelineTimingService, serializers, and the Redis operation cache@atlantis/db(schema mirrors the real Atlantis tables + query/jsonb extensions + pg client),atlantis-types,@atlantis/splice-api;@atlantis/corealiased to the published@splice/atlantis-core/api/v1/pipeline-runsand/api/v1/pipeline-operationsroutes (contract preserved)Guardrails (no destructive changes to the shared Atlantis DB)
railway.tomlstart command no longer runsdb:migrate— drizzle migrations exist only to stand up the local docker test DBcleanupDatabaserefuses toTRUNCATEunlessDATABASE_URLpoints at a localhost*_testdatabase (NODE_ENV alone is insufficient since vitest sets it automatically)db:migratescript removed;db:generateretargeted to@atlantis/dbAuth
Replaces Auth0/JWT with a trusted-identity prehandler reading
x-atlantis-user-id/x-atlantis-api-key-idforwarded by the Atlantis facade, plus an M2M shared secret (x-pipelines-internal-key). Auth fails closed in server/worker/production (PIPELINES_INTERNAL_API_KEYrequired at boot), and the secret comparison is timing-safe. Ownership/authorization enforced viahasAccessToRun/project.hasAccess.Local Test Results
pnpm lint✅ ·pnpm build✅pnpm test:local✅ — 141 tests / 15 files pass against the local docker Postgres+Redis (external integrations mocked, mirroring Atlantis)AI Reviews
3-panel review (DB-safety/Guardrails, Security/Bootstrap, Test-harness/Config):
cleanupDatabasecouldTRUNCATEthe shared DB whenDATABASE_URLwas misconfigured — now hard-gated to a localhost*_testtargetPIPELINES_INTERNAL_API_KEYwas unset — now fails closed at boot in server/worker/productionstart()/startWorkers()exit non-zero on startup failure; removed duplicate worker SIGINT/SIGTERM handlers; added API/healthroute for Railway; fixed rootdb:migrate/db:generatefootgun; dropped unusedioredis-mockdevDepswithApiKeyScopesscopes arg, nativedb.delete/db.updateescape hatch (verbatim from Atlantis)Out of scope (future phases)
Atlantis facade cutover, the phase-2 DB split (pg_dump/copy data migration, sequence resets, dropping cross-DB FKs) and the
project_idownership inversion.Made with Cursor