Skip to content

Latest commit

 

History

History
103 lines (86 loc) · 8.43 KB

code-map.md

File metadata and controls

103 lines (86 loc) · 8.43 KB

Code map

Follow a request from admission to the executor and its durable checkpoints. AGENTS.md lists layer rules and sensitive paths.

Starting, queuing and restarting runs

Every run starts, resumes and restarts through one entry point. Nothing else constructs an executor.

File Owns
migrate/manager.ts Start, cancel, restart and administrator confirm-restart
migrate/runs/dispatch-guard.ts guardDispatch: the only path to an executor. Resolves the destination and refuses unsafe fresh starts
migrate/runs/queue.ts Shared queue: capacity, claims, GHES serialization, drain and launch
migrate/runs/recovery.ts Resuming recovered runs after startup
migrate/runs/startup-recovery.ts Startup recovery and its saved-destination checks: fails local interruptions, quarantines uncertain remote writes
migrate/runs/active.ts, finish.ts, retirement.ts Live run registry, settling a finished run, and shutdown or reload aborts that must not cancel remote work
migrate/runs/events.ts Run events and the event stream
migrate/database/remote-write-steps.ts Every pipeline step and GHES phase, classified as local, resumable export, or needs review
migrate/saved-destination.ts Every stored destination field, and the resolver that checks a run's destination before dispatch
migrate/runs/dispatch-guard.test.ts Enforces the single entry point and interruption cases for every supported route

Routes and executors

File Owns
source-provider.ts Which executor serves each source and target
migration-target.ts Target platforms and the notice for unverified routes
source/editions.ts Source editions (cloud and self-hosted) and URL matching
migrate/executors/registry.ts Maps executor IDs to run and resume functions
application/capabilities.ts Whether a route is configured and ready
application/migration-policy.ts Admission: request parsing, auth, credential scope
Route matrix What each route supports today and how well it is tested
Route Executor
GitHub → GHEC github-to-ghec.ts, with GHES archive exports in github/exports.ts
GitLab → GHEC gitlab-to-ghec.ts
Bitbucket Data Center → GHEC bitbucket-to-ghec.ts
Bitbucket Cloud → GHEC bitbucket-cloud-to-ghec.ts, archive built by source/bitbucket/cloud-archive.ts
GitLab → GHES gitlab-to-ghes.ts
Bitbucket Data Center → GHES bitbucket-to-ghes.ts
Bitbucket Cloud → GHES bitbucket-cloud-to-ghes.ts, using the shared Cloud archive builder

Shared GHEC import code

File Owns
executors/native-to-ghec.ts Source export, archive upload and import for GitLab and Bitbucket
executors/archive-to-ghec.ts Archive import and monitoring
github/migration-source.ts Creating the GHEC migration source and submitting the import
github/upload.ts Archive upload to GitHub-owned storage
github/monitor.ts Polling a submitted import

Shared GHES import code

File Owns
ghes/import.ts The checkpointed GHES import phases
ghes/job.ts GHES phase vocabulary
ghes/ssh.ts SSH and ghe-migrator on the appliance
ghes/mapping.ts User mapping and audit counts
exporters/worker.ts, docker.ts Exporter containers for GitLab and Bitbucket
core/ghes-target.ts GHES target connection and execution settings

Profiling and identity mapping

File Owns
application/adapters/source-providers.ts Provider adapters: the one place provider-specific rules live
source/gitlab/ GitLab client, pagination rules, discovery, profile metrics, archives
source/bitbucket/ Bitbucket Data Center and Cloud clients, discovery, archives
Profile drafts Builds mapping candidates from private scoped profile evidence
Mappings actions Approve decisions, discover GHES conflicts and apply mannequin reclaims
Inventory storage Public project inventory and private identity reads
core/http/ The shared HTTP core: paging, retries, Link headers, request options, exact form text
profile/ Profile runs, collection and analysis

Config, auth and errors

File Owns
core/config/index.ts Typed settings. The only reader of the environment (environment.ts)
core/config/catalog.ts Every setting's name, section and rule
core/targets.ts Target profiles and target clients
core/credential-scope.ts Which source a credential may reach
core/auth/ Users, sessions, passwords, authorization and the audit log
core/db.ts, retention.ts SQLite store lifecycle, validated row reads, and shared history retention
application/self-service/ Grants and what each user may see and run
core/known-failure.ts, safe-error.ts Named failure causes and safe user-facing messages

Transport and checks

File Owns
Request handler Session resolution, password-change requirement and operator route allowlist
Migration services Admission, batch commands, history and role-specific event responses
Profile services Profile queue, report views and operator repository selection
Server hook Wires dashboard startup, source runtime and operator job policy
Gate manifest Commands run by verification
Provider tests Offline route contracts and disposable provider harnesses
Cloud fixture guide Recording sanitized source responses