-
Notifications
You must be signed in to change notification settings - Fork 7
104 lines (95 loc) · 4.56 KB
/
Copy pathorg-postgres.yml
File metadata and controls
104 lines (95 loc) · 4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# org-postgres.yml - run the org-server suites that are GATED on a live
# PostgreSQL DSN, against a real postgres:16 service container, and FAIL the
# job if any of those live-PG tests silently skipped.
#
# WHY THIS EXISTS
# The stateless-collectors / Postgres-data-plane arc moved the org server off
# SQLite onto Postgres. Its riskiest bug class is a lost-update under Postgres
# MVCC (SQLite's _txlock=immediate serialized every writer, so the SQLite half
# of a two-writer test proves the final STATE, not that the Postgres
# SELECT ... FOR UPDATE / advisory-lock guard actually excludes a concurrent
# writer). Those proofs live in dbtest.ForEachEngine "postgres" subtests,
# controltest.Dialects "postgres" subtests, and TestLivePG* tests - every one
# of which t.Skip()s when OBSERVER_CONTROL_STORE_DSN is unset. ci.yml runs
# `go test ./...` with NO Postgres, so today the entire Postgres data-plane
# regression surface (plan acceptance criteria 7 + 9) skips silently on every
# PR. This job closes that gap: it points the DSN env vars the test helpers
# read at a real service container and turns a live-PG skip into a failure.
#
# REQUIRED-IN-SPIRIT: this job SHOULD gate merges to the packages below (it is
# the only automated proof the MVCC guards hold). It is intentionally NOT wired
# into branch protection here - promoting it to a required check is a repo-admin
# action, done outside this file.
#
# NATS: not needed. The named suite below touches Postgres, not the durable
# log. internal/telemetrylog's natslog tests embed an in-process nats-server
# and already run in ci.yml's `go test ./...`; the kafkalog tests are BYO and
# gate on OBSERVER_KAFKA_TEST_BROKERS (not provided anywhere). telemetrylog is
# a TRIGGER path because a change to the log semantics must re-run the Postgres
# ingest/apply/receipt suite (./internal/orgserver/ingest/...), which is in the
# set below - not because this job runs telemetrylog's own tests.
name: org-postgres
on:
pull_request:
paths:
# Same paths teams-golden-path.yml watches ...
- 'internal/orgclient/**'
- 'internal/orgserver/**'
- 'internal/orgcontract/**'
- 'internal/store/orgpush*'
- 'cmd/observer-org/**'
- 'cmd/observer/org.go'
- 'deploy/observer-org/**'
# ... plus the durable log (feeds the ingest/apply/receipt suite) ...
- 'internal/telemetrylog/**'
- 'internal/aigateway/gwstore/**'
# ... and this job's own wiring.
- 'scripts/ci/org-postgres-suite.sh'
- '.github/workflows/org-postgres.yml'
workflow_dispatch: {}
permissions:
contents: read
jobs:
live-pg:
name: live-postgres suites
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:16-alpine
env:
# The service superuser. NewPostgres (dbtest) needs CREATEDB to make
# its per-test disposable databases; the POSTGRES_USER is a superuser
# so that holds. This password is a fixed non-secret dev value (it
# only ever exists inside this ephemeral runner + its service
# container), so it is inlined rather than pulled from a secret.
POSTGRES_USER: observer
POSTGRES_PASSWORD: dev-postgres-password-change-me
POSTGRES_DB: observer_org
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U observer -d observer_org"
--health-interval 5s
--health-timeout 3s
--health-retries 20
env:
# Every DSN env var the test helpers read (grepped from
# internal/orgserver/db/dbtest, .../controlstore, .../leader and the
# pgmigrations tests). OBSERVER_POSTGRES_URL is the alternate name
# controlstore/leader/controltest also accept; OBSERVER_CONTROL_STORE_LIVE
# is set by the helpers themselves, so it is deliberately NOT set here.
# OBSERVER_DBTEST_ENGINE is deliberately NOT set: we want ForEachEngine to
# run BOTH engines, not force a single-engine suite.
OBSERVER_CONTROL_STORE_DSN: postgres://observer:dev-postgres-password-change-me@localhost:5432/observer_org?sslmode=disable
OBSERVER_DATA_STORE_DSN: postgres://observer:dev-postgres-password-change-me@localhost:5432/observer_org?sslmode=disable
CGO_ENABLED: '0'
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v5
with:
# Pins the toolchain the same way ci.yml's go job does.
go-version-file: 'go.mod'
cache: true
- name: run live-Postgres org-server suites (fail if any live-PG test skipped)
run: bash scripts/ci/org-postgres-suite.sh