Skip to content

Automation: Direction #117

@github-actions

Description

@github-actions

Last generated: 2026-02-21T06:48:09.407Z
Provider: openai
Model: gpt-5.2

Summary

This repo has a lot of automation scaffolding synced from a centralized .github repo, but it’s missing the most valuable “repo-local” automation: a single, authoritative CI workflow that (a) runs the project’s real checks (generator + import/tests + typing/formatting), (b) caches Poetry, and (c) produces artifacts (generated cdp/ diffs) to reduce maintainer toil. Current state also shows committed .bish-* databases and a stray editor backup file, which are automation noise and can destabilize PRs.

Direction (what and why)

  1. Add a repo-owned CI pipeline focused on this library’s correctness (generation + tests + packaging sanity), instead of relying on generic org workflows.
    Why: prevents drift, catches breakage earlier, and makes failures actionable for maintainers.
  2. Make “codegen drift” explicit: CI should fail if generated cdp/ output is out of date, and should upload the regenerated output as an artifact for easy review.
    Why: this repo’s core risk is mismatched protocol specs vs generated Python.
  3. Remove/ignore automation byproducts (.bish-*, *~) and stop them from reappearing.
    Why: reduces churn and accidental commits; improves signal in diffs.

Plan (next 1–3 steps)

1) Add a canonical GitHub Actions workflow for this repo

Create: .github/workflows/ci.yml with:

  • Triggers: pull_request, push on master, and workflow_dispatch.
  • Matrix: Python 3.9, 3.10, 3.11, 3.12 (align as needed with pyproject.toml classifiers).
  • Steps (concrete):
    1. actions/checkout@v4
    2. actions/setup-python@v5 with cache: "pip" (or Poetry cache below)
    3. Install Poetry (pin version, e.g. pipx install poetry==1.8.5)
    4. Cache Poetry + venv:
      • Cache ~/.cache/pypoetry
      • Cache .venv if you use in-project venvs (or rely on Poetry’s default)
    5. poetry install --no-interaction
    6. Run quick health checks already present in repo:
      • poetry run python -m compileall cdp generator
      • poetry run python test_import.py
    7. Run unit/regression tests:
      • If using pytest: poetry run pytest -q
      • If not, run existing scripts: poetry run python minimal_test.py and poetry run python comprehensive_test.py
    8. (Optional but recommended) type check if configured:
      • poetry run mypy -p cdp (only if mypy.ini is meaningful and passes today)
    9. Packaging sanity:
      • poetry build
  • Add concurrency:
    • concurrency: { group: ci-${{ github.ref }}, cancel-in-progress: true }

2) Add a “generated code is up-to-date” check + artifact

Extend .github/workflows/ci.yml (or add .github/workflows/codegen.yml) with a dedicated job:

  • Run generator:
    • poetry run python generator/generate.py (adjust args if required by generator/generate.py)
  • Then fail on diff:
    • git diff --exit-code cdp
  • Upload artifact if diff exists (helps reviewers):
    • Always upload cdp/ as artifact from the generation step (or upload only on failure via if: failure() but ensure the artifact still exists).

This makes PRs self-service: contributors can download the “expected” generated output.

3) Stop committing .bish-* and editor backups; clean existing noise

  1. Update .gitignore to include:
    • **/.bish-index
    • **/.bish.sqlite
    • **/*~
  2. Remove committed files in a single cleanup PR:
    • Top-level: .bish-index, .bish.sqlite
    • Under .github/, cdp/, docs/, examples/, generator/, test/, .github/workflows/
    • Remove .github/copilot-instructions.md~
  3. Add a small guard in CI to prevent reintroduction:
    • Step: test -z "$(git ls-files '**/.bish-index' '**/.bish.sqlite' '*~')"

Risks/unknowns

  • Generator invocation details: generator/generate.py may require downloading protocol JSON or specific args/environment; CI might need a pinned Chrome protocol source. If generation is non-deterministic or depends on network, the diff check could be flaky.
  • Test harness ambiguity: there’s no obvious pytest layout at top-level; tests may be script-based. The CI plan assumes minimal_test.py/comprehensive_test.py are reliable and non-flaky in CI.
  • Python version support: without inspecting pyproject.toml, the matrix could include unsupported versions; align matrix to what the project promises.
  • Org-synced workflows: some existing .github/workflows/* may already run overlapping checks. Adding ci.yml could duplicate work unless you disable/adjust triggers on the generic ones.

Suggested tests

Run locally (and in CI) in roughly this order:

  1. Dependency + import sanity
    • poetry install
    • poetry run python test_import.py
  2. Core functional scripts
    • poetry run python minimal_test.py
    • poetry run python comprehensive_test.py
  3. Codegen drift
    • poetry run python generator/generate.py
    • git diff --exit-code cdp
  4. Packaging
    • poetry build

Verification checklist (for the first PR implementing this direction):

  • ci.yml runs on PRs and on master pushes
  • A failing script/test produces a clear log and non-zero exit
  • Codegen job fails when cdp/ changes and uploads cdp/ artifact
  • .bish-* and *~ are ignored and CI blocks them if reintroduced
  • poetry build succeeds on at least one Python version (ideally all in matrix)

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