Skip to content

Commit 858ba60

Browse files
committed
refactor(core): move the core sync scripts to scripts/core-sync
Group scripts/ by purpose: core-sync/ for the bump and drift automation, e2e/ for the E2E gateway, and the build and check helpers at the top. scripts/README.md follows the same layout. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 21b7b4f commit 858ba60

12 files changed

Lines changed: 39 additions & 23 deletions

‎.github/workflows/core-drift.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
# Nightly comparison of core main with the pinned core tag; keeps the single
4-
# "Core main drift" issue current (scripts/drift-check.sh).
4+
# "Core main drift" issue current (scripts/core-sync/drift-check.sh).
55
name: core-drift
66

77
on:
@@ -42,18 +42,18 @@ jobs:
4242
# means the check itself broke, which the failure step records.
4343
- name: Check drift against core main
4444
run: |
45-
scripts/drift-check.sh --out drift-report.md || true
45+
scripts/core-sync/drift-check.sh --out drift-report.md || true
4646
test -s drift-report.md
4747
cat drift-report.md >>"$GITHUB_STEP_SUMMARY"
4848
4949
- name: Update the drift issue
5050
env:
5151
GH_TOKEN: ${{ steps.app-token.outputs.token }}
52-
run: scripts/update-drift-issue.sh drift-report.md
52+
run: scripts/core-sync/update-drift-issue.sh drift-report.md
5353

5454
- name: Report failure
5555
if: failure()
5656
env:
5757
GH_TOKEN: ${{ steps.app-token.outputs.token }}
5858
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
59-
run: scripts/report-failure.sh core-drift "$RUN_URL"
59+
run: scripts/core-sync/report-failure.sh core-drift "$RUN_URL"

‎.github/workflows/core-watch.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
# Opens one update proposal per new core release tag (scripts/open-bump-pr.sh).
3+
# Opens one update proposal per new core release tag
4+
# (scripts/core-sync/open-bump-pr.sh).
45
name: core-watch
56

67
on:
@@ -65,19 +66,19 @@ jobs:
6566
if [ -n "$INPUT_TAG" ]; then
6667
tags=$INPUT_TAG
6768
else
68-
tags=$(scripts/core-tags.sh)
69+
tags=$(scripts/core-sync/core-tags.sh)
6970
fi
7071
if [ -z "$tags" ]; then
7172
echo "No core tags newer than $(mise run --quiet core:version)."
7273
exit 0
7374
fi
7475
for t in $tags; do
75-
scripts/open-bump-pr.sh "$t"
76+
scripts/core-sync/open-bump-pr.sh "$t"
7677
done
7778
7879
- name: Report failure
7980
if: failure()
8081
env:
8182
GH_TOKEN: ${{ steps.app-token.outputs.token }}
8283
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
83-
run: scripts/report-failure.sh core-watch "$RUN_URL"
84+
run: scripts/core-sync/report-failure.sh core-watch "$RUN_URL"

‎mise.toml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ depends = ["check", "test", "build"]
147147

148148
[tasks."core:tags"]
149149
description = "List core release tags newer than the pin (newest pre-release only, --all for every tag)"
150-
run = "scripts/core-tags.sh"
150+
run = "scripts/core-sync/core-tags.sh"
151151

152152
[tasks."core:bump"]
153153
description = "Open the update proposal for a core tag: mise run core:bump -- <tag> [--dry-run]"
154-
run = "scripts/open-bump-pr.sh"
154+
run = "scripts/core-sync/open-bump-pr.sh"
155155

156156
[tasks."core:drift"]
157157
description = "Compare core main with the pin: mise run core:drift -- --out <report.md>"
158-
run = "scripts/drift-check.sh"
158+
run = "scripts/core-sync/drift-check.sh"

‎scripts/README.md‎

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,43 @@
22

33
The workflows under `.github/workflows/` run these scripts, most through a mise task, so each job can be run locally first. Scripts that write to GitHub take `--dry-run` and print what they would do instead.
44

5-
The core sync workflows use a GitHub App token from the `sdk-bot` environment (secrets `SDK_BOT_CLIENT_ID` and `SDK_BOT_PRIVATE_KEY`), which only `main` can deploy to. They never use `GITHUB_TOKEN`, because pushes and PRs made with it don't trigger CI.
5+
## `core-sync/`: keeping up with core
6+
7+
Move the core pin (`OPENSHELL_CORE_REF` in `mise.toml`) to new core releases, and watch core `main` for changes that will break the SDK.
8+
9+
The workflows use a GitHub App token from the `sdk-bot` environment (secrets `SDK_BOT_CLIENT_ID` and `SDK_BOT_PRIVATE_KEY`), which only `main` can deploy to. They never use `GITHUB_TOKEN`, because pushes and PRs made with it don't trigger CI.
610

711
| File | mise task | Purpose |
812
|------|-----------|---------|
9-
| `core-tags.sh [--all]` | `core:tags` | List NVIDIA/OpenShell release tags newer than the pin (`OPENSHELL_CORE_REF` in `mise.toml`): every stable tag, plus the newest pre-release when it is newer than all of them. |
13+
| `core-tags.sh [--all]` | `core:tags` | List NVIDIA/OpenShell release tags newer than the pin: every stable tag, plus the newest pre-release when it is newer than all of them. |
1014
| `open-bump-pr.sh <tag> [--dry-run]` | `core:bump` | Open the update proposal for one core tag: branch `core/<tag>`, pin change, regenerated bindings, refreshed copies of core files, proto diff in the body, labels `core-bump` plus `stable` or `prerelease`. Closes older pre-release proposals. |
1115
| `bump-pr-body.md` | | PR body template for `open-bump-pr.sh`. |
1216
| `drift-check.sh --out <file>` | `core:drift` | Compare core `main` with the pin: `buf breaking`, regenerate and run the unit tests, list the RPCs the SDK doesn't call. Writes the markdown report. |
1317
| `update-drift-issue.sh <report.md> [--dry-run]` | | Create, update, or close the single `Core main drift` issue from a report. |
1418
| `report-failure.sh <job> <run-url> [--dry-run]` | | Append a dated failure line to the drift issue. Called from `if: failure()` steps. |
1519
| `drift-issue.sh` | | Shared helpers for the two drift issue scripts (sourced, not run). |
16-
| `vendored-core-files.txt` | `conformance:check` | Files copied from core. `conformance:check` compares them with core at the pin; `open-bump-pr.sh` refreshes them. |
17-
| `fetch-core.sh <ref> <dir> <path>...` | | Copy files from core at a ref, for `conformance:check`. |
18-
| `start-gateway.sh <core-version>`, `stop-gateway.sh` | | Run the published gateway of a core version with the Docker driver for the E2E lane, then stop it and collect its log. |
19-
| `generate_python_proto.py` | `proto:gen` | Generate `src/openshell/_proto` from `proto/`. |
20-
| `verify-python-wheel.py` | `build` | Check the wheel's contents and version. |
2120

2221
| Workflow | Runs |
2322
|----------|------|
2423
| `core-watch.yml` (hourly) | `core-tags.sh`, then `open-bump-pr.sh` per tag |
2524
| `core-drift.yml` (nightly) | `drift-check.sh`, then `update-drift-issue.sh` |
26-
| `e2e.yml` (reusable) | `start-gateway.sh`, `mise run e2e`, `stop-gateway.sh` |
27-
| `ci.yml` | `mise run check`, `test`, `build`, and `e2e.yml` |
2825

2926
Bump PRs run E2E against their own pin, because `e2e.yml` defaults to `OPENSHELL_CORE_REF` on the PR branch.
27+
28+
## `e2e/`: the E2E gateway
29+
30+
| File | Purpose |
31+
|------|---------|
32+
| `start-gateway.sh <core-version>` | Run the published gateway of a core version with the Docker driver for the E2E lane, and register it as `e2e`. |
33+
| `stop-gateway.sh` | Stop it, collect its log, and remove its sandboxes. |
34+
35+
`e2e.yml` (reusable, called from `ci.yml`) runs `start-gateway.sh`, `mise run e2e`, then `stop-gateway.sh`.
36+
37+
## Build and checks
38+
39+
| File | mise task | Purpose |
40+
|------|-----------|---------|
41+
| `generate_python_proto.py` | `proto:gen` | Generate `src/openshell/_proto` from `proto/`. |
42+
| `verify-python-wheel.py` | `build` | Check the wheel's contents and version. |
43+
| `vendored-core-files.txt` | `conformance:check` | Files copied from core. `conformance:check` compares them with core at the pin; `core-sync/open-bump-pr.sh` refreshes them. |
44+
| `fetch-core.sh <ref> <dir> <path>...` | `conformance:check` | Copy files from core at a ref. |
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# of the open "Core main drift" issue, creating the issue when none is open.
1010
# Also writes the line to the job summary.
1111
set -euo pipefail
12-
# shellcheck source=scripts/drift-issue.sh
12+
# shellcheck source=scripts/core-sync/drift-issue.sh
1313
. "$(dirname "${BASH_SOURCE[0]}")/drift-issue.sh"
1414

1515
dry=0

0 commit comments

Comments
 (0)