Skip to content
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 manifest lists merge strategies #609

Merged
merged 11 commits into from
May 27, 2024
Merged

Conversation

aknysh
Copy link
Member

@aknysh aknysh commented May 26, 2024

what

  • Add Atmos manifest lists merge strategies
  • Update docs

why

  • Allow using the following list merge strategies in Atmos stack manifests:

    • replace - Most recent list imported wins (the default behavior).

    • append - The sequence of lists is appended in the same order as imports.

    • merge - The items in the destination list are deep-merged with the items in the source list. The items in the source list take precedence. The items are processed starting from the first up to the length of the source list (the remaining items are not processed). If the source and destination lists have the same length, all items in the destination lists are deep-merged with all items in the source list.

The list merging strategies are configured in atmos.yaml CLI config file in the settings.list_merge_strategy section

settings:
  # `list_merge_strategy` specifies how lists are merged in Atmos stack manifests.
  # Can also be set using 'ATMOS_SETTINGS_LIST_MERGE_STRATEGY' environment variable, or '--settings-list-merge-strategy' command-line argument
  # The following strategies are supported:
  # `replace`: Most recent list imported wins (the default behavior).
  # `append`:  The sequence of lists is appended in the same order as imports.
  # `merge`:   The items in the destination list are deep-merged with the items in the source list.
  #            The items in the source list take precedence.
  #            The items are processed starting from the first up to the length of the source list (the remaining items are not processed).
  #            If the source and destination lists have the same length, all items in the destination lists are
  #            deep-merged with all items in the source list.
  list_merge_strategy: replace

@aknysh aknysh added the minor New features that do not break anything label May 26, 2024
@aknysh aknysh self-assigned this May 26, 2024
@aknysh aknysh requested review from a team as code owners May 26, 2024 20:22
@aknysh aknysh requested review from kevcube and jamengual May 26, 2024 20:22
@aknysh aknysh requested a review from osterman May 26, 2024 20:24
@aknysh aknysh merged commit 3e0983a into master May 27, 2024
13 checks passed
@aknysh aknysh deleted the lists-merging-modes branch May 27, 2024 16:15
goruha added a commit that referenced this pull request Jun 3, 2024
* master:
  Update `atmos validate stacks` command (#611)
  Add Atmos manifest lists merge strategies (#609)
  Improve `atmos validate stacks` and `atmos describe affected` commands (#608)
  Use Darker Theme, Add File Component (#607)
  Update Atmos logs. Update docs (#605)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor New features that do not break anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants