Repository navigation
Conversation
…sinks Add internal/generate/promote_retry_test.go ahead of the #626 generator change, pinning the chosen design end to end: - a deploy with declared inputs and retries > 0 replaces its promote matrix with one job per promotion target (every declared environment except the first), gated on preflight's deploy_<name>_envs list, with its with: block reading per-environment resolved-input JSON; - each per-environment job gets an orchestrate-style retry chain gated on its predecessor failing, as do the single no-inputs deploy job and the prod deployment job; - every result sink judges the effective result across environments and attempts: the rollback gate (aggregate success, exhaustion with rescue exemption), DEPLOY_RESULT_<NAME> as one three-way aggregate value (failure/success/skipped), and the native deployments status; - the build-matrices step emits the envs list and per-environment inputs (executed against jq, mirroring the matrix script tests); - skipped-leg semantics and the byte-frozen retries 0 boundary (an explicit retries: 0 is byte-identical to an omitted retries). Rewrite the two pinned inertness tests rather than deleting them: DoesNotEmitRetryLadder becomes EmitsRetryLadder with the design rationale, and RetriesDoNotPerturbOutput keeps its byte-compare method at the retries 0 versus unset boundary. Add CLI-side tests driving the three aggregate values through the finalize gate (pointer hold, deploy row recording, all-skipped refusal). Closes #626 Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
Wire retries into the promote workflow (#626), to the design that keeps every retry scoped to the one environment whose attempt failed: - Extract writeRetryShimJob from the orchestrate generator's writeRetryJob so the promote ladders reuse the single copy of the shim emission: the !cancelled() status-function gate, the predecessor chaining, the name shape, needs: construction, uses:/with:/secrets ordering. - A deploy with declared inputs and retries > 0 replaces its promote matrix with one job per promotion target (every declared environment except the first), gated on preflight's new deploy_<name>_envs output, each with: block reading per-environment resolved-input JSON from the new deploy_<name>_inputs_<env> outputs. A matrix exposes one aggregate result, so a caller-side shim would redeploy every leg; per-environment jobs are the only caller-side shape that can retry just the failed environment. The job id carries a -to- infix (deploy-web-to-staging) because the pre-existing deploy-<name>-prod job would otherwise collide with a per-environment job for an environment literally named prod. - The single no-inputs deploy job and the prod deployment job are already single-environment and get plain ladders directly. - The build-matrices step emits the fan-out contract (the envs list and per-environment inputs) instead of the matrix when retries is set; the resolved-input computation is shared verbatim with the matrix path. - Rewire every result sink to the effective result across environments and attempts, via the shared retryShimJobIDs/effectiveSuccessCond/ effectiveFailureOrCancelledCond helpers: the rollback gate fires only when some environment's chain is exhausted and judges the deploy's own success on the aggregate across its chains; DEPLOY_RESULT_<NAME> stays one value (failure/success/skipped) that drives the finalize CLI gate exactly as the per-job result did; the native deployments status judges each chain's effective result. - retries 0 or unset emits byte-identical output everywhere: every new path is gated on retries > 0, and the byte-identical baseline goldens do not move. - on_failure stays abort-only and run_policy stays orchestrate-scoped (promote has no dependency skips to bind run_policy to; the force dispatch input is promote's continue-past-failure control). - Add the promote_per_env_retries actionlint feature-matrix case so real GitHub's parse of the fan-out (fromJSON with: reads, contains() gates, shim chaining, needs:/if: agreement across the aggregate sinks) is under permanent guard. Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
…dary Add promote/promote-retries-exhaustion.yaml, the executing scenario for the promote retry fan-out (#626). app declares manifest inputs plus retries: 1, so the promote fans it out per promotion target; a marker commit arms the app callback to fail test deploys, so the second dev-to-test promote exhausts app's test chain and the run concludes in failure with the asymmetric deploy outcome (infra deployed, app failed) that is the sole rollback-on-failure trigger. Finalize holds the test pointer at the pre-promote SHA through the DEPLOY_RESULT aggregate. The scenario states its boundaries honestly, the way 73-deploy-retries.yaml does: act v0.2.99 skips every later stage after a failed reusable-workflow job, so the rollback job's own execution and the fail-then-rescue path are not observable here and are asserted through the trigger boundary (plus the emitted YAML, unit tests, and the actionlint feature matrix) instead. The emitted assertions are verified against real generated output for this exact manifest. Register the scenario under the promote kind in the coverage registry. Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
…k-only Update the manifest reference's Policy fields to the #626 design: retries now applies to trunk runs and promotions alike, with a note explaining the per-environment fan-out (deploy-<name>-to-<env> jobs, one ladder per promotion target), the effective-result sinks (rollback exhaustion, DEPLOY_RESULT aggregate, deployments status), and the two stated consequences (rollout fail_fast/max_parallel do not apply while retries fans a deploy out; the publish marker runs no deploy legs). run_policy and on_failure remain orchestrate-only, with the reason: promote has no dependency skips to bind run_policy to, and the force dispatch input is promote's continue-past-failure control. Mirror the scope in the callbacks reference, the promote guide, the generated-workflows deploy strategy block, and the coverage matrix, and add the CHANGELOG entry. Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
…out target Review findings on the #626 branch, fixed: - A single-environment manifest fed to the promote generator (reachable per component through an environments: override, since both the generate command and Plan gate only the root config on IsSingleEnvironment) left an inputs deploy with retries with ZERO promotion chains, rendering a malformed DEPLOY_RESULT expression and a malformed rollback success line. Introduce perEnvFanOut as the single predicate for the fan-out (retries, declared inputs, and at least one environment to promote into) and gate the deploy jobs, the preflight outputs, and the build-matrices section on it: with no promotion target the deploy keeps the matrix form, whose chain carries no shims and whose sinks keep the bare forms. The sinks now derive ladder presence from the chain model (chainsHaveLadder) rather than the raw retries field, so the corner is byte-identical to a retry-free manifest. Pinned by TestPromoteRetry_SingleEnvironmentKeepsMatrix, both directly and through promoteTargets for the component route. - The prod-deployment ladder's chain was constructed inline at three sites; extract prodChain as the single source for its job id and retry binding, and collapse the native-deployments loop onto deployChains (byte-identical output). - State the two behavior notes for retries adopters in the CHANGELOG: the publish marker runs no deploy leg where the matrix previously invoked the callback with environment="release" (no recorded state ever depended on it), and a single-environment component keeps the matrix form. Signed-off-by: Ray Karnes <ray.karnes@stablekernel.com>
This branch has not been deployed
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.
What was wrong
retriesis documented for eachdeploysentry, but the promote generator ignored it. A promotion ran each deploy exactly once, while a trunk run retried it. Promote is the production path, so a transient deploy failure cost the most exactly where the retry was missing.The orchestrate retry ladder doesn't transfer as is. A promote deploy that declares
inputsis a matrix job across environments, and a matrix exposes one aggregateresult. A caller-side retry gated on that result would redeploy the environments that already succeeded.What changed
retries > 0replaces its promote matrix with one job per promotion target (for exampledeploy-web-to-staging). Each job reads its resolved inputs from new preflight outputs. Each gets its own retry chain, so only the environment that failed is retried. The-to-infix avoids a collision with the existingdeploy-<name>-prodjob.DEPLOY_RESULT_<NAME>stays one value (failure,successorskipped), so the finalize gate works as before;retries: 0or unset produces byte-identical output. Every new path is gated onretries > 0, and the baseline goldens don't move.on_failurestays abort-only andrun_policystays trunk-only for promote. Promote has no dependency skips forrun_policyto act on, and itsforceinput is already the continue-past-failure control. The docs say so.manifest.md,callbacks.md,guides/promote.md,generated-workflows.mdand the coverage matrix.Rebased onto #705
#705 gated promote's
dry_runpassthrough on the callee's declared inputs. This branch moves the deploywith:blocks into shared writers, so #705's rule now lives in those writers, and the new per-environmentwith:block follows the same rule.How it's tested
go build,go vet, gofmt andgo test ./...pass. The newpromote_retry_test.gopins:jq;retries: 0boundary.DEPLOY_RESULTvalues through the CLI gate.promote_per_env_retries.promote/promote-retries-exhaustion.yaml. It exhausts one environment's chain and checks that finalize holds the pointer. act stops after a failed reusable-workflow job, so the rollback job's own run and the rescue path are checked at the trigger boundary and in unit tests instead. It needs Docker, so CI runs it; it hasn't run locally yet.Closes #626