Repository navigation
2291 lines (2140 loc) · 96.3 KB
/
Copy pathci.yml
File metadata and controls
2291 lines (2140 loc) · 96.3 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI
on:
push:
branches: [main, python-adcp-sdk-setup]
pull_request:
branches:
- main
- conductor/reporting-webhook-activity-1168b
- conductor/reporting-status-notifications-1168c
- conductor/1167b1-materializer-contracts
- conductor/1167b2-durable-managed-reporting
- conductor/reporting-receipt-ingress-b22
- conductor/reporting-frozen-account-feed-b23
- conductor/reporting-schema-proof-receipt-diagnostics-hardening
- conductor/reporting-production-tier-capabilities-b24
- conductor/reporting-adcp-rc4-adoption
workflow_dispatch:
# Exact AdCP 3.2.1 runner; the reference matrix also retains the AdCP 3.0 floor.
env:
ADCP_SDK_VERSION: "14.0.0"
concurrency:
# A tagged main commit needs its own full CI even when main advances.
# PR updates may still cancel superseded runs for the same PR ref.
group: ci-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
changes:
name: CI scope
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
outputs:
run_tests: ${{ steps.scope.outputs.run_tests }}
full_matrix: ${{ steps.scope.outputs.full_matrix }}
run_postgres: ${{ steps.scope.outputs.run_postgres }}
run_packaging: ${{ steps.scope.outputs.run_packaging }}
run_storyboards: ${{ steps.scope.outputs.run_storyboards }}
release_metadata: ${{ steps.scope.outputs.release_metadata }}
expected_results: ${{ steps.scope.outputs.expected_results }}
steps:
# A PR merge commit's two parents contain the complete base/head diff.
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 2
persist-credentials: false
sparse-checkout: scripts/ci/ci_scope.py
sparse-checkout-cone-mode: false
- name: Select SDK test scope
id: scope
run: python3 scripts/ci/ci_scope.py
workflow-security:
name: Workflow security
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Lint workflows
uses: raven-actions/actionlint@3d39aea434753780c3b3d4a1a31c854b4dbf49d7 # v2.2.0
with:
version: 1.7.7
shellcheck: false
# actionlint v1.7.x predates GitHub's `queue: max` concurrency
# syntax. Keep linting every other workflow field until its parser
# catches up.
flags: >-
-ignore ^unexpected\s+key\s+\x22queue\x22\s+for\s+\x22concurrency\x22\s+section
- name: Test Ladon review-state helper
run: node --test scripts/retire-superseded-ladon-reviews.test.cjs
- name: Audit workflows
uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2
with:
inputs: >-
.github/workflows/claude-issue-triage.yml
.github/workflows/ipr-agreement.yml
.github/workflows/sync-agent-roles.yml
.github/workflows/slash-command-dispatch.yml
.github/workflows/ai-review.yml
.github/workflows/release-please.yml
.github/workflows/release-publish.yml
version: 1.29.0
min-severity: high
min-confidence: high
advanced-security: false
annotations: true
test:
needs: changes
if: needs.changes.outputs.run_tests == 'true'
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
# 3.12 always runs the canonical suite and coverage. Ordinary PRs use
# compatibility checks on the other interpreters; main/manual runs and
# shared build/schema/type changes retain exhaustive interpreter coverage.
# Recent coverage runs take 53 minutes before setup/type checks. Keep
# 15 minutes beyond each full-suite step for those other required checks.
timeout-minutes: ${{ matrix.python-version == '3.12' && 85 || needs.changes.outputs.full_matrix == 'true' && 70 || 15 }}
strategy:
# Complete exhaustive lanes independently so late interpreter failures
# preserve coverage results. Fast PR compatibility checks cancel early.
fail-fast: ${{ needs.changes.outputs.full_matrix != 'true' }}
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: ${{ matrix.python-version }}
prune-cache: true
- name: Install dependencies
run: |
uv pip install --system -e ".[dev]" -e "./packages/adcp-reporting-storage"
- name: Run linter
if: matrix.python-version == '3.12'
run: ruff check src/ packages/adcp-reporting-storage/src/
- name: Run type checker
if: matrix.python-version == '3.12'
run: mypy src/adcp/ packages/adcp-reporting-storage/src/adcp_reporting_storage/
- name: Run adopter type-check suite
if: matrix.python-version == '3.12'
run: mypy --strict tests/type_checks/ examples/reporting_webhook_activity.py examples/reporting_status_notifications.py examples/reporting_destination_writer.py examples/reporting_durable_materializer.py examples/reporting_receipt_ingress.py examples/reporting_production.py
- name: Run adopter type-check suite under pyright
if: matrix.python-version == '3.12'
# The fixtures that import psycopg need the pg extra, which this job's
# dev-only install does not bring; pyright has no ignore_missing_imports.
run: |
uv pip install --system -e ".[pg]"
python scripts/run_pyright_type_checks.py
- name: Check versioned typing generation
if: matrix.python-version == '3.12'
run: |
python scripts/generate_versioned_stubs.py --check
python scripts/generate_versioned_bases.py --check
- name: Enforce adopter type-check fixture contract
if: matrix.python-version == '3.12'
run: python scripts/check_type_ignore_contract.py
- name: Run full native suite
if: matrix.python-version != '3.12' && needs.changes.outputs.full_matrix == 'true'
timeout-minutes: 55
run: python scripts/ci/run_native_tests.py --mode full --unit-workers 2
- name: Run interpreter compatibility checks
if: (matrix.python-version != '3.12' && needs.changes.outputs.full_matrix != 'true') || needs.changes.outputs.release_metadata == 'true'
timeout-minutes: 10
run: python scripts/ci/run_native_tests.py --mode compatibility
- name: Run canonical suite with coverage
if: matrix.python-version == '3.12' && needs.changes.outputs.release_metadata != 'true'
timeout-minutes: 70
run: python scripts/ci/run_native_tests.py --mode full --coverage --unit-workers 2
- name: Validate release metadata and built distributions
if: matrix.python-version == '3.12' && needs.changes.outputs.release_metadata == 'true'
timeout-minutes: 10
run: |
python -m pytest tests/test_release_configuration.py tests/test_normalize_pyproject_prerelease.py -n 0 -q
python -m build --outdir "${RUNNER_TEMP}/release-metadata-dist"
python -m scripts.ci.check_release_artifacts "${RUNNER_TEMP}/release-metadata-dist"
pg-conformance:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Postgres conformance tests (Postgres 16, ${{ matrix.lane }})
runs-on: ubuntu-latest
timeout-minutes: ${{ matrix.timeout_minutes }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
# Core also builds and installs the reporting wheel/sdist fixtures.
# It runs 25-29 minutes on main, so 30 cancelled it on slow runners.
- lane: core
timeout_minutes: 45
- lane: process
timeout_minutes: 15
services:
postgres:
# CI-local ephemeral database. POSTGRES_HOST_AUTH_METHOD=trust
# avoids shipping any password literal (real or placeholder) in
# this workflow — GitHub's default CI network is already the
# trust boundary for this throwaway service.
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- name: Fetch reviewed reporting baseline for rolling binary tests
timeout-minutes: 1
run: git fetch --no-tags --depth=1 origin 17ee407ae3978c8a2bb54437287afbf9dafb8130
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install dependencies (with [pg] extra)
run: |
uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run Postgres conformance tests
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_test
PG_LANE: ${{ matrix.lane }}
run: |
# Keep every case and its per-case deadline. The core lane includes
# installed artifact coverage and has a larger overall job budget.
case "$PG_LANE" in
core)
python scripts/reporting_test_harness.py pytest tests/conformance/signing/test_pg_replay_store.py \
tests/conformance/signing/test_pg_replay_store_e2e.py \
tests/conformance/decisioning/test_pg_buyer_agent_registry.py \
tests/conformance/decisioning/test_pg_idempotency_backend.py \
tests/conformance/decisioning/test_pg_idempotency_reservation.py \
tests/test_decisioning_task_polling.py \
tests/test_decisioning_task_lifecycle.py \
tests/test_decisioning_lazy_pg_stores.py \
tests/conformance/decisioning/test_pg_task_webhook_outbox.py \
tests/conformance/decisioning/test_pg_notification_outbox.py \
tests/conformance/decisioning/test_pg_webhook_delivery_supervisor.py \
tests/test_notification_outbox.py \
tests/test_notification_outbox_artifacts.py \
tests/conformance/decisioning/test_pg_reference_workflow_queue.py \
tests/conformance/reporting/ \
tests/test_reporting_storyboard_orchestration.py::test_database_owner_returns_node_postgres_uri_after_psycopg_validation \
tests/test_reporting_storyboard_orchestration.py::test_node_database_url_materializes_libpq_default_user \
--ignore=tests/conformance/reporting/test_reporting_notification_process_matrix.py \
--ignore-glob='tests/conformance/reporting/test_reporting_status_*.py' \
--ignore=tests/conformance/reporting/test_reporting_materializer_rolling.py \
--ignore=tests/conformance/reporting/test_reporting_materializer_process.py \
--ignore=tests/conformance/reporting/test_reporting_materializer_migration.py \
--ignore=tests/conformance/reporting/test_reporting_materializer_installed_pg.py \
--ignore-glob='tests/conformance/reporting/test_reporting_receipt_*.py' \
--ignore-glob='tests/conformance/reporting/test_reporting_feed_*.py' \
--ignore-glob='tests/conformance/reporting/test_reporting_production*.py' \
--ignore-glob='tests/conformance/reporting/test_reporting_projection*.py' \
--ignore=tests/conformance/reporting/test_reporting_tier_projection.py \
--ignore=tests/conformance/reporting/test_reporting_schedule_schema.py \
--ignore=tests/conformance/reporting/test_reporting_rc6_rolling.py \
-v -ra
;;
process)
python scripts/reporting_test_harness.py pytest tests/conformance/reporting/test_reporting_notification_process_matrix.py -v -ra
;;
*)
echo "Unknown Postgres conformance lane"
exit 1
;;
esac
reporting-js-interop:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Row storage interop with the JavaScript SDK (Postgres 16)
runs-on: ubuntu-latest
# npm ci and the full adcp-client build dominate; the interop test itself takes seconds.
timeout-minutes: 30
permissions:
contents: read
# PURPOSE: the shared row-storage layout is only shared if the shipped JavaScript SDK reads
# what Python writes and the reverse, against one database and one bucket. This lane builds
# adcp-client at its main branch (deliberately not pinned to a commit) and runs
# test_one_database_and_one_bucket_in_both_directions with ADCP_REQUIRE_JS_INTEROP=1, so a
# missing build or environment fails instead of skipping. If JavaScript main changes its
# stored format before Python mirrors it, this job correctly fails: that is the gate.
services:
postgres:
image: mirror.gcr.io/library/postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_interop_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Check out the JavaScript SDK (main)
uses: actions/checkout@v6
with:
repository: adcontextprotocol/adcp-client
ref: main
path: adcp-client-js
persist-credentials: false
- name: Set up Node 22.12.0
uses: actions/setup-node@v6
with:
node-version: "22.12.0"
cache: npm
cache-dependency-path: adcp-client-js/package-lock.json
- name: Build the JavaScript SDK
working-directory: adcp-client-js
run: |
npm ci
npm run build
test -f dist/lib/reporting/ledger/index.js
# SDK 16 moved the row storage into the @adcp/reporting-storage workspace
# package, which the root build does not compile; the interop driver reads it.
npm run build --workspace packages/reporting-storage
test -f node_modules/@adcp/reporting-storage/dist/index.js
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run the interop test in both directions
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_interop_test
ADCP_JS_SDK_DIR: ${{ github.workspace }}/adcp-client-js
ADCP_REQUIRE_JS_INTEROP: "1"
run: |
python -m pytest -n0 -p no:cacheprovider -v -ra \
tests/conformance/reporting/test_reporting_row_storage_interop_pg.py
pg-conformance-required-gate:
name: Postgres conformance tests (Postgres 16)
runs-on: ubuntu-latest
timeout-minutes: 5
permissions: {}
needs: [changes, pg-conformance, pg-reporting-status, pg-reporting-materializer, pg-reporting-receipts, pg-reporting-receipt-compatibility, pg-reporting-feed, pg-reporting-feed-compatibility, pg-reporting-feed-installed, pg-reporting-production, pg-reporting-production-compatibility, pg-reporting-production-installed, reporting-js-interop, reporting-installed-artifact-matrix]
# Failed lanes must still fail the gate; superseded runs should release
# their concurrency slot instead of keeping an uncancelable job queued.
if: ${{ !cancelled() }}
steps:
- name: Require every Postgres conformance lane
env:
CI_NEEDS: ${{ toJSON(needs) }}
run: |
python3 - <<'PY'
import json, os
needs = json.loads(os.environ["CI_NEEDS"])
scope = needs.pop("changes")
expected = json.loads(scope.get("outputs", {}).get("expected_results", "{}"))
if scope["result"] != "success" or not isinstance(expected, dict) or not expected:
raise SystemExit("CI scope could not be verified")
bad = {
name: job["result"] for name, job in needs.items()
if expected.get(name) not in ("success", "skipped") or job["result"] != expected[name]
}
if not needs or bad:
raise SystemExit("Required CI lanes did not complete as expected: " + json.dumps(bad))
print("All required lanes completed according to the verified CI scope")
PY
pg-reporting-status:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Reporting status conformance (Postgres 16)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_status_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- name: Fetch exact reviewed A, B and C compatibility artifacts
timeout-minutes: 1
run: |
git fetch --no-tags --depth=1 origin \
17ee407ae3978c8a2bb54437287afbf9dafb8130 \
0f34c666ac1961e9832fce43ef0ef6937b3c1dde \
967b6e286301d7e5d089aea6fdbb90bea8ee5a16
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install dependencies (with [pg] extra)
run: |
uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run status semantics, transaction, clock/process and maintenance gates
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_status_test
run: python scripts/reporting_test_harness.py pytest tests/conformance/reporting/test_reporting_status_*.py -v -ra
pg-reporting-materializer:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Durable materializer and frozen artifacts (Postgres 16)
runs-on: ubuntu-latest
# Actual wheel builds/installations plus isolated worker processes are a
# separate bounded job; do not consume the existing conformance headroom.
# Seven real installations plus process/crash and Python 3.10 distribution
# cells approach twenty minutes locally; allow runner variance and retain
# five minutes outside the suite for setup and cleanup.
timeout-minutes: 35
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_materializer_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- name: Fetch exact frozen reporting artifacts
timeout-minutes: 2
run: |
git fetch --no-tags --depth=1 origin \
3e76aa54623529a3dda01cd690b8a5c287c75641 \
3c405a21f978ed9d3208611bb4a7a8434a056933 \
037de4ac822ecefb2f95d32c15c297fb4c45d683 \
17ee407ae3978c8a2bb54437287afbf9dafb8130 \
0f34c666ac1961e9832fce43ef0ef6937b3c1dde \
967b6e286301d7e5d089aea6fdbb90bea8ee5a16 \
5487f2bdef23c5102118b305be9e868228f6ce61
- uses: actions/setup-python@v6
id: materializer-python310
with:
python-version: "3.10"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run installed frozen binaries and materializer migrations
# Propagate pytest failures through tee while retaining evidence for upload.
shell: bash
timeout-minutes: 30
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_materializer_test
ADCP_PYTHON310: ${{ steps.materializer-python310.outputs.python-path }}
run: |
python scripts/reporting_test_harness.py pytest \
tests/conformance/reporting/test_reporting_caller_ownership.py \
tests/conformance/reporting/test_reporting_materializer_migration.py \
tests/conformance/reporting/test_reporting_materializer_process.py \
tests/conformance/reporting/test_reporting_materializer_installed_pg.py \
-v -s -ra | tee materializer-evidence.log
- name: Preserve installed module and worker evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: materializer-evidence-${{ github.run_attempt }}
retention-days: 7
path: materializer-evidence.log
if-no-files-found: error
pg-reporting-receipts:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Authenticated receipts and installed replay (Postgres 16)
runs-on: ubuntu-latest
# Separate databases avoid shared account advisory locks. Keep five minutes
# outside the bounded suite for checkout, installations and cleanup.
timeout-minutes: 35
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_receipts_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
id: receipt-python310
with:
python-version: "3.10"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run receipt transactions, real mounts, crash and installed gates
shell: bash
timeout-minutes: 30
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_receipts_test
ADCP_PYTHON310: ${{ steps.receipt-python310.outputs.python-path }}
run: |
# Explicit pytest paths bypass --ignore; exclude rolling before invocation.
shopt -s nullglob
receipt_tests=()
for test_file in tests/conformance/reporting/test_reporting_receipt_*.py; do
if [[ "$test_file" != tests/conformance/reporting/test_reporting_receipt_rolling.py ]]; then
receipt_tests+=("$test_file")
fi
done
if (( ${#receipt_tests[@]} == 0 )); then
echo "No receipt test files selected" >&2
exit 1
fi
python scripts/reporting_test_harness.py pytest \
"${receipt_tests[@]}" \
-v -s -ra | tee pg-reporting-receipts-evidence.log
- name: Preserve commands, counts, installed provenance and skip reasons
if: always()
uses: actions/upload-artifact@v7
with:
name: pg-reporting-receipts-evidence-${{ github.run_attempt }}
retention-days: 7
path: pg-reporting-receipts-evidence.log
if-no-files-found: error
pg-reporting-receipt-compatibility:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Receipt ownership maintenance upgrade (Postgres 16)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_receipt_maintenance_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Require stopped-worker retention, ownership backfill and receipt isolation
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_receipt_maintenance_test
run: |
python scripts/reporting_test_harness.py pytest \
tests/conformance/reporting/test_reporting_caller_ownership.py \
tests/conformance/reporting/test_reporting_reconciliation_migration.py \
-v -ra
pg-reporting-feed:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Frozen authorized feed and mounted isolation (Postgres 16)
runs-on: ubuntu-latest
# Crash processes and shared memory/SQL vectors have their own database
# and bounded suite; setup and cleanup have five minutes of headroom.
timeout-minutes: 25
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_feed_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run frozen feeds, checkpoints, mounts, transaction faults and migrations
shell: bash
timeout-minutes: 20
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_feed_test
run: |
# Filter before pytest receives explicit paths; --ignore cannot do this.
shopt -s nullglob
feed_tests=()
for test_file in tests/conformance/reporting/test_reporting_feed_*.py; do
case "$test_file" in
tests/conformance/reporting/test_reporting_feed_rolling.py|tests/conformance/reporting/test_reporting_feed_packaging.py|tests/conformance/reporting/test_reporting_feed_installed_pg.py|tests/conformance/reporting/test_reporting_feed_hardening_installed.py) ;;
*) feed_tests+=("$test_file") ;;
esac
done
if (( ${#feed_tests[@]} == 0 )); then
echo "No native feed test files selected" >&2
exit 1
fi
python scripts/reporting_test_harness.py pytest \
"${feed_tests[@]}" \
-v -s -ra | tee pg-reporting-feed-evidence.log
- name: Preserve exact public, private, restart and fault evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: pg-reporting-feed-evidence-${{ github.run_attempt }}
retention-days: 7
path: pg-reporting-feed-evidence.log
if-no-files-found: error
pg-reporting-feed-compatibility:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Feed ownership maintenance upgrade (Postgres 16)
runs-on: ubuntu-latest
# Caller ownership is a breaking storage boundary. Old cursors and pending
# work are retained in quarantine; mixed-version workers are unsupported.
timeout-minutes: 50
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_feed_rolling_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- name: Fetch all nine exact approved historical artifacts
timeout-minutes: 2
run: |
git fetch --no-tags --depth=1 origin \
3e76aa54623529a3dda01cd690b8a5c287c75641 \
3c405a21f978ed9d3208611bb4a7a8434a056933 \
037de4ac822ecefb2f95d32c15c297fb4c45d683 \
17ee407ae3978c8a2bb54437287afbf9dafb8130 \
0f34c666ac1961e9832fce43ef0ef6937b3c1dde \
967b6e286301d7e5d089aea6fdbb90bea8ee5a16 \
5487f2bdef23c5102118b305be9e868228f6ce61 \
3fd62121c96a074e3ea458c30c5224d6a586f169 \
09fd87f79a746665d828dea66b3a1dd9d1fc189e
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Require private feeds and legacy cursor invalidation after maintenance
shell: bash
timeout-minutes: 45
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_feed_rolling_test
run: |
python scripts/reporting_test_harness.py pytest \
tests/conformance/reporting/test_reporting_caller_ownership.py \
tests/conformance/reporting/test_reporting_generation_migration.py \
-v -s -ra | tee pg-reporting-feed-compatibility-evidence.log
- name: Preserve exact artifact origins, catalogs and original replay responses
if: always()
uses: actions/upload-artifact@v7
with:
name: pg-reporting-feed-compatibility-evidence-${{ github.run_attempt }}
retention-days: 7
path: pg-reporting-feed-compatibility-evidence.log
if-no-files-found: error
pg-reporting-feed-installed:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Installed frozen feed (Python 3.10 VCS and sdist)
runs-on: ubuntu-latest
timeout-minutes: 50
permissions:
contents: read
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_feed_installed_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- name: Fetch the exact integrated B2.3 hardening comparison artifact
timeout-minutes: 1
run: git fetch --no-tags origin 2d777ace7b4bf8be519ce0abd4fd0a25ed4f1da7
- uses: actions/setup-python@v6
id: feed-python310
with:
python-version: "3.10"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run installed base and PostgreSQL restart cells
shell: bash
timeout-minutes: 40
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_feed_installed_test
ADCP_PYTHON310: ${{ steps.feed-python310.outputs.python-path }}
ADCP_HARDENING_EVIDENCE: ${{ runner.temp }}/hardening-installed-evidence
run: |
python scripts/reporting_test_harness.py pytest \
tests/conformance/reporting/test_reporting_feed_packaging.py \
tests/conformance/reporting/test_reporting_feed_installed_pg.py \
tests/conformance/reporting/test_reporting_feed_hardening_installed.py \
-v -s -ra | tee pg-reporting-feed-installed-evidence.log
- name: Preserve installed origins, SQL, strict adopter and cold page evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: pg-reporting-feed-installed-evidence-${{ github.run_attempt }}
retention-days: 7
path: |
pg-reporting-feed-installed-evidence.log
${{ runner.temp }}/hardening-installed-evidence
if-no-files-found: error
pg-reporting-production:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Production reporting status, ownership and notification contracts
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 45
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_production_test
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 5s
--health-timeout 5s --health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run complete production and projection conformance
shell: bash
# A passing suite plus harness cleanup can exceed 30 minutes.
timeout-minutes: 40
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_production_test
run: |
# Explicit pytest paths bypass --ignore; preselect and reject empty globs.
shopt -s nullglob
source_tests=()
for test in tests/conformance/reporting/test_reporting_production*.py; do
case "$test" in
*test_reporting_production_packaging.py|*test_reporting_production_rolling.py) continue ;;
esac
source_tests+=("$test")
done
projection_tests=(tests/conformance/reporting/test_reporting_projection*.py)
if (( ${#source_tests[@]} == 0 || ${#projection_tests[@]} == 0 )); then
echo "Production or projection test selection is empty"
exit 1
fi
python scripts/reporting_test_harness.py pytest \
"${source_tests[@]}" \
"${projection_tests[@]}" \
tests/conformance/reporting/test_reporting_tier_projection.py \
tests/conformance/reporting/test_reporting_schedule_schema.py \
tests/test_reporting_capability_models.py \
tests/test_reporting_revision_ownership.py \
tests/test_reporting_production_public.py \
tests/test_schema_datetime_formats.py \
tests/test_rc6_adoption.py \
-v -s -ra | tee pg-reporting-production-evidence.log
- name: Preserve production contract evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: pg-reporting-production-evidence-${{ github.run_attempt }}
retention-days: 7
path: pg-reporting-production-evidence.log
if-no-files-found: error
pg-reporting-production-installed:
needs: changes
if: needs.changes.outputs.run_postgres == 'true'
name: Installed production reporting (${{ matrix.cell }}, Python 3.10)
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 50
strategy:
fail-fast: false
matrix:
cell: [base-vcs, base-sdist, pg-vcs, pg-sdist]
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: adcp_production_installed_test
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 5s
--health-timeout 5s --health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
id: production-python310
with:
python-version: "3.10"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
version: "0.12.8"
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-suffix: "3.12"
prune-cache: true
- name: Install test dependencies
run: uv pip install --system -e ".[dev,pg]" -e "./packages/adcp-reporting-storage[pg,gcs,s3,azure]"
- name: Run installed source-equivalent production contract
shell: bash
timeout-minutes: 45
env:
ADCP_PG_TEST_URL: postgresql://postgres@localhost:5432/adcp_production_installed_test
ADCP_PYTHON310: ${{ steps.production-python310.outputs.python-path }}
ADCP_PRODUCTION_EVIDENCE: ${{ runner.temp }}/production-installed-evidence
PRODUCTION_CELL: ${{ matrix.cell }}
run: |
python scripts/reporting_test_harness.py pytest \
tests/conformance/reporting/test_reporting_production_packaging.py \
-k "$PRODUCTION_CELL" -v -s -ra | tee pg-reporting-production-installed.log
# Keep provenance and diagnostics; the wheel/sdist inputs are built and
# verified above, but repeating them in every matrix upload dominates storage.
- name: Preserve installed origins, original inner logs and exact asset hashes