Skip to content

Automation: Direction #117

@github-actions

Description

@github-actions

Last generated: 2026-01-13T06:38:57.410Z
Provider: openai
Model: gpt-5.2

Summary

This repo recently gained a large set of org-synced GitHub workflows, but it still lacks a clear, repo-specific “automation contract” for: (1) how code is generated, (2) what CI must run and gate merges, and (3) how to keep generated output and protocol versions reproducible. Direction: tighten and simplify automation around generation + minimal CI gates, while reducing noise/cost from duplicated/overlapping workflows.

Direction (what and why)

  1. Make generation reproducible and verifiable in CI

    • This repository’s core artifact is generated (cdp/ from generator/). The main source of toil and drift is “generated code not matching the generator inputs/protocol version”.
    • Add a single, deterministic “regen check” job that fails if git diff shows unstaged changes after running generation.
  2. Establish minimal merge gates (fast + stable)

    • Current repo has many automation workflows synced from elsewhere; they don’t necessarily guarantee basic health (install, import, typecheck) on the actual supported Python versions.
    • Add/ensure a small, stable CI matrix: poetry install, python -m compileall, pytest (or existing tests), mypy if used.
  3. Reduce workflow overlap and runtime cost

    • There are multiple playwright loop workflows and auto-review workflows; these can generate noise and burn Actions minutes.
    • Keep the org-required ones, but add repo-level guardrails: path filters, concurrency, and explicit “CI” workflow as the authoritative gate.

Plan (next 1–3 steps)

1) Add a repo-specific automation contract + make generation check explicit

Add AUTOMATION.txt at repo root with:

  • Supported Python versions for CI
  • Canonical commands for:
    • install: poetry install
    • generate: poetry run python generator/generate.py (or whatever is correct)
    • tests: poetry run pytest (or python -m unittest if that’s what’s used)
    • typecheck: poetry run mypy ... if applicable
  • “Generated code must be up to date” policy (regen check in CI)

Concrete file: AUTOMATION.txt

2) Create a single “ci.yml” that gates merges and includes regen drift detection

Add a workflow that runs on PRs and pushes to master, with:

  • actions/checkout@v4
  • actions/setup-python@v5 for a small matrix (e.g. 3.10, 3.11, 3.12)
  • Install via Poetry (cache enabled)
  • Run:
    • poetry run python -m compileall cdp generator
    • poetry run python -m pip check (optional but quick)
    • poetry run python generator/generate.py then git diff --exit-code (regen check)
    • poetry run pytest -q (or run existing test scripts if pytest isn’t used)
    • poetry run mypy -p cdp (only if mypy is part of current expectations; mypy.ini exists)

Concrete file: .github/workflows/ci.yml

Also add concurrency to prevent redundant runs:

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

3) Add path filters / guardrails to reduce noisy automation runs

For heavy or non-essential workflows (especially the playwright loop variants), add:

  • on.pull_request.paths filters so they don’t run when only docs/markdown change
  • or if: guards so they only run on schedule / manual dispatch

Concrete targets (pick the worst offenders first):

  • .github/workflows/auto-copilot-org-playwright-loop*.yml*
  • .github/workflows/auto-copilot-playwright-auto-test.yml
  • .github/workflows/auto-copilot-test-review-playwright.yml

If you can’t modify org-synced workflows safely, add a repo-level convention: only the new ci.yml is required for branch protection, and the rest are informational.

Risks/unknowns

  • Generator command/options: I’m assuming generator/generate.py is the canonical entrypoint and writes to cdp/. If it requires inputs (e.g., protocol JSON download), the regen check must pin versions and/or cache artifacts.
  • Test framework: There’s a test/ folder and multiple *_test.py scripts at root; may not be pytest-ready. If pytest isn’t used, CI should run the existing scripts deterministically (e.g., python test_import.py, python minimal_test.py).
  • Poetry vs pip: pyproject.toml + poetry.lock suggests Poetry is canonical; ensure CI uses Poetry consistently (not both pip and poetry).
  • Large binary in repo: bfg-1.15.0.jar is big; can slow checkouts and scans. Not an automation blocker, but worth revisiting.

Suggested tests

Run locally and in CI:

  1. Install + import sanity

    • poetry install
    • poetry run python -c "import cdp; print('ok')"
  2. Generation drift check

    • poetry run python generator/generate.py
    • git diff --exit-code
  3. Existing repo tests

    • If pytest is viable: poetry run pytest -q
    • Otherwise run the existing scripts:
      • poetry run python test_import.py
      • poetry run python minimal_test.py
      • poetry run python simple_test.py
      • (optional) poetry run python comprehensive_test.py if stable
  4. Static checks

    • poetry run python -m compileall cdp generator
    • poetry run mypy -p cdp (only if it passes today; otherwise add incrementally)

Progress verification checklist

  • AUTOMATION.txt exists and matches actual commands used by contributors
  • .github/workflows/ci.yml runs on PRs and is set as a required status check
  • CI fails if generated code is out of date (regen drift)
  • CI completes in a predictable time (path filters/concurrency reduce redundant runs)
  • At least one test/import check runs successfully across the chosen Python 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