Skip to content

ci: add s2-specs sync workflow and make update_specs portable - #164

Merged
shikhar merged 1 commit into
mainfrom
ci/add-specs-sync-workflow
Dec 3, 2026
Merged

shikhar merged 1 commit into
mainfrom
ci/add-specs-sync-workflow

Conversation

@shikhar

@shikhar shikhar commented Dec 3, 2026

Copy link
Copy Markdown
Member

Adds .github/workflows/sync_specs.yaml to handle s2-specs-update dispatches from s2-streamstore/s2-specs (which already dispatches to this repo) using the same single-PR pattern as the other SDKs:

  • Reuse a fixed branch (specs/update-s2-specs) with delete-branch: true and a workflow-level concurrency group (cancel-in-progress: false).
  • Trigger on repository_dispatch (s2-specs-update), workflow_dispatch, and push to main touching s2-specs (so stale sync PRs auto-close if main catches up via another PR).
  • Pin ref: main on actions/checkout and base: main on peter-evans/create-pull-request.
  • Replace BSD-only sed -i '' in update_specs with portable Python so the script runs cleanly on ubuntu-latest as well as macOS.

Related: s2-streamstore/s2-specs#66

@greptile-apps

greptile-apps Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Confidence Score: 4/5RetriggerView in Greptile

[Medium impact] The changes reach this SDK’s specs-sync automation and generated code.

The PR needs an App token for specs update PRs before merging.

Findings

  1. P1 Specs PRs skip CI ▶
Fix with agent prompt
### Issue 1
.github/workflows/sync_specs.yaml:55-56
Without a `token` override, `create-pull-request` uses `GITHUB_TOKEN`. PRs and branch updates made with that token do not trigger the repository’s `pull_request` workflows. Since `ci.yml` only runs on those events, generated changes receive no unit tests or integration checks. If those checks are required, the PR stays blocked.

Pass an App token, as the [Go sync workflow](https://github.com/s2-streamstore/s2-sdk-go/blob/HEAD/.github/workflows/sync_specs.yaml#L21-L32) does. This repository already creates one in `release-please.yml`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds automatic s2-specs updates and makes update_specs work on Linux and macOS.

  • Specs updates now open a pull request with regenerated Python files.
  • The generator rewrites protobuf imports on Linux and macOS.

Reviews (1) · Last reviewed commit: "ci: add s2-specs sync workflow and make ..." · Reviewed by Greptile

Comment on lines +55 to +56
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Specs PRs skip CI

Without a token override, create-pull-request uses GITHUB_TOKEN. PRs and branch updates made with that token do not trigger the repository’s pull_request workflows. Since ci.yml only runs on those events, generated changes receive no unit tests or integration checks. If those checks are required, the PR stays blocked.

Pass an App token, as the Go sync workflow does. This repository already creates one in release-please.yml.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/sync_specs.yaml
Line: 55-56

Comment:
**Specs PRs skip CI**

Without a `token` override, `create-pull-request` uses `GITHUB_TOKEN`. PRs and branch updates made with that token do not trigger the repository’s `pull_request` workflows. Since `ci.yml` only runs on those events, generated changes receive no unit tests or integration checks. If those checks are required, the PR stays blocked.

Pass an App token, as the [Go sync workflow](https://github.com/s2-streamstore/s2-sdk-go/blob/HEAD/.github/workflows/sync_specs.yaml#L21-L32) does. This repository already creates one in `release-please.yml`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

shikhar added a commit to s2-streamstore/s2-specs that referenced this pull request Dec 3, 2026
Add `"sdk/**"` to the `push` path filter in
`.github/workflows/dispatch.yaml` so pushes to `main` that modify `sdk/`
(such as `sdk/spec.md`, `sdk/rationale.md`, and `sdk/vectors/**`) also
dispatch `s2-specs-update` to downstream repositories.

Previously `paths: ["s2/**"]` predated `sdk/`, causing `sdk/**`-only
commits to skip downstream dispatch and leaving downstream submodules
and open sync PRs behind `main`.

Companion downstream PRs:
- s2-streamstore/docs#406
- s2-streamstore/s2#963
- s2-streamstore/s2-sdk-typescript#449
- s2-streamstore/s2-sdk-go#524
- s2-streamstore/s2-sdk-python#164
@shikhar
shikhar merged commit 9d656ee into main Dec 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant