Skip to content
Production deploy with pending STAGED variables
hastor-hash
OP

25 days ago

Hello Railway Support,

We have a production service with three pending STAGED environment variables that must NOT be activated yet.

We need to deploy an exact commit from our connected GitHub repository using the Railway GraphQL API:

serviceInstanceDeployV2(serviceId, environmentId, commitSha)

Before proceeding, could you please confirm:

  1. Does this operation deploy the specified commit using only the currently LIVE environment configuration?
  2. Will the pending STAGED variables remain excluded from the new deployment's runtime?
  3. Will the pending environment patch remain STAGED and unchanged?
  4. Will the configured source branch and automatic deployment settings remain unchanged?
  5. Is there a safer officially supported procedure for deploying an exact commit without applying unrelated staged changes?

We have reviewed Railway's deployment and staged-change documentation, but could not find an explicit guarantee covering this combination.

We have not executed the deployment or applied the pending changes.

We need to confirm the behavior before modifying a production system containing important business data.

Thank you.

Solved

2 Replies

Status changed to Awaiting Railway Response Railway • 25 days ago


dizzydes90
EMPLOYEE

25 days ago

Staged variable changes only become part of the live environment when they are committed, either with the Deploy button on the staged changes banner or with the environmentPatchCommitStaged mutation. serviceInstanceDeployV2 is a separate service deployment and is not one of those commit paths, so the three staged variables stay pending and are not part of the new deployment's runtime.

Passing commitSha deploys that specific commit from the connected GitHub repository. The SHA is checked against the repo first, and an unknown SHA returns a "Commit not found" error without creating a deployment. The mutation takes only the service, environment and commit, with no branch or auto-deploy input, so it is the supported way to deploy an exact commit without applying staged changes.

One caution for later: the banner's Deploy button commits the whole environment's staged changeset at once, so avoid clicking it until those three variables are ready to go live. See Manage Services with the Public API and Staged Changes.


Status changed to Awaiting User Response dizzydes90 • 25 days ago


dizzydes90
EMPLOYEE

25 days ago

Yes to all four, and serviceInstanceDeployV2 is the supported way to do this. The mutation reads the service's live configuration and its committed variables, builds the commit you pass (commitSha from the connected repo), and creates the deployment with no patch attached. Staged changes are a separate record on the environment that only moves when someone commits it, from the Deploy button on the staged-changes banner or the environmentPatchCommitStaged mutation; a deployment never reads it. So the three staged variables on the service stay out of the new deployment's runtime, the staged patch stays STAGED and unchanged, and the source branch and auto-deploy trigger aren't touched, since the mutation takes only serviceId, environmentId and commitSha. For reference, a variable change committed on Oct 23 on this environment already went through while that patch stayed staged, which is the same separation. Two details: the deploy always runs as a full build with the build cache skipped, and the one thing to avoid while those changes are pending is the Deploy button on the staged banner, since that is the path that applies them.


Railway
BOT

18 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 18 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...