monoscope/test/unit/System
Anthony Alaribe 5f23b39469 feat(code context): source repos are their own thing, not the config-sync repo
0123 hung a code mapping off `projects.github_sync`, which is
UNIQUE (project_id) and holds the ONE repo monoscope syncs its own
dashboard/monitor YAML with. A project's services live in as many repos
as they like, and that is a different question from where its config
lives — so the design made every repo but the config one unreachable, and
`fetchSnippet` refused any mapping that did not point at it.

Migration 0124 splits them:

  * `github_sync`        — one repo per project, monoscope's own YAML. Untouched.
  * `github_credentials` — many per project, one per GitHub account, holding
    the App installation. An installation already reaches every repo in that
    account, which is why auth belongs here and not on a per-repo row.
  * `code_mappings`      — now names owner/repo/ref itself, authorised by a
    credential. Adding the tenth service repo costs a mapping, not an
    integration.

Existing 0123 mappings are carried across: a credential is minted from the
sync row's grant and the coordinates copied onto the mapping. One that
cannot be reconstructed is dropped — it could only ever have rendered
"no longer linked" anyway.
History 2026-08-11 18:25:27 +02:00
..
ServerSpec.hs feat(code context): source repos are their own thing, not the config-sync repo 2026-08-11 18:25:27 +02:00