Skip to content

ci: fail when generated examples are out of date #11

Closed

Description

@erikist

Part of #2. CI should fail when the committed generated examples are stale, the counterpart of the generate job in Go's .github/workflows/build.yml at 9e072f9.

Do

  • Add a generate job to .github/workflows/build.yml:
    • install protoc 29.3 (e.g. arduino/setup-protoc@v3) and the pinned protoc-gen-prost 0.5.0, protoc-gen-tonic 0.5.0 and protoc-gen-prost-serde 0.4.0 (cargo install --locked, cached)
    • use the toolchain from rust-toolchain.toml
    • run make generate, then git diff --exit-code -- examples/. On failure, emit ::error::examples/src/gen is out of date; run 'make generate' and commit the result.
  • Pin versions explicitly in the workflow, with a comment saying they must match AGENTS.md, the Makefile and the factory image. In Go, drift in the generated output came from toolchain versions.
  • This issue asks you to change .github/workflows/**.

Acceptance criteria

  • The job passes on this PR.
  • Show it failing: push a commit that hand-edits a generated file, link the failing run in the PR, then revert the commit.

Activity

  1. erikist commented on Oct 9, 2026

    @erikist
    ContributorAuthor

    🔍 Note: #16 already added the generate job (make generate + git diff). What's left here: make sure the versions are pinned and cross-referenced as the issue says, the ::error:: message, and a demonstrated failing run.

  2. erikist commented on Oct 9, 2026

    @erikist
    ContributorAuthor

    🤖 Factory: picked up by dispatcher; working on branch factory/11-ci-fail-when-generated-examples-are.

  3. erikist commented on Oct 9, 2026

    @erikist
    ContributorAuthor

    🤖 Factory: Opened PR #23 (#23).

    The generate job's core behavior (from #16) was already in place; this PR
    cross-references the pinned protoc/protoc-gen-prost/protoc-gen-tonic/
    protoc-gen-prost-serde versions against AGENTS.md, the Makefile and
    Dockerfile.factory in the workflow comments, and demonstrates the check
    working: a commit that hand-edited a generated file made the generate job
    fail with the ::error:: message
    (https://github.com/stablekernel/protoc-gen-rust-mcp/actions/runs/38004952691),
    then a revert commit brought CI back to green
    (https://github.com/stablekernel/protoc-gen-rust-mcp/actions/runs/38005177579).

    Checks run locally: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo build --workspace, cargo test --workspace — all clean/passing. make generate confirmed the committed
    examples are current. Full test evidence is in the PR body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    factory:in-progressAn sf-factory worker is on itfactory:readyReady for the sf-factory to pick up

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions