Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/ci-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ This artifact defines the CI pipeline **for the settings-and-admin-ui feature**.
| Frontend job | `frontend` (lint non-blocking + strict build) | **Unchanged.** New TS under `ui/src/{pages/admin,components/admin,api,types}` compiles via the existing `tsc -b && vite build`. No new job. |
| E2E job | `e2e` (Playwright, **non-blocking** via `continue-on-error: true`) | **Delta — see §3.** The feature adds `admin.spec.ts`; the self-seeding gap that made E2E non-blocking is partially closeable for the admin spec. |
| Gate aggregate | `gate` job, blocking set = {backend, frontend, backend-full}; e2e informational | **Unchanged.** E2E stays informational in v1 (see §3 rationale). |
| Migration test | None at CI level (sibling's `migration_017` test runs in `backend-full`) | **Delta — see §4.** Migration 018 round-trip test must run in CI against a fresh schema, not just `backend-full`. |
| Deploy/rollback | `deploy.sh`, `rollback.sh` (recreate, smoke-gated, auto-rollback) | **Unchanged by this stage.** Stage 4.1 owns the CD delta. This artifact records the migration-018 rollback implication for 4.1 (§6). |
| Migration test | None at CI level (sibling's `migration_017` test runs in `backend-full`) | **Delta — see §4.** Migration 019 round-trip test must run in CI against a fresh schema, not just `backend-full`. |
| Deploy/rollback | `deploy.sh`, `rollback.sh` (recreate, smoke-gated, auto-rollback) | **Unchanged by this stage.** Stage 4.1 owns the CD delta. This artifact records the migration-019 rollback implication for 4.1 (§6). |

**Net effect on `ci.yml`: small.** The feature's code flows through the existing jobs automatically. The `ci.yml` edits this feature requires are: (a) widen vet scope (drop `internal/opencode`, keep `internal/repos`/`internal/settings`/`internal/config`), (b) add `internal/config` to the fast unit gate, (c) add a `-race` step on the concurrency-touching packages, and (d) extend the `e2e` job's spec set to include `admin.spec.ts` once it self-seeds. All reviewed below.

Expand All @@ -48,7 +48,7 @@ The 5-job structure from the sibling feature is retained. This feature's code is

| Job | Purpose | Gate command | Pinned toolchain | Service | Timeout | This feature's impact |
|-----|---------|--------------|------------------|---------|---------|-----------------------|
| `backend` | Build + vet + db/api/config unit + race | `go build ./...` → `go vet` (widened, §5) → `go test ./internal/db/... ./internal/api/... ./internal/config/... -count=1` → `go test -race ./internal/repos/... ./internal/config/... ./internal/settings/... -count=1` | Go 1.26.1 | postgres:16 | 10m | New `internal/db/migration_018*`, `internal/repos`, `internal/settings/*`, `internal/api/settings_handlers*`, `internal/api/auth_guard*`, `internal/config` write-path tests run here. Vet scope widened (§5); `internal/config` added to fast unit gate (§5.1); `-race` step added (§5.2). |
| `backend` | Build + vet + db/api/config unit + race | `go build ./...` → `go vet` (widened, §5) → `go test ./internal/db/... ./internal/api/... ./internal/config/... -count=1` → `go test -race ./internal/repos/... ./internal/config/... ./internal/settings/... -count=1` | Go 1.26.1 | postgres:16 | 10m | New `internal/db/migration_019*`, `internal/repos`, `internal/settings/*`, `internal/api/settings_handlers*`, `internal/api/auth_guard*`, `internal/config` write-path tests run here. Vet scope widened (§5); `internal/config` added to fast unit gate (§5.1); `-race` step added (§5.2). |
| `frontend` | Lint (non-blocking) + strict build | `npm run lint` → `npm run build` | Node 22.23 | — | 10m | New `ui/src/{pages/admin,components/admin,api,types}` compiles via `tsc -b`. No change. |
| `backend-full` | Full Go suite (release gate) | `go test ./... -count=1` | Go 1.26.1 | postgres:16 | 15m | Picks up the full new test set automatically. |
| `e2e` | Playwright smoke + non-regression | `npm run test:e2e` | Go 1.26.1 + Node 22.23 + chromium | postgres:16 | 20m | **Add `admin.spec.ts`** (§3). |
Expand Down Expand Up @@ -94,17 +94,17 @@ The sibling feature's `migration_017` (`repos_registry`) is tested via `internal

`discovered-rules` R-TEST-03 (BINDING GAP-RULE) is explicit: migration N must have a local round-trip test: empty DB → run migration N → tables exist → seed → verify schema, using a fresh test DB with no `schema_migrations` rows so the migration actually runs. The 2.2 baseline said "no CI"; the current baseline has CI, so the "no CI" half of R-TEST-03's rationale is stale — but the **"no migration test framework"** half is still true. The round-trip test is still the only pre-flight defense against a failed production migration (team-practices §6.3).

### 4.2 This feature's migration: 018
### 4.2 This feature's migration: 019

**Migration 017 is taken on `main`** (`repos_registry`, sibling feature). This feature's migration is **018** (the `unit-of-work` artifact references "017" because it was written before the sibling feature's migration landed; the developer at 3.6 renumbers to 018 to avoid collision, following the same precedent the sibling feature used when it renumbered from 013 to 017). The schema content is **thinned** per `bolt-plan` revision 2 / `test-results` revision 2: only `feature_defaults`, `server_config`, `audit_events.actor`, and `idx_audit_events_type_time` are added. **No `llm_*` tables, no `cicd_platforms` table** — those were removed by the Q7/Q8 scope cut.
**Migration 017 is taken on `main`** (`repos_registry`, sibling feature). This feature's migration is **019** (the `unit-of-work` artifact references "017" because it was written before the sibling feature's migration landed; the developer at 3.6 renumbers to 019 to avoid collision, following the same precedent the sibling feature used when it renumbered from 013 to 017). The schema content is **thinned** per `bolt-plan` revision 2 / `test-results` revision 2: only `feature_defaults`, `server_config`, `audit_events.actor`, and `idx_audit_events_type_time` are added. **No `llm_*` tables, no `cicd_platforms` table** — those were removed by the Q7/Q8 scope cut.

### 4.3 CI behavior for migration 018
### 4.3 CI behavior for migration 019

The migration round-trip tests (`internal/db/migration_018_test.go::TestMigration_RoundTrip`, `::TestMigration_AdditiveOnly`, `::TestMigration_ActorNullable`, `::TestMigration_NoReposTableAlteration`, `::TestMigration_Atomicity`, `::TestMigration_NumberIs018`, `::TestFeatureDefaults_ValidatorMinimal` — per `test-results` §2.1 T-MIG-01..07) run against a **fresh test DB with no `schema_migrations` rows**. In CI, the `backend` and `backend-full` jobs create the test DBs via the existing `for db in devteam_test_db ...` loop, but the test harness's `setupTestDB(t)` applies all registered migrations — which means migration 018 runs as part of `setupTestDB`, not as a fresh-DB test.
The migration round-trip tests (`internal/db/migration_019_test.go::TestMigration019_RoundTrip`, `::TestMigration019_AdditiveOnly`, `::TestMigration019_ActorNullable`, `::TestMigration019_NoReposTableAlteration`, `::TestMigration019_Atomicity`, `::TestMigration019_NumberIs019`, `::TestFeatureDefaults_ValidatorMinimal` — per `test-results` §2.1 T-MIG-01..07) run against a **fresh test DB with no `schema_migrations` rows**. In CI, the `backend` and `backend-full` jobs create the test DBs via the existing `for db in devteam_test_db ...` loop, but the test harness's `setupTestDB(t)` applies all registered migrations — which means migration 019 runs as part of `setupTestDB`, not as a fresh-DB test.

**Decision for v1: no new CI step for the migration round-trip test.** Rationale:
1. The round-trip test (`TestMigration_RoundTrip` and siblings) are **Go test functions** that create their own isolated DB (or truncate `schema_migrations` + all tables) within the test. They run in the existing `backend` and `backend-full` jobs automatically — they're `_test.go` files under `internal/db/`, picked up by `go test ./internal/db/...` and `go test ./...`.
2. Adding a dedicated "fresh DB" CI step would require either (a) a second postgres service container with a separate `CREATE DATABASE` and a custom `go test -run TestMigration_RoundTrip` invocation, or (b) a test-harness refactor to expose a `setupFreshTestDB(t)` helper. Both are test-infrastructure work whose value is marginal given that the tests already run in the existing jobs — the "fresh DB" isolation is the test's own responsibility, not the CI job's.
1. The round-trip test (`TestMigration019_RoundTrip` and siblings) are **Go test functions** that create their own isolated DB (or truncate `schema_migrations` + all tables) within the test. They run in the existing `backend` and `backend-full` jobs automatically — they're `_test.go` files under `internal/db/`, picked up by `go test ./internal/db/...` and `go test ./...`.
2. Adding a dedicated "fresh DB" CI step would require either (a) a second postgres service container with a separate `CREATE DATABASE` and a custom `go test -run TestMigration019_RoundTrip` invocation, or (b) a test-harness refactor to expose a `setupFreshTestDB(t)` helper. Both are test-infrastructure work whose value is marginal given that the tests already run in the existing jobs — the "fresh DB" isolation is the test's own responsibility, not the CI job's.
3. The test's own `setupFreshTestDB(t)` helper (the developer implements this per `test-results` §1.3: "Fresh test DB with no `schema_migrations` rows") handles isolation **inside** the test. CI just needs to provide a postgres endpoint, which it already does.

