Skip to content

Automation: Direction #117

@github-actions

Description

@github-actions

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

  1. Add a minimal, deterministic CI pipeline in .github/workflows/ci.yml that runs on PRs/pushes to master.
  2. Standardize local+CI commands via Makefile (make lint, make type, make test, make gen-check).
  3. Stop committing build/cache artifacts (.bish-index, .bish.sqlite in multiple directories) and enforce this with .gitignore + (optional) a CI guard.

Why

  • The repo recently added many automation workflows synced from a central .github repo, 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-python with a small matrix (e.g., 3.10, 3.11, 3.12).
  • Install Poetry (either pipx install poetry or snok/install-poetry), then poetry 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-check

Step 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.py
  • basic_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.py

Step 3 — Remove/ignore .bish* and prevent reintroduction

  1. Update .gitignore to include:
.bish-index
.bish.sqlite
**/.bish-index
**/.bish.sqlite
  1. 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
  1. (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 guarantee pytest is 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.py depends on external CDP schema downloads, gen-check may 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.toml classifiers/constraints.

Suggested tests

Run locally (and mirror in CI):

  1. Install + import:
    • poetry install
    • poetry run python test_import.py
  2. Existing functional checks:
    • poetry run python minimal_test.py
    • poetry run python comprehensive_test.py (and/or comprehensive_pf_test.py if that’s the primary suite)
  3. Generation drift:
    • make gen
    • make gen-check (should pass with clean git status)

Verification checklist (quick)

  • PR triggers .github/workflows/ci.yml on GitHub Actions and completes on all Python versions.
  • make test runs the same commands locally and in CI.
  • make gen-check fails when you modify generator output without regenerating.
  • No .bish-index / .bish.sqlite files remain tracked (git ls-files | grep bish is empty).

Metadata

Metadata

Assignees

No one assigned

    Labels

    automationAutomation-generated direction and planning

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions