dev/vendor/MANIFEST.toml pins bcda-app@7decdcc (v3 handler + tests, request validation middleware, OperationOutcome writer, v3 Postman collection, gzip fixtures, sandbox config, LICENSE) and the bcda.cms.gov v3 data dictionary, v2 dictionary and official v3 sample ndjson. vendor_bcda_app.py --verify | --check | --sync (stdlib only); the bcda-vendor workflow runs --check weekly and files an issue on drift — nothing auto-commits, a payload change upstream is something a human reads before the flattener is re-pointed. gen_bcda_v3_crosswalk.py writes dev/seeds/bcda_v3_data_dictionary.csv (fhirPath, IDR sourceColumn, ccwMapping, cclfMapping per v3 field), bcda_v3_cclf_crosswalk.csv (293 CCLF elements -> v3 field) and bcda_v3_cclf_absent.csv (52 CCLF fields v3 does not carry); the CCLF sheet has label/name swapped on data rows and is normalised. Tests assert the committed seeds match the vendored workbook. refs #1139
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
"""The weekly BCDA vendor drift workflow (P52) is emitted by the Gitea backend."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
sys.path.insert(0, str(ROOT / "dev" / "scripts"))
|
|
|
|
from backends import gitea # noqa: E402
|
|
|
|
|
|
def test_bcda_vendor_workflow() -> None:
|
|
path, content = gitea._gen_bcda_vendor(runner="ubuntu-latest", uv_version="0.5")
|
|
assert path == ".gitea/workflows/bcda-vendor.yml"
|
|
assert "name: BCDA Vendor" in content
|
|
assert 'cron: "30 5 * * 1"' in content
|
|
assert "vendor_bcda_app.py --verify" in content
|
|
assert "vendor_bcda_app.py --check" in content
|
|
assert "--no-project" in content # stdlib only, runs before uv sync
|
|
assert '--workflow "BCDA Vendor" --job "bcda-vendor"' in content
|
|
|
|
|
|
def test_emitted_with_the_others() -> None:
|
|
files = gitea.emit(
|
|
images=[],
|
|
scans=[],
|
|
platform={
|
|
"registry": "r",
|
|
"domain": "d",
|
|
"host_ip": "1.1.1.1",
|
|
"image_prefix": "p",
|
|
"repo": "o/n",
|
|
},
|
|
ci_cfg={"runner": "ubuntu-latest", "registry": "r", "uv_version": "0.5"},
|
|
)
|
|
assert ".gitea/workflows/bcda-vendor.yml" in files
|
|
committed = (ROOT / ".gitea" / "workflows" / "bcda-vendor.yml").read_text()
|
|
assert committed == files[".gitea/workflows/bcda-vendor.yml"]
|