Add CI quality gates and extract tested publish workflow modules#118
Open
jonaraphael wants to merge 6 commits into
Open
Add CI quality gates and extract tested publish workflow modules#118jonaraphael wants to merge 6 commits into
jonaraphael wants to merge 6 commits into
Conversation
- CI: add a lint job (ruff, terraform fmt/validate for prod and preview envs) and fix all existing lint findings, including a dead catalog_site helper that referenced an undefined regex. - Extract the inline Python from the approved dataset mutation and planned breaking-change workflows into scripts/publish_workflow.py with unit tests: one owner for the schema-target and catalog-row rules, and a fix for the live breaking-alert argv bug that swallowed --pr-number. - Split field profiling out of publishing_concierge.py into scripts/concierge_profiling.py and consolidate catalog CSV loading in scripts/catalog_csv.py. - Enforce canonical asset-doc frontmatter: unknown top-level and admission keys now fail catalog docs validation (gated pre-merge by a new real-docs test), migrate four docs to canonical admission field names, and make footprint parsing unit-aware so 90 MB no longer reads as 90 GB. - README: complete the skill routing table and defer authority ordering to AGENTS.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merge origin/main (#116, #117) and migrate the two new DRC asset docs to the canonical admission field names the frontmatter gate enforces. Gate the planned breaking-alert send step on a detected plan so the workflow is inert on PRs without publish/delete plans; it previously ran unconditionally and failed on this PR because the trusted main checkout does not yet contain scripts/publish_workflow.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…edup Address the PR #118 review findings: - admission_check: footprint values now parse comma grouping correctly ("10,240 MB" was read as 0.24 GB, silently bypassing the >= 10 GB large-data-exception gate) and reject garbled numbers like "1.5.2 GB" loudly instead of misreading them. Regression tests added. - publish_workflow: command_promote gains unit tests pinning stat->copy->stat ordering, --replace-generation conditionality, and the catalog.json idempotence skip; the deleted single-object-fallback assertNotIn guards are restored in the workflow tests. - plan_asset_slug now fails loudly when no plan file exists; the workflow steps that call it only run after plan extraction, so the silent exit-0 skip hid wiring bugs. - The catalog.json equality contract has one owner again: promote reuses catalog_drift_guard.normalize_web_catalog_payload instead of a duplicate normalizer. - catalog_csv gains text-based readers; publish_workflow and the concierge's detect_existing_asset stop hand-rolling csv.DictReader over catalog rows. - The concierge admission evidence contract adopts the canonical field names (shared_rationale, deprecation_policy, estimated_published_size_gb) that catalog_docs now enforces, with a temporary legacy-key bridge for pre-rename persisted workflow states. - Dead profiling helpers (duplicate_counts, read_csv_rows, read_ogr_rows) deleted; templates document source_license_citation_status; the DRC ASM mask doc records its real ~0.03 GB footprint instead of 1 GB. Validation: full suite 624 passed / 4 skipped, ruff clean, catalog_docs.py check current for 24 docs, stdlib-only import verified on system Python. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The catalog viewer silently reset the colorize dropdown to None when a metadata color field could not load. The refusal reason (for example a sidecar larger than the autoload budget) is now rendered as a note in the color-legend area. The default browser autoload budget rises from 5 MiB to 24 MiB, integer measures such as fatalities keep numeric gradients instead of flipping to categorical mode, and the detail panel shows the asset slug. Preview catalog builds inject a 32 MiB budget via a new catalog_site.py --metadata-sidecar-autoload-max-bytes flag wired into both preview workflows only; the production catalog web deploy is unchanged and pinned by test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The validate-artifacts required-evidence template now documents the enforced tool_versions field, evidence-array validation errors use 0-based indexes matching JSON positions and name the offending object URI, and the stage-scratch and preview-upload steps state the per-role content-type and cache-control requirements up front instead of only enforcing them at confirm time. Regression tests pin the template and message contracts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of three planned repo-hardening PRs (next: reusable constrained Terraform apply for the IAM-sync workflows; then ingestion/services dedup).
What this does
CI quality gates
lintjob inci.yml:ruff check,terraform fmt -check, andterraform validateforterraform/envs/prodandterraform/envs/preview(Terraform pinned to the same 1.8.5 as the deploy workflows).sys.path-bootstrap script idiom. All 30 pre-existing findings fixed, including a deadcatalog_site.normalize_locale_codehelper that referenced an undefinedFIELD_SAFE_LOCALE_RE(zero callers — deleted).Publish workflow extraction
publish-dataset.yml(1,114 → 331 lines) anddataset-breaking-change-alert.yml(450 → 157 lines) moved toscripts/publish_workflow.py(14 subcommands, stdlib-only at import; onlypromoteneedsuv run). Five diverging inline copies ofis_schema_target/catalog_rowbecame one definition.--summary-jsonpair, which swallowed--pr-numberand left an orphan positional — the live Slack send would have crashed whenever a breaking publish change was detected on a PR. Regression-tested (test_live_send_arguments_stay_paired).tests/test_publish_workflow.py(28 tests) covers schema-target rules, alert dedup, generation-verified deletes, and catalog-row collection;test_publish_dataset_workflow.pynow asserts step wiring/ordering/protections instead of grepping heredoc text.Concierge split + catalog loader consolidation
publishing_concierge.py(3,975 → ~3,000) intoscripts/concierge_profiling.py; the state-machine CLI is unchanged.scripts/catalog_csv.pyis now the single owner of catalog CSV parsing; the four divergentload_catalog()implementations delegate to it.Asset-doc frontmatter schema gate
catalog_docs.pynow rejects unknown top-level andadmission:frontmatter keys, andtests/test_repo_asset_docs.pyvalidates the realdocs/assets/pre-merge (previouslycatalog_docs.py checknever ran in CI).estimated_published_footprint,deprecation_exit_policy,shared_datasets_rationale) to the canonical template names with numeric GB values.admission_check.parse_footprint_gbwas unit-blind ("Roughly 90 MB" parsed as 90 GB). Footprint parsing is now unit-aware with one owner inadmission_check.py; the concierge delegates to it.Docs
scripts/README.md: sections forpublish_workflow.pyand the shared internal modules.Remote paths changed
None. No canonical GCS objects are touched; no publish plan is included or needed. Workflow behavior changes take effect only for future runs after merge.
Validation
ruff check .,terraform fmt -check/validate(both envs, Terraform 1.8.5),repo_guardrails.py check-static,catalog_docs.py check(22 asset docs current) all pass.Review
Self-authored by
jonaraphael; GitHub blocks requesting review from the PR author, so per AGENTS.md this records the restricted self-acceptance path.🤖 Generated with Claude Code