Repository navigation
feat: catalog tooling (check, changed, lint-docker, verify) and CI - #5
Merged
Merged
Conversation
Stdlib-only Python 3.9+ tooling for spec 001 (plan section 3), written from scratch: - catalog.py check/list: parse every benchmark_config.json, resolve Dockerfiles (default, <framework>-<key> or the dockerfile override), require a port and a known *_url, normalize database, report test types per stage. - catalog.py changed/lint-docker: changed framework folders since a ref (ALL_TOOLING for tools/, tests/, .github/workflows/) and :latest or untagged FROM images in changed Dockerfiles. - catalog.py verify: docker build, run on a private network, wait for the port (120 s), run the stage-A verifiers, clean up; summarize merges shard summaries. - tools/verify: json, plaintext and common header rules (spec R5) behind one function, verify_variant(). - tests/: unittest suites with fixture catalogs, temporary git repos and a local stub HTTP server. Refs #1 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Implements plan section 4 next to the existing docs job: metadata check and unit tests on every push and PR, changed folders plus Dockerfile lint on PRs, a stage-A verify matrix (fail-fast off, smoke sample for tooling changes), and a weekly/dispatchable full run sharded by language with a merged JSON summary artifact. Refs #1 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4 tasks
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.
Refs #1
Implements spec 001 plan §3 (repo tooling) and §4 (CI). Docs (AGENTS.md runbook, README) stay for the docs PR (tasks 6.x).
What's in it
tools/catalog.py(stdlib only, Python 3.9+, written from scratch, no upstream toolset code), with--rootto point at another catalog:check: parses every*/*/benchmark_config.json, resolves each variant's Dockerfile (<framework>.dockerfile,<framework>-<key>.dockerfileor thedockerfileoverride), requires a port and a known*_url, normalizesdatabase, reports test types per stage. Exits 1 on errors.list [--lang L] [--json]changed --since <ref> [--json]: changed framework folders. PrintsALL_TOOLINGwhentools/,tests/or.github/workflows/change.--jsonadds the smoke sample tomatrix.lint-docker --since <ref>(or--all): fails on:latestor untaggedFROM. Stage aliases,scratch,ARGimages and digests are allowed.verify <Language[/framework[:key]]> [--stage A]:docker build(one retry, recorded in the summary), run on a private network, wait up to 120 s for HTTP on the published port, run the stage-A verifiers, then remove the container and network (--rmialso removes the image). Broken variants →skipped-broken. Stage B/C types →declared-not-verified.summarize: merges shard summaries into one JSON plus a Markdown job summary.tools/verify/: json, plaintext and common header rules (spec R5) behind a single function,verify_variant(). Where the spec and the pinned Python verifier differ, I followed the verifier: a malformedDateonly warns,UTCis accepted, and the minimum routes are/json(5) and/plaintext(10).tests/: 60 unittest cases: fixture catalogs (valid, missing Dockerfile, no URLs, bad JSON, override, broken), temporary git repos forchanged/lint-docker, a local stub HTTP server for each pass/warn/fail rule, and a fake Docker for theverifyorchestration..github/workflows/ci.yml: the existingdocsjob is unchanged. New jobs:metadata: Python 3.9,checkplus unit tests.changed: lint plus matrix.verify: stage A,fail-fast: false.full-plan/full/full-summary: weekly plusworkflow_dispatchwith afoldersinput, one shard per language,max-parallel: 8, JSON summary artifact.Smoke sample
The plan lists e.g.
Go/gin,Java/spring, ... as the smoke sample. Their default variants connect to a database at startup, so they cannot pass stage A without one.Go/gin:defaultexits withlookup tfb-database ... no such host. The sample is therefore one variant per language that needs no database:C/libreactor:default,Go/go-std:default,Java/javalin:default,JavaScript/express:default,Python/fastpysgi:default,Rust/axum:default.Local validation
python3 -m unittest discover -s tests: 60 tests OK.python3 tools/catalog.py checkon this repo:lint-docker --all: 39 existing problems (14:latest, 25 untagged). The spec's "about 45 untagged" counted stage aliases. CI lints only changed Dockerfiles.verifyend to end (Docker Desktop, arm64, native builds): all 6 smoke variants pass json and plaintext. No containers or networks are left behind.Go/gin:defaultfails as described above.Follow-up for spec 002
Every variant whose application connects to its database at startup will fail stage A on hosted CI until the dataset/database service exists. That covers most
database != nonevariants, such asGo/gin:default. The weekly full run will show how many.🤖 Generated with Claude Code