-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Last generated: 2026-02-07T18:39:55.681Z
Provider: openai
Model: gpt-5.2
Summary
Bring CI and repo automation back to “builds the library every time” by adding a single, authoritative ci workflow that (1) installs with Poetry, (2) runs formatting/lint/type checks, (3) runs tests, and (4) verifies the CDP codegen output is in sync. Also remove/ignore .bish* artifacts that are currently tracked/generated and add a couple of make targets so both humans and CI run the same commands.
Direction (what and why)
What
- Add a minimal, deterministic CI pipeline in
.github/workflows/ci.ymlthat runs on PRs/pushes tomaster. - Standardize local+CI commands via Makefile (
make lint,make type,make test,make gen-check). - Stop committing build/cache artifacts (
.bish-index,.bish.sqlitein multiple directories) and enforce this with.gitignore+ (optional) a CI guard.
Why
- The repo recently added many automation workflows synced from a central
.githubrepo, but there’s no clear “this repo actually builds/tests” guardrail visible from the file list. A simple CI workflow reduces regressions and maintenance toil. - This project includes a generator (
generator/generate.py) and generated package (cdp/): without a “generated code is up-to-date” check, drift is inevitable. - The tracked
.bish*files appear like tool state/caches; keeping them in git creates noise, merge conflicts, and accidental churn.
Plan (next 1–3 steps)
Step 1 — Add authoritative CI workflow
Create: .github/workflows/ci.yml
Actions:
- Use
actions/setup-pythonwith a small matrix (e.g., 3.10, 3.11, 3.12). - Install Poetry (either
pipx install poetryorsnok/install-poetry), thenpoetry install. - Run:
poetry run python -m compileall cdp generator test(fast sanity)poetry run pytest -q(if pytest is used; otherwise run existing test entrypoints—see “Suggested tests”)make gen-check(added in Step 2)
Concrete skeleton (adjust commands after confirming tooling in pyproject.toml):
name: ci
on:
push:
branches: [master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Install deps
run: poetry install --no-interaction
- name: Sanity compile
run: poetry run python -m compileall cdp generator test
- name: Lint/Type/Test
run: |
make lint
make type
make test
make gen-checkStep 2 — Unify commands in Makefile
Update: Makefile
Add targets that CI and developers can share (example; adjust to actual tools present in pyproject.toml):
.PHONY: lint type test gen gen-check
lint:
poetry run ruff check .
type:
poetry run mypy -p cdp
test:
poetry run pytest -q
gen:
poetry run python generator/generate.py
gen-check:
@git diff --quiet -- cdp || (echo "Generated code is out of date. Run: make gen"; exit 1)If the repo doesn’t use ruff/pytest, replace with existing scripts already present:
quick_check.py,minimal_test.py,comprehensive_test.py,test_import.pybasic_check.sh,env_check.sh, etc.
In that case, make test run the existing canonical checks, e.g.:
test:
poetry run python test_import.py
poetry run python minimal_test.py
poetry run python comprehensive_test.pyStep 3 — Remove/ignore .bish* and prevent reintroduction
- Update
.gitignoreto include:
.bish-index
.bish.sqlite
**/.bish-index
**/.bish.sqlite
- Remove them from git tracking (one-time cleanup):
git rm -r --cached .bish-index .bish.sqlite */.bish-index */.bish.sqlite .github/**/.bish-index .github/**/.bish.sqlite- (Optional but useful) Add a CI guard step in
ci.yml:
test -z "$(git ls-files | grep -E '(^|/)\.bish-(index|sqlite)$$')" || (echo "Do not commit .bish artifacts"; exit 1)Risks/unknowns
- Test runner ambiguity: There’s a
test/directory but no guaranteepytestis configured. We may need to use the repo’s existing scripts (minimal_test.py,comprehensive_test.py,test_import.py) as the test command. - Generator inputs: If
generator/generate.pydepends on external CDP schema downloads,gen-checkmay be non-deterministic in CI. If so, pin schema sources (commit the schema file or fetch a versioned URL) and make the generator reproducible. - Python version support: If the library supports older/newer versions, adjust the matrix accordingly after checking
pyproject.tomlclassifiers/constraints.
Suggested tests
Run locally (and mirror in CI):
- Install + import:
poetry installpoetry run python test_import.py
- Existing functional checks:
poetry run python minimal_test.pypoetry run python comprehensive_test.py(and/orcomprehensive_pf_test.pyif that’s the primary suite)
- Generation drift:
make genmake gen-check(should pass with clean git status)
Verification checklist (quick)
- PR triggers
.github/workflows/ci.ymlon GitHub Actions and completes on all Python versions. -
make testruns the same commands locally and in CI. -
make gen-checkfails when you modify generator output without regenerating. - No
.bish-index/.bish.sqlitefiles remain tracked (git ls-files | grep bishis empty).