**If the developer at 3.6 finds that the migration tests cannot isolate a fresh DB within the shared `devteam_test_db`** (e.g., because `setupTestDB` runs all migrations before the test gets control), the fallback is a one-line addition to the `backend` job's "Create test databases" step: `CREATE DATABASE devteam_test_fresh;` and a `DEVTEAM_TEST_FRESH_DSN` env var the tests read. This is a **contingent** edit — not made now, but recorded so 3.6/4.1 don't re-derive it. The default assumption is that the tests isolate themselves.
Expand Down Expand Up @@ -156,13 +156,13 @@ Rationale: U-CONFIG-01 (the config write/materialize/reconcile path) is the linc

This runs in the `backend` job alongside the db/api/config unit gate so a race regression fails the fast gate, not just `backend-full`. The `-race` flag is not added to `backend-full`'s `go test ./...` (the full suite under `-race` is ~3× slower and not justified for the single-operator repo); the targeted race step covers the concurrency-touching packages.

## 6. Migration 018 Rollback Implication (input to 4.1)
## 6. Migration 019 Rollback Implication (input to 4.1)

This is a **CI-pipeline-stage record** for the downstream deployment stage, not a CI change itself. Per `team-practices` §6.3/§6.4 and the existing `rollback.sh`:

- **Migration 018 is forward-only** (no `Down`), per the established convention (R-TEST-03, `team-practices` §6.4).
- **Code rollback** (via `rollback.sh`): `git revert` the merge commit, rebuild, restart. The reverted binary does not know about migration 018's tables — they are orphaned but harmless (additive, <1 MB, ignored by the old code). Same posture as the sibling feature's migration 017.
- **Data rollback** (if migration 018 fails in production): manual `pg_restore` from the last `pg_dump` backup, or a forward-fix migration 019. **No automated data rollback.** This is the inherited posture (`team-practices` §6.3); this feature does not change it.
- **Migration 019 is forward-only** (no `Down`), per the established convention (R-TEST-03, `team-practices` §6.4).
- **Code rollback** (via `rollback.sh`): `git revert` the merge commit, rebuild, restart. The reverted binary does not know about migration 019's tables — they are orphaned but harmless (additive, <1 MB, ignored by the old code). Same posture as the sibling feature's migration 017.
- **Data rollback** (if migration 019 fails in production): manual `pg_restore` from the last `pg_dump` backup, or a forward-fix migration 020. **No automated data rollback.** This is the inherited posture (`team-practices` §6.3); this feature does not change it.
- **The startup reconciler (U-CONFIG-01, FR-CONFIG-05)** is the crash-recovery path for the DB→YAML materialize layer: if the materialized YAML is stale vs DB after a failed deploy, the next successful boot re-materializes from DB. This is a **new** rollback-adjacent property this feature introduces — 4.1 should record it in the rollback runbook as "config-state recovery does not require DB restore for the settings store; the reconciler handles it on next boot."

## 7. What This Pipeline Does NOT Do (scoped out, recorded)
Expand Down Expand Up @@ -206,7 +206,7 @@ Inherited from the sibling feature's `ci-config.md` §7 and reaffirmed for this
4. **Dep-tidy gate will catch uncommitted deps** — `go mod tidy && git diff --exit-code go.mod go.sum` fails if `go-playground/validator` is imported but not in `go.mod`. Same for `npm ci` vs `zod` in `package-lock.json`. ✓
5. **Vet scope widening is safe and `internal/opencode` is excluded** — the new packages (`internal/repos`, `internal/settings`, `internal/config`) are net-new or extended code with no inherited vet warnings. `internal/opencode` is not built by this feature (scope cut, Q7) and is therefore correctly absent from the vet scope. Verified against `bolt-plan` revision 2 §6. ✓
6. **E2E non-blocking posture is explicit** — §3.2 records the rationale; the `ci.yml` `continue-on-error: true` and the `gate` job's blocking condition are unchanged. ✓
7. **Migration 018 (not 017)** — verified `internal/db/migration_017.go` on `main` is `repos_registry` (sibling feature); this feature's migration is 018. The `unit-of-work` "017" reference is renumbered by the developer at 3.6. ✓
7. **Migration 019 (not 017)** — verified `internal/db/migration_017.go` on `main` is `repos_registry` (sibling feature); this feature's migration is 019. The `unit-of-work` "017" reference is renumbered by the developer at 3.6. ✓
8. **No scope creep** — §7 records every omitted gate (coverage, security scan, container, release notes, matrix, cross-browser, CI/CD, opencode builder) with its source rationale, and the scope-cut resolutions for CI/CD and Providers. ✓
9. **Baseline shift is recorded** — §0 flags the 2.2 "no CI" staleness so 4.1/4.3 and the reviewer gate operate against the current baseline. ✓
10. **Race gate is binding** — §5.3 encodes `quality-report` rev2 QO-14 as a CI step in the `backend` job, not merely a developer-local recommendation. ✓
Expand Down
Loading
Loading