24 days ago
Could Railway clarify the supported GraphQL contract for environmentStageChanges(environmentId, input, merge:false), selecting id, environmentId, status, appliedAt and patch(decryptVariables:false)?
Observed fact: our client received HTTP 200, but strict receipt validation detected a non-null string unequal to the submitted expected value for one of three public diagnostic variables (each submitted with isSealed:false). We did not retain the historical field name or response value. Therefore the cause remains UNKNOWN; we are not asserting that masking caused the mismatch. Offline tests of our actual serializer/helper preserve the supplied public strings exactly. We stopped without accepting the receipt or proceeding to commit/deploy.
Please clarify:
- Can the mutation response for a public variable with isSealed:false contain a non-null string different from the submitted value?
- If yes, what documented encryption, masking, substitution or normalization causes this, and how should a client distinguish it from a genuine mismatch without persisting values?
- How does mutation patch(decryptVariables:false) differ from environment.config(decryptVariables:false), and from environmentStagedChanges.patch? In particular, what do null, missing value, missing isSealed and an opaque non-null string mean?
- What is the supported read-only method to verify exact equality of a staged public value with its submitted value before commit/deploy? If decryptVariables:true is required, can that read be safely scoped to the named non-sealed variables only, without revealing sealed or unrelated secret values?
The official CLI mutation selects only id/status (https://github.com/railwayapp/cli/blob/master/src/gql/mutations/strings/EnvironmentStageChanges.graphql). Its environment-config null-masking comment does not establish this mutation response contract. Please provide authoritative documentation or an explicit API-contract clarification.
This is a contract question only. No changes to any project, patch, configuration or deployment are requested. No credentials, configuration values, full logs, resource identifiers or attachments are included.
4 Replies
24 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 24 days ago
24 days ago
Based on the documented GraphQL contract, a public variable with isSealed:false should preserve the exact submitted string when read with decryptVariables:false. If the mutation response returns a different non-null string, that is not a supported public-value behavior. The contract does not define masking, normalization, substitution, or opaque rewriting for non-sealed public variables.
Safe interpretation:
null = no value set
missing field = not returned by that API shape
missing isSealed = not a valid public contract for that read path
any non-null opaque replacement string under decryptVariables:false = undocumented server behavior, not a valid public value
For exact equality checks before commit/deploy, the correct approach is to fetch the specific staged variables by name and compare raw strings, scoped only to the non-sealed values being checked. If decryptVariables:true is required, scope it only to those public variables and avoid sealed or unrelated secret values.
In other words: a public non-sealed value should not silently change under decryptVariables:false. If it does, that is an API inconsistency or bug, not a supported value transformation.
24 days ago
There's no public documentation for this contract, but the schema and the official CLI give some concrete pointers:
- Possibly yes. The CLI treats a value as masked if it is missing,
"","*****", orisSealed: true(compiler.rs). The"*****"check doesn't depend onisSealed, so non-decrypted reads can return a placeholder even for public variables. - The only signal I could find is that CLI heuristic. Railway doesn't document a masking rule.
- The mutation's
patchandenvironmentStagedChanges.patchare the same field on the sameEnvironmentPatchtype.Environment.configis a separate field with the samedecryptVariablesargument. The schema doesn't describe either one. patchonly acceptsdecryptVariables, so you can't scope a decrypted read to specific variables. For equality checks, the CLI callsenvironmentPreviewChangeSetand lets the server compare against decrypted state (engine.rs).
A definitive contract would have to come from the Railway team.
24 days ago
Thanks for the report. The reproduction is useful, but it still does not establish a supported API contract. A public variable with isSealed:false should not return a different non-null string under decryptVariables:false. The observed "" behavior is an undocumented redaction pattern, not a valid public-value contract. As a client, the safe interpretation is that "" means redacted/not verifiable, not that the value matched. Exact equality should therefore be validated by re-reading the specific staged variables per key and comparing raw strings, scoped only to the non-sealed values being checked. The mutation receipt should not be treated as authoritative for exact value equality unless Railway explicitly documents that behavior.
17 days ago
I reproduced this on a throwaway environment: the receipt masks every public variable, so it can't be used for equality checks.
Setup: account API token, environmentStageChanges(merge:false) with five shared variables, all isSealed:false (plain, unicode/whitespace, a ${{…}} reference, empty string, literal *****). Nothing was committed.
- Yes. Every value came back as
"*****", including the empty string, andisSealedwas absent from each entry. This happened withpatch(decryptVariables:false)andpatch(decryptVariables:true). - I found no documentation for this masking. The CLI treats
"*****"as "masked, preserve" regardless ofisSealed(https://github.com/railwayapp/cli/blob/master/src/iac/compiler.rs). A client should treat that exact string as "not verifiable", not as a mismatch. environmentStagedChanges.patchreturned the same masked output in both modes.environment.configonly shows committed state, so the staged keys aren't there at all.- Neither read path returned plaintext for staged public values with an API token, so I found no read-only way to verify them before commit.
Whether decryptVariables:true is meant to be ignored here is a question only Railway staff can answer.