Repository navigation
Description
Have a question? Please checkout our Slack Community or visit our Slack Archive.
Describe the Feature
We are starting to use workflows to apply a large number of components.
Given the size of a workflow, it is common for a step in the middle to fail due to user-error (copied the wrong command; missing command) or a configuration error for some step in the middle. Once corrected, it would be nice to restart the workflow from the failed step. This failed step may be a different number if the workflow steps were corrected.
It would be great to pass in an argument to the atmos workflow command (e.g. --from) that took a numbered or named step to start from. For example:
atmos workflow apply-all -f networking --from "terraform deploy tgw/spoke"
atmos workflow apply-all -f networking --from 5Expected Behavior
Given a named --from argument:
atmos workflow apply-all -f networking --from "terraform deploy tgw/spoke"- (Happy path) When command is found by name, it starts the workflow from the command (inclusive).
- When command is not found, it gives a helpful error message that the command is not found with exit code 1.
- When multiple commands match, it fails with exit code 1 and suggests using the numeric form of
--from. As a bonus, atmos could let you know the step numbers from the multiple matching steps.
Given a numbered --from argument:
atmos workflow apply-all -f networking --from 5- Steps are 1-indexed for humans (where
--from 1is the first step). - (Happy path) It starts the workflow from the indexed step (inclusive)
- When the steps is out of range (0, large values) a helpful error message is printed with exit code 1.
- Negative numbers are either disallowed or allow for reverse indexing from the end of the list.
Use Case
Use-cases include:
- Sanity check components that have downstream updates (e.g. apply all 20 networking components in a specific order)
- Recreate a cluster in a new region (create a cluster and apply all N common controllers)
Describe Ideal Solution
See above.
Alternatives Considered
Having to comment out steps and risk of accidentally committing.
Additional Context
Other notes
--from could nicely mirror a --to step.

Activity
osterman commentedon Dec 5, 2022
I like this proposal. Let's support an optional
idto identify each step, and that the step # can also be used. Additionally, when a workflow is run, each stepidshould be emitted so the end user knows how to restart easily from any point.fix(security): remediate 5 of 7 open Dependabot alerts
fix(security): remediate 5 Dependabot alerts (go-git, dompurify, nanoid)
fix(security): remediate 5 CodeQL/Dependabot alerts
fix(security): remediate 5 of 7 open Dependabot alerts
fix(security): remediate 6 of 8 open Dependabot alerts
fix(security): remediate 5 Dependabot alerts, 2 unpatched and deferred
fix(ai): close DX gaps found in atmos ai field test (cloudposse#2903)
fix(steps): resolve relative paths against step.WorkingDirectory (clo…
fix(version): exclude draft GitHub releases from Version Tracker reso…
fix(git): tolerate config errors for CI git-clone bootstrap pre-Cobra (…
Fix toolchain set, markdown text loss, and mise/aqua migration doc bu…