New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add atmos describe affected
CLI command. Update docs website
#274
Merged
Conversation
This file contains 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
osterman
reviewed
Dec 15, 2022
osterman
reviewed
Dec 15, 2022
osterman
reviewed
Dec 15, 2022
osterman
reviewed
Dec 15, 2022
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
osterman
previously approved these changes
Dec 15, 2022
osterman
reviewed
Dec 15, 2022
osterman
reviewed
Dec 15, 2022
mcalhoun
previously approved these changes
Dec 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
Benbentwo
approved these changes
Dec 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
osterman
approved these changes
Dec 15, 2022
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
atmos describe affected
CLI commandwhy
atmos describe affected
produces a list of the affected Atmos components and stacks given two Git commits. The command compares the final component sections (after all imports and deep-merging) for all Atmos components in all stacks, and produces a list of affected (changed) components in the stacks. The command also checks the changed files b/w the two commits and checks if the Terraform/Helmfile component folders are changed.For the first commit, the command assumes that the repo root is a Git checkout (and throws an error if the repo is not a Git repository, does not have
.git
folder).The second commit is specified on the command line using the
--ref
and--sha
flags.The
--ref
flag supports all standard Git References (https://git-scm.com/book/en/v2/Git-Internals-Git-References).the
ref
will be the default branch (e.g.main
) and the commit SHA will point to theHEAD
of the branch.examples
test
If the current local branch changes a component (
vars
orenv
section) in any YAML stack config files that defines configuration for the component (either inline or via imports), the command shows all the affected components/stacks and the affected section:If the current local branch changes any base component (including the
abstract
ones), the command shows all the affectedreal
components including all the components derived from the changed base component. For example, if we changed the variables for thetest/test-component
(which is a base for many derived components), the command shows the affected base and all the derived components:If the current local branch changes the
env
section (ENV vars) for any base or derived components, the command shows the affectedreal
components with theaffected_section: "env"
:If the current local branch changes a Terraform or Helmfile component (in
components/terraform
andcomponents/helmfile
folders), the command shows all the affected Atmos components/stacks and in theaffected
attribute it shows"affected": "terraform"
if the Terraform code for the component has been changed, or"affected": "helmfile" if the Helmfile code for the component has been changed. For example, if we change the
examples/complete/components/terraform/infra/vpc/main.tffile, it will affect all the Atmos components that provision the the
vpc` Terraform component: