Repository navigation
fix(showcase/railway): promote pins replicas via real ServiceInstanceUpdateInput shape (drop nonexistent ServiceMultiRegionConfigInput type) - #5756
Merged
Conversation
jpr5
requested review from
marthakelly,
mme,
ranst91 and
tylerslaton
as code owners
June 28, 2026 20:20
…l ServiceInstanceUpdateInput shape
Promote now re-asserts the SSOT multiRegionConfig replica count
({"us-west2":{numReplicas:6}} for harness-workers) alongside source.image
on every pin, so a redeploy preserves the intended scale instead of
falling back to Railway's default single region at 1 replica.
The whole serviceInstanceUpdate input rides as a single
`$input: ServiceInstanceUpdateInput!` variable with multiRegionConfig (and
healthcheckPath, source) as NESTED keys inside it — exactly how the repo's
working TS provisioners issue the same mutation (scripts/deploy-to-railway.ts
~501-509, scripts/provision-starter-fleet.ts ~594-602). Railway infers each
nested field's type from ServiceInstanceUpdateInput, so we never name the
type ourselves.
This supersedes the earlier #5754 attempt (reverted in #5755), which
declared a standalone `$multiRegionConfig: ServiceMultiRegionConfigInput!`
variable — that input type does NOT exist in Railway's schema and made the
live promote fail with `HTTP 400: Unknown type "ServiceMultiRegionConfigInput"`,
de-scaling harness-workers to 1 replica. Live-proven against real Railway
(promote run 28334807622 succeeded).
Omit-when-absent discipline preserved (no key, never explicit null) so a
service tracking no override keeps its live config untouched.
Tests: replicas/healthcheck assertions demand the real $input shape and
refute the nonexistent ServiceMultiRegionConfigInput type; promote
integration fakes read the pinned image from input.source.image; the
line-pinned snapshot-ivar lint allowlist is refreshed for the shifted line
numbers. Full bin/railway suite green (183 runs, 0 failures).
jpr5
force-pushed
the
fix/showcase-promote-replicas-v2
branch
from
June 28, 2026 20:30
789a1d0 to
fd4cda6
Compare
Contributor
Production Digest-Pinning AuditAll 41 services digest-pinned. Run 2026-06-28 13:31:22 PDT — 0 finding(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
bin/railwaypromote re-asserts the SSOT replica config on theserviceInstanceUpdatepin, but built the mutation by declaring a standalone variable:That input type does not exist in Railway's schema. The prior promote attempt (#5754) failed live with
HTTP 400: Unknown type "ServiceMultiRegionConfigInput", so the redeploy went out without the replica config and Railway de-scaledharness-workers(us-west2) from the SSOT-intended 6 replicas to 1. The wrong type name was a guess, never verified against the real schema.Real schema — source of truth
Railway's mutation is
serviceInstanceUpdate(serviceId: String!, environmentId: String!, input: ServiceInstanceUpdateInput!). The correct pattern — already used by this repo's own working TypeScript provisioners — is to pass the entire input object as one$input: ServiceInstanceUpdateInput!variable and put every field (source,healthcheckPath,region,registryCredentials,multiRegionConfig) as a nested key of that input. Railway resolves each nested field's type from theServiceInstanceUpdateInputschema, so you never name nested input types yourself:showcase/scripts/deploy-to-railway.ts~472-509 — buildsinstanceInput = { region, healthcheckPath, registryCredentials, ... }, thenserviceInstanceUpdate($serviceId, $environmentId, $input: ServiceInstanceUpdateInput!)passinginput: instanceInput.showcase/scripts/provision-starter-fleet.ts~575-602 — same single-$inputpattern.The replica shape itself (
multiRegionConfig.<region>.numReplicas, e.g.{ "us-west2": { "numReplicas": 6 } }) is confirmed inshowcase/scripts/railway-envs.ts~150-194, ~719-752 andrailway-envs.generated.json~161-169 — and was already correct in the Ruby. Only the GraphQL type declaration was wrong.The fix
showcase/bin/railway—RestoreCommand.build_update_image_mutation(~859):Before — one typed variable per optional key (and the invented type):
After — the whole input as one
ServiceInstanceUpdateInput!, fields nested:with
vars = { input: { source: { image: ... }, healthcheckPath: ..., multiRegionConfig: { "us-west2" => { numReplicas: 6 } } } }. Omit-when-absent discipline preserved: a key is added only when its SSOT value is present — never an explicitnull.Red → green proof
The replica/healthcheck spec assertions previously asserted the buggy
ServiceMultiRegionConfigInputshape — that wrong assertion is exactly why the bug shipped "green". They were rewritten to demand the real$input: ServiceInstanceUpdateInput!shape (and to assert the nonexistent type is absent).RED (new assertions vs the pristine buggy
bin/railway):GREEN (same spec, with the fix applied):
Full
bin/railwaysuite (after updating integration fakes to readinput.source.imageand refreshing the line-pinned ivar-lint allowlist for shifted line numbers):ruby -c showcase/bin/railway→ Syntax OK.Note
This fixes the GraphQL shape and the unit/integration coverage. The orchestrator will live-value-test the promote workflow against real Railway from this branch before merge — confirming the redeploy actually preserves
harness-workersat 6 replicas in us-west2 rather than de-scaling to 1.🤖 Generated with Claude Code