fix(generate): send native-deployment required_contexts as a JSON array - #646
Merged
Conversation
The native GitHub Deployments create step passed required_contexts via
gh api --raw-field, which always transmits a scalar string. GitHub
received the literal "[]" and rejected the create with HTTP 422 ("is
not an array or null"), so the Deployment was never created and the
in_progress/status calls then 404'd on an empty id. The path is gated to
real GitHub and non-dry-run, so act/gitea and non-native lanes never
exercised it.
Assemble the create-deployment request body as JSON and pipe it via
gh api --input - so required_contexts is a real, explicit empty array.
The explicit [] means the deployment is not gated on any status
contexts; omitting the field would instead apply the repository's
default required contexts, a different and potentially blocking
behavior, so the empty-array intent is preserved.
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
The native-deployment create step now carries auto_inactive in the JSON
request body ("auto_inactive":<bool>) rather than a gh api --field
key=value flag. Scenario 57 still asserted the old auto_inactive=<bool>
form for both components, so its per-component deployment-reporting step
failed. Point the api/web contains and not_contains assertions at the
JSON-body form and refresh the prose that described the old shape.
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
The native GitHub Deployments create step passed
required_contextsviagh api --raw-field required_contexts='[]'.--raw-field(and--field) always transmit the value as a scalar string, so GitHub received the literal"[]"and rejected the create withHTTP 422: For 'properties/required_contexts', "[]" is not an array or null. The Deployment was never created, and the follow-on in_progress/status calls then 404'd on an empty deployment id.The step is gated to real GitHub (
server_url == 'https://github.com') and non-dry-run, so act/gitea and the non-native lanes never exercised it. The live fleet (cascade-example-dryrun lane) caught it on the seed-dev orchestrate, a real non-dry-run run.Fix
Assemble the create-deployment request body as JSON and pipe it via
gh api --input -sorequired_contextsis a real, explicit empty array:The explicit
[]is preserved deliberately: it means the deployment is not gated on any status contexts. Omitting the field would instead make GitHub apply the repository's default required contexts, a different and potentially blocking behavior. The in_progress and status steps are unchanged; they were only 404'ing because the create failed.Verification
TestNativeDeployments_RequiredContextsIsJSONArray(red before, green after): asserts the string formrequired_contexts='[]'is gone and a real"required_contexts":[]array plus--input -are emitted.bash -n; the JSON body verified to parse with a real empty array.31-native-deploymentsupdated to assert the JSON-body create step and anot_containsguard against the rejected string form.go build,go test(3655 pass),go test -race,golangci-lint runall clean; e2e module builds and vets clean.The real-GitHub 422 is only provable on the live fleet; cascade-example-dryrun is the runtime proof.