You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address the review findings on the subgraph deploy and promote jobs
Three ways the promotion could move or clear the wrong thing:
- a 'Synced:' line the CLI prints in any form this does not recognise was read
as fully indexed, which moves the 'latest' tag onto a version that is still
indexing and deletes the one serving traffic. Only '100%' or an explicit
check mark counts now, and anything else means "not synced yet".
- clearing the flag deleted whatever the variable held. A deployment that
landed while the promotion was running now keeps its flag instead of being
dropped silently, never promoted and never reported.
- a tag listing that failed passed for 'no previous version', which reported
the promotion as done while leaving the old version undeleted. It throws,
and the flag survives for the next tick.
Nothing bounded a deployment that neither indexed nor failed - a paused
indexer, or a missing GOLDSKY_API_KEY_<ENV> failing the script before it can
report an outcome - so the schedule picked it up every 30 minutes forever. A
deployment now has PROMOTION_DEADLINE_HOURS (24h) to promote, after which the
watch is given up on with an error and the flag is cleared.
Also:
- the production workflow takes the setup action from the ref it is running
from: its workspace holds the release being deployed, whose '.github' is
whatever that release shipped - the action may not be in it at all
- the testing workflow falls back to BSNORG_ACTIONS_SECRET when no GH_TOKEN is
passed, and checks it up front rather than deploying a version it then
cannot flag, and which nothing would ever promote
- the deployed version reaches 'gh variable set' through the environment, and
is validated the way the schedule validates it before use
- a variable that does not hold a version annotates and skips that subgraph
rather than stopping every other network's promotion
- the schedule derives the env key and the variable name from the environment
and the network instead of carrying them as literal columns
- the promotion installs the subgraph workspace and the root, not all nine
- the '--env' choices move to 'deploy-envs.ts', shared with the Ormi script
- the setup action's 'build' input no longer explains itself with the ./build
directory, which is not what it produces
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .github/actions/setup-subgraph/action.yml
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,13 @@ description: "Install the monorepo dependencies and, when the built subgraph is
3
3
4
4
inputs:
5
5
build:
6
-
description: "Build the monorepo. Only the deployment needs it, as 'goldsky subgraph deploy' uploads the ./build directory - tagging an already deployed version does not."
6
+
description: "Run the monorepo build. The deployment needs the workspace packages the subgraph manifest and mappings pull in; the './build' directory 'goldsky subgraph deploy' uploads is not produced here, but by the 'graph build' that the 'deploy:<env>:<network>' npm script runs itself. Tagging an already deployed version needs neither."
7
7
required: false
8
8
default: "true"
9
+
workspace:
10
+
description: "Install this workspace and the repository root only, rather than every workspace of the monorepo. A job that just runs a script out of one package has no use for the others - and cannot build, as what a build would need is not installed."
11
+
required: false
12
+
default: ""
9
13
10
14
runs:
11
15
using: "composite"
@@ -28,7 +32,15 @@ runs:
28
32
turbo-${{ runner.os }}
29
33
- name: Install dependencies
30
34
shell: bash
31
-
run: npm ci
35
+
env:
36
+
WORKSPACE: ${{ inputs.workspace }}
37
+
run: |
38
+
set -euo pipefail
39
+
if [ -n "$WORKSPACE" ]; then
40
+
npm ci --workspace "$WORKSPACE" --include-workspace-root
Copy file name to clipboardExpand all lines: .github/workflows/deploy-prod-subgraph.yaml
+24-4Lines changed: 24 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ on:
4
4
workflow_dispatch:
5
5
inputs:
6
6
version:
7
-
description: "The subgraph version to deploy. For example, 1.34.0. The given number should correspond to an existing tag @bosonprotocol/subgraph@<VERSION>"
7
+
description: "The subgraph version to deploy. For example, 1.34.0. The given number should correspond to an existing tag @bosonprotocol/subgraph@<VERSION>. Only a release that already deploys on Goldsky can be deployed from here."
if [ "$waited_hours" -lt "$PROMOTION_DEADLINE_HOURS" ]; then
178
+
echo "::notice::$LABEL $VERSION has been waiting for promotion for ${waited_hours}h - checked again on the next run"
179
+
exit 0
180
+
fi
181
+
echo "::error::$LABEL $VERSION has been waiting for promotion for ${waited_hours}h, past the ${PROMOTION_DEADLINE_HOURS}h deadline - giving up on it. Once the deployment is fixed, set $VARIABLE back to a deployed version to watch it again."
0 commit comments