Repository navigation
Description
Part of the automation phase of NVIDIA/OpenShell#5287. It depends on #2 and #3 being on main.
Problem
The generated bindings in src/openshell/_proto are pinned to a core release through OPENSHELL_CORE_REF in mise.toml, which is v0.1.7 today. Nothing tells us when core publishes a new release, and nothing warns us about proto changes on core main that the next release will bring.
Proposal
Port the sdk-go automation (hack/automation/ and its workflows) and keep it as close to sdk-go as possible, so that a fix in one repository applies to the other. Here the scripts go in scripts/core-sync/, next to the E2E gateway scripts in scripts/e2e/ (#12); #11 tracks one layout for all SDK repositories.
What gets synced, and when:
- Core release tags.
core-watch.ymlruns hourly. It lists the core tags newer than the pin and opens one PR per tag on branchcore/<tag>, titledchore(core): track <tag>. The PR moves the pin, regenerates the bindings, refreshes the vendored conformance fixtures, and puts the proto diff in its body. It covers every new stable tag, plus the newest pre-release when that is newer than all of them. A newer pre-release proposal closes the older one. - Core
main.core-drift.ymlruns nightly. It doesn't open PRs. It runsbuf breakingbetween the pin andmainfor the protos we generate, regenerates the bindings frommain, and runs the unit tests. It also lists RPCs that no curated API covers, for information only. The results go into a singleCore main driftissue, which the workflow creates, updates, or closes. - A failed run appends a dated line to the drift issue (
report-failure.sh).
Each workflow wraps a script behind a mise task (core:tags, core:bump, core:drift), so it can be run locally. Every script that writes to GitHub takes --dry-run.
Python-specific changes from sdk-go:
- The pin lives in
OPENSHELL_CORE_REFinmise.toml, not inbuf.gen.yaml. - Regeneration runs
mise run proto:gen. CI'sproto:checkandconformance:checkthen guard the result. - The bump PR has the same structure as sdk-go's, with Python commands in the body.
Bot identity
The workflows must use a GitHub App token, not GITHUB_TOKEN. Pushes and PRs made with GITHUB_TOKEN don't trigger workflows, so bump PRs would get no CI.
Admin request, as in ai-openshell/sdk-go#2:
- An App installed on
sdk-python: either a dedicatedai-openshell-sdk-pythonApp, or the existingai-openshell-sdk-goApp withsdk-pythonadded. Permissions:contents: write,pull_requests: write,issues: write,metadata: read, and no webhook. - An
sdk-botenvironment that onlymaincan deploy to, holdingSDK_BOT_CLIENT_IDandSDK_BOT_PRIVATE_KEY. - Bot commits carry
Signed-off-by, so DCO passes.
Out of scope
These are tracked separately:
- E2E against the gateway of the proposed core version. The bump PR will call the reusable
e2e.ymlonce it exists. - Release tagging and PyPI publishing (sdk-go's
release-tag.yml).
Alternative: Dependabot
Dependabot could open PRs when core changes, for example with core added as a git submodule and the gitsubmodule ecosystem enabled. This needs an evaluation before we commit to it:
- A submodule tracks a branch tip, not release tags.
- A Dependabot PR only moves the pointer. It can't regenerate the bindings or refresh the fixtures, and workflows on Dependabot PRs get a read-only token and no secrets. Pushing the generated code would need a second workflow.
- sdk-go would have to switch too.
For now we follow sdk-go. If we switch to Dependabot later, we change both repositories together.
Acceptance criteria
-
core-watch.ymlandcore-drift.yml, the scripts underscripts/core-sync/, and a README with the script and workflow tables are onmain. - A dry run of
mise run core:bump -- <tag>works locally. - The App and the
sdk-botenvironment are configured. - With them in place,
core-watchopens a bump PR for the current core pre-release (v0.1.8-pre.3or newer), and CI runs on it. -
core-driftcreates theCore main driftissue.
Activity