Skip to content

Releases: cloudposse/atmos

v1.169.0

01 Apr 16:00
834cbdc
Compare
Choose a tag to compare
Update `!include` YAML function. Add unit tests. Update docs @aknysh (#1179)

what

why

Make Atmos to resolve the !include functions during the initial phase of YAML stack manifest processing (in contrast to the other YAML functions, which are processed during the very last stage of stack processing).

At this initial stage, the !include functions evaluate and substitute the contents of included files, converting them into the appropriate data types (e.g., string, boolean, map, or list) before assigning them to the corresponding sections or attributes in the Atmos stack configurations.

Key implications of this behavior:

  • The !include functions facilitate stack configuration reuse by enabling modularization of common configurations.
    These configurations can reside in separate local or remote files and be referenced in multiple stack definitions,
    promoting a DRY approach.

  • The functions preprocess YAML files before Atmos resolves stacks and components.
    This enables configuration Inheritance and deep-merging of stack parameters after the !include directives are expanded.

  • When transitioning from plain Terraform/OpenTofu to Atmos, !include allows seamless reuse of existing variable
    files (varfiles) by referencing them in the vars sections of Atmos components:

      my-component:
        vars: !include my-component.tfvars
Support the `--config` flag as an array of strings for `atmos validate editorconfig` @samtholiya (#1173)

what

  • Support the --config flag as an array of strings for atmos validate editorconfig

why

  • Be consistent with our config flag. With pr #1091 config would be an array of string at the root. And this should be reflected in validate editorconfig
Add golangci-lint rule to deprecate the `processArgsAndFlags` function @samtholiya (#1178)

what

  • We are restricting the usage of os.Getenv
  • We are also depricating usage/enhancing function processArgsAndFlags

why

  • we should start using viper.BindEnv for new env variables
Fix bug related to loading and merging atmos configurations files @haitham911 (#1175)

what

  • Fixed an issue where multiple configuration files were not loading correctly.

why

  • Previously, when loading files from multiple paths, only the first file found was loaded, ignoring the rest. This update ensures all configurations are properly merged
  • Now, all configuration files from each specified path are loaded and merged into the Atmos config

v1.168.1-rc.0

30 Mar 01:04
448bab5
Compare
Choose a tag to compare
v1.168.1-rc.0 Pre-release
Pre-release

🚀 Enhancements

Fix bug related to loading and merging atmos configurations files @haitham911 (#1175) ## What - Fixed an issue where multiple configuration files were not loading correctly. - Now, all configuration files from each specified path are loaded and merged into the Atmos config.

Why

  • Previously, when loading files from multiple paths, only the first file found was loaded, ignoring the rest. This update ensures all configurations are properly merged.

references

Summary by CodeRabbit

  • Refactor
    • Enhanced the configuration loading mechanism to improve error handling and ensure accurate processing of YAML configuration files.
  • Tests
    • Added new tests for configuration merging, including scenarios for missing configuration files and merging multiple configuration files.

v1.168.0

27 Mar 20:36
723a0c3
Compare
Choose a tag to compare
Update dry run for `atmos vendor pull` to support `ssh` + detailed SCP urls alignment @Listener430 (#1076)

what

This PR upgrades the output of dry run mode for vendor pull command.
After the change is applied, the dry run mode shows

  1. details on the SCP-style links converion,
  2. Injected tokens
  3. urls being vendored in a santized format
    yet there's no actual files download.

Dry run output

dry_run_output

Non-dry run output (actual vendoring)

actual_vendoring

Add SSM param assume role @mcalhoun (#1170)

what

  • Add the ability to assume a role when reading/writing AWS SSM param store

why

  • In order to be able to read values cross-account
Refactor `list components` and fix lints @Cerebrovinny (#1162)

what && why

  • Refactor list components for new lint standards
Convert SCP-style URLs into proper SSH URLs for `atmos vendor pull`@Listener430 (#1149)

what

  • Convert SCP-style URLs into proper SSH URLs for atmos vendor pull

why

  1. Sometimes vendoring urls are provided in a non-standard, SCP-style Git URLs formt which omits a scheme and use a colon for separation. In order Go’s URL parser can process them, they have to be converted into fully qualified URLs (using SSH or HTTPS).
  2. Vendoring now honors tokens for Gitlab and Bitbucket for https vendoring
  3. Masking of sensative data in debug statements in Custom Detector
  4. Links without explicit scheme were indication were not handled correctly, e.g. this one failed
    git::[email protected]:cloudposse/terraform-null-label.git?ref={{.Version}}
  5. credentials for http vendoring were read from the token only for github, but not fot bitbucket and gitlab

Testing

Use this to run only test cases relevant for this PR
$ go test -v -run '^TestCLICommands/(atmos_vendor_pull_using_SSH|atmos_vendor_pull_with_custom_detector_and_handling_credentials_leakage)$' github.com/cloudposse/atmos/tests

non-standard SCP-style links handling
github ssh vendor pull

Token injections were tested wtih bitbucket and gitlab (http) for private and public repos + ssh vendoring for both.
Listing them here as there are no dedicated tests/repos available for testing at bitbucket/gitlab.

gitlab over ssh private repo
gitlab over https private repo with a token
bitbucket public repo over ssh
bitbucket private repo over ssh
bitbucket https public repo with token set and no token set works
bitbucket https private repo
gitlab over https public repo no auth

Fix Vendoring Issues with Globs and Symlinks @Listener430 (#984)

what

  • Fix Vendoring Issues with Globs and Symlinks

why

  • double star globs were not correctly matching multiple segments in all cases
  • vendoring without a shallow depth is 2x slower
  • the //. is an esoteric expression to copy all files from the root. Rather than expect users to know this, we default it where it makes sense.

Case 1. Globs

    included_paths:
      - "**/{demo-library,demo-stacks}/**/*.{tf,md}"
    excluded_paths:
      - "**/demo-library/**/*.{tfvars,tf}"

Case 2. Globs without double stars upfront

included_paths:
        - "/weather/*.md"

Case 3. Shallow globs and folder exclusion

included_paths:
       - "**/demo-localstack/*"
       - "**/demo-library/**"
     excluded_paths:
       - "**/demo-library/**/stargazers/**"
       - "**/demo-library/**/*.tf"

v1.167.0

25 Mar 02:12
6b301d3
Compare
Choose a tag to compare
Update `atmos.yaml` config for Terraform/OpenTofu to enable passing the generated `varfile` to `tofu init` @aknysh (#1163)

what

  • Update atmos.yaml config for Terraform/OpenTofu to enable passing the generated varfile to tofu init
  • Fix Atmos TUI (launched using atmos command) to always process Go templates and Atmos YAML functions
  • Update atmos.Component template function
  • Add unit tests
  • Update docs

why

components:
  terraform:
    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_COMMAND' ENV var, or '--terraform-command' command-line argument
    command: tofu
    init:
      # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_INIT_PASS_VARS' ENV var, or '--init-pass-vars' command-line argument
      pass_vars: false

With this configuration, executing atmos terraform init component-1 -s nonprod will pass the generated varfile to the init command:

Executing command:
tofu init -reconfigure -var-file nonprod-component-1.terraform.tfvars.json
  • Fix Atmos TUI (launched using atmos command) to always process Go templates and Atmos YAML functions. This is in addition to the changes in this PR #1157

  • Update atmos.Component template function

    • Don't process remote state (terraform outputs) for Helmfile components

references

Label stacked PRs @osterman (#1158)

what

  • Label/unlabel a PR as stacked if it doesn't merge into main

why

  • Make it easier to identify the stacked PRs
Enhance Atmos Configuration with atmos.d Support and Import Functionality @haitham911 (#1085)

what

  • Support the atmos.d convention for atmos.yaml configuration, allowing automatic inclusion of configuration files from the atmos.d directory.
  • Made the path to atmos.d configurable within atmos.yaml, enabling users to specify custom directories for additional configurations.
  • Add support for the import key inside `atmos.yaml, allowing users to define a list of locations (local files, directories using glob patterns, and remote URLs) to import configurations from.
  • process YAML directives !env are correctly processed and stored in Viper. Key changes

why

  • atmos.d convention allows automatic inclusion of configuration files
  • Import key enables pulling configurations from multiple sources (local, remote, and glob patterns)
  • handle Atmos custom functions !env
suppress artifactory debug logging @mcalhoun (#1167)

what

_ Suppress debug logging in the Artifactory SDK when calling Artifactory methods in the Atmos store. Only show these logs if Atmos logging level is set to debug.

why

  • It is too noisy on the CLI if we leave this logging enabled.

v1.166.1-rc.0

25 Mar 00:41
76aed74
Compare
Choose a tag to compare
v1.166.1-rc.0 Pre-release
Pre-release
Label stacked PRs @osterman (#1158) ## what - Label/unlabel a PR as stacked if it doesn't merge into main

why

  • Make it easier to identify the stacked PRs

Summary by CodeRabbit

  • New Features
    • Automated pull request labeling now helps distinguish the intended target branch. Pull requests not aiming at the primary branch are tagged as "stacked" for easier tracking, while those targeting the primary branch have this label removed.
Enhance Atmos Configuration with atmos.d Support and Import Functionality @haitham911 (#1085) ## what * Support the `atmos.d` convention for `atmos.yaml` configuration, allowing automatic inclusion of configuration files from the atmos.d directory. * Made the path to atmos.d configurable within atmos.yaml, enabling users to specify custom directories for additional configurations. * Add support for the `import` key inside `atmos.yaml, allowing users to define a list of locations (local files, directories using glob patterns, and remote URLs) to import configurations from. * process YAML directives !env are correctly processed and stored in Viper. Key changes

why

  • atmos.d convention allows automatic inclusion of configuration files
  • Import key enables pulling configurations from multiple sources (local, remote, and glob patterns)
  • handle Atmos custom functions !env

references

Summary by CodeRabbit

  • New Features

    • Introduced modular configuration imports that allow users to load settings from remote URLs, local files, and recursive directories.
    • Added a new CLI command to run tests and enhanced default configuration settings.
    • Added new configuration sections for logging, Terraform, Helmfile, and stacks.
    • New configuration file created for Atmos CLI with a base import path set to ./.
    • Enhanced CLI commands with detailed configurations for components, stacks, and workflows.
    • New section in the Atmos CLI configuration documentation outlining the functionality of importing other configurations.
  • Refactor

    • Streamlined the configuration loading and merging process for a more efficient and maintainable experience.
    • Enhanced the test suite with a modular, parameterized testing approach for better organization and clarity.
  • Documentation

    • Updated docs with a new "Imports" section detailing functionality and best practices for configuration imports.
  • Tests

    • Expanded test coverage for configuration import scenarios with improved logging and structured test cases.
    • Introduced a comprehensive suite of unit tests for the configuration import functionality.

🚀 Enhancements

suppress artifactory debug logging @mcalhoun (#1167) ## what

Suppress debug logging in the Artifactory SDK when calling Artifactory methods in the Atmos store. Only show these logs if Atmos logging level is set to debug.

why

It is too noisy on the CLI if we leave this logging enabled.

Summary by CodeRabbit

  • New Features

    • Enhanced the logging system to dynamically switch between detailed debug output when in DEBUG mode and minimized log output during normal operations.
    • Introduced a silent logging component that suppresses unnecessary log entries, streamlining the log output.
  • Tests

    • Implemented a new test to validate the logging configuration across various log levels.
    • Added tests for the functionality of the silent logging component to ensure expected behavior.

v1.166.0

21 Mar 16:24
34cc497
Compare
Choose a tag to compare
Add CLI flags to `atmos terraform` commands to control processing the templates and YAML functions in Atmos stack manifests @aknysh (#1157)

what

why

Flag Description Alias Required
--process-templates Enable/disable Go template processing in Atmos stack manifests
when executing terraform commands.
atmos terraform plan <component> -s <stack> --process-templates=false.
If the flag is not passed,
template procesing is enabled by default.
no
--process-functions Enable/disable YAML functions processing in Atmos stack manifests
when executing terraform commands.
atmos terraform apply <component> -s <stack> --process-functions=false
If the flag is not passed,
functions procesing is enabled by default.
no
--skip Skip processing a specific Atmos YAML function
in Atmos stacks manifests when executing terraform commands.
To specify more than one function,
use multiple --skip flags, or separate the functions with a comma:
atmos terraform plan <component> -s <stack> --skip=eval --skip=include
atmos terraform apply <component> -s <stack> --skip=terraform.output,include
no
add `terraform plan-diff` command @mcalhoun (#1144)

what

  • Create a new command that shows what has changed between two plan files

why

  • Helps validate that an "approved plan" hasn't changed prior to deployment

example output

Diff Output
===========

Variables:
----------
~ location: Stockholm => New Jersey

Resources:
-----------

data.http.weather
  ~ id: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
  ~ url: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
  ~ response_body: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

  ~ response_headers: {
    ~ Content-Length: 350 => 304
    ~ Date: Thu, 13 Mar 2025 19:28:58 GMT => Thu, 13 Mar 2025 19:29:17 GMT
}
  ~ body: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

local_file.cache
  ~ content: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         


Outputs:
--------
~ url: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
~ weather: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

~ location: Stockholm => (sensitive value)
Google secret manager store implementation @shirkevich (#1034)

what

  • Added Google Secret Manager (GSM) support as a new store type in Atmos
  • Implemented two type identifiers: google-secret-manager and its alias gsm
  • Added comprehensive documentation for GSM configuration and usage
  • Added test coverage for GSM store implementation

why

  • Expands Atmos' store capabilities to support Google Cloud Platform users
  • Provides a secure way to manage secrets in GCP environments

references

Fix snapshots extra slashes @haitham911 (#1148)

what

  • Improved collapseExtraSlashes to normalize URLs by collapsing redundant slashes while preserving http:// and https:// structure.
  • Remove base_path empty value from atmos.yaml

why

  • Ensures valid URL formatting
Add integration tests for templates in Atmos stack manifests @aknysh (#1142)

what

  • Add integration/acceptance tests for templates in Atmos stack manifests
  • Add unit tests

why

  • Ensure the Go templates are evaluated in all Atmos sections
  • Ensure the Go templates are evaluated when executing atmos terraform generate backend and atmos terraform init commands
  • Increase Codecov test coverage
Lint check for dogsleds and duplicated code @osterman (#1140)

What

  • Raise errors on dogsledding:
    _, _, isActive, err := getUserData() // Too many unused return values
  • Raise errors on duplicate code

Why

  • Too many return values; should use structs.
  • Identifies repeated logic that should be refactored.
Change the level and severity of `function-result-limit` @osterman (#1138)

what

  • Change severity from error to warning
  • Increase limit to 3 from 2

why

  • 2 is a bit extreme, many functions return 3-4 arguments.
  • 3 return arguments is still intelligible (according to @osterman) ;)
  • We should set the guidelines but not enforce it yet as an error since many existing functions return way more than this
Use official `golangci` action together with CodeQL @osterman (#1137)

What

  • Replace reviewdog with the official golangci-lint-action due to challenges in limiting reports to modified lines using filter-mode.
  • Output in SARIF format and upload results to GitHub CodeQL for enhanced analysis.

Why

  • Achieve better control over which linting issues cause check failures.
  • Utilize CodeQL's UI for improved lint review capabilities, including inline annotations and the ability to dismiss findings.
  • Enable status checks for linting to be based on CodeQL analysis results, streamlining the workflow.

references

Improve `yq` utils to handle nil config pointers @Cerebrovinny (#1155)

what

  • Added handling for nil configuration pointers in the YQ expression evaluation utilities.

why

  • When atmosConfig is passed as nil to EvaluateYqExpression(), it would panic with a nil pointer dereference when trying to access atmosConfig.Logs.Level. This happens in scenarios where the configuration hasn't been loaded yet or when the function is called from contexts where configuration isn't available.
Update atmos schema @samtholiya (#1123)

what

  • We are updating the schema to support dynamic structures. So schemas can support the following schema:
# atmos.yaml
# Validation schemas (for validating atmos stacks and components)
schemas:
  # JSON Schema to validate Atmos manifests
  atmos: # for backward compatibility
    # Can also be set using 'ATMOS_SCHEMAS_ATMOS_MANIFEST' ENV var, or '--schemas-atmos-manifest' command-line arguments
    # Supports both absolute and relative paths (relative to the `base_path` setting in `atmos.yaml`)
    manifest: "stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json"
  stacks:
    match:
    - stacks/***/**.{yml,yaml}
    schema: https://...
  config:
    match:
    - atmos.{yml,yaml}
    - atmos.d/***/**.{yml,yaml}
    schema: ...
  vendor:
    match:
    - ...
Read more

v1.166.0-rc.7

21 Mar 01:01
34cc497
Compare
Choose a tag to compare
v1.166.0-rc.7 Pre-release
Pre-release
Add CLI flags to `atmos terraform` commands to control processing the templates and YAML functions in Atmos stack manifests @aknysh (#1157) ## what
  • Add CLI flags to atmos terraform commands to control processing (enable/disable) the templates and YAML functions in Atmos stack manifests
  • Add unit tests
  • Update docs

why

Flag Description Alias Required
--process-templates Enable/disable Go template processing in Atmos stack manifests
when executing terraform commands.
atmos terraform plan <component> -s <stack> --process-templates=false.
If the flag is not passed,
template procesing is enabled by default.
no
--process-functions Enable/disable YAML functions processing in Atmos stack manifests
when executing terraform commands.
atmos terraform apply <component> -s <stack> --process-functions=false
If the flag is not passed,
functions procesing is enabled by default.
no
--skip Skip processing a specific Atmos YAML function
in Atmos stacks manifests when executing terraform commands.
To specify more than one function,
use multiple --skip flags, or separate the functions with a comma:
atmos terraform plan <component> -s <stack> --skip=eval --skip=include
atmos terraform apply <component> -s <stack> --skip=terraform.output,include
no

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new command-line options for enhanced control over Terraform executions, allowing users to enable/disable template and YAML function processing and skip specific functions.
    • Added new YAML configuration files for deployment settings and non-production environments.
  • Documentation

    • Updated help and usage guides for Terraform commands with clearer flag descriptions and improved instructions.
    • Restructured documentation format for various Terraform commands to enhance clarity and usability.
  • Chores

    • Upgraded Atmos tool versions in container builds and CI integrations.
    • Updated various dependency versions to enhance overall stability and performance.
add terraform plan-diff command @mcalhoun (#1144) ## what

Create a new command that shows what has changed between two plan files

why

Helps validate that an "approved plan" hasn't changed prior to deployment

example output

Diff Output
===========

Variables:
----------
~ location: Stockholm => New Jersey

Resources:
-----------

data.http.weather
  ~ id: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
  ~ url: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
  ~ response_body: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

  ~ response_headers: {
    ~ Content-Length: 350 => 304
    ~ Date: Thu, 13 Mar 2025 19:28:58 GMT => Thu, 13 Mar 2025 19:29:17 GMT
}
  ~ body: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

local_file.cache
  ~ content: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         


Outputs:
--------
~ url: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
~ weather: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

~ location: Stockholm => (sensitive value)

Windows-Specific Logic

This PR includes some error handling to deal with two distinct Windows-specific issues that caused intermittent test failures:

Process Termination & Goroutine Synchronization

Windows handles process termination differently than Unix systems. When intercepting os.Exit() calls in tests, Windows may not properly schedule the goroutine to completion, causing deadlocks when waiting for both exit codes and goroutine completion signals.

 // Handle Windows specially - just wait for exit code  
   if runtime.GOOS == "windows" {
       return <-exitCodeCh
   }

This specialized Windows path ensures we only wait for the exit code without expecting the goroutine to signal completion, avoiding deadlocks specific to Windows process termination behavior.

File System Timing Issues

Windows file systems sometimes experience timing inconsistencies where file handles aren't fully released or contents aren't completely flushed before subsequent operations start.

// Add a small delay to ensure Windows file operations are complete
   time.Sleep(500 * time.Millisecond)

This small delay before the on-the-fly plan-diff ensures previous Terraform operations fully complete their file I/O before starting the next test phase, preventing race conditions in file access.

These changes significantly improve test reliability on Windows environments while preserving the original test behavior on Unix platforms.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new “plan-diff” command that compares two Terraform plans, highlighting differences in variables, resources, and outputs.
    • Improved error reporting that now provides distinct exit statuses when plan differences are detected.
  • Documentation

    • Updated CLI help output and online guides to include detailed usage instructions, flag requirements, and examples for the new plan-diff functionality.

v1.166.0-rc.6

18 Mar 00:58
03ac289
Compare
Choose a tag to compare
v1.166.0-rc.6 Pre-release
Pre-release

🚀 Enhancements

Remove unused flag code in root @samtholiya (#1103) ## what
  • There is no use of this code here because we set the values already here

why

  • We were suspecting this code to not work anyway and cleaning up the code is much better, it avoids confusion. Especially when we already set the values here

Note: We are not refactoring the whole logging logic here. This is just a clean up that would help us reduce the pr size. Also reducing the places where we repeat setting the values

references

Summary by CodeRabbit

  • New Features

    • Introduced a unified logging helper that provides consistent terminal messaging.
    • Enhanced logging configuration capabilities to allow dynamic adjustments based on environment variables and command-line inputs.
  • Refactor

    • Centralized the logging configuration to pull settings directly from the configuration, improving error handling and message consistency.
    • Added new functions for parsing command-line flags and setting log configuration.
  • Tests

    • Updated CLI log outputs and error messages to reflect revised severity labels and environment details.
    • Adjusted expected outputs in test cases to align with new logging behavior.
  • Chores

    • Removed deprecated environment variable support for overriding logging settings.
Improve yq utils to handle nil config pointers @Cerebrovinny (#1155) ## what

Added handling for nil configuration pointers in the YQ expression evaluation utilities.

why

When atmosConfig is passed as nil to EvaluateYqExpression(), it would panic with a nil pointer dereference when trying to access atmosConfig.Logs.Level. This happens in scenarios where the configuration hasn't been loaded yet or when the function is called from contexts where configuration isn't available.

references

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced YAML expression evaluation to gracefully handle absent configurations, preventing unexpected errors and ensuring reliable, consistent results.
    • Updated default logging behavior improves stability during expression processing.

v1.166.0-rc.5

17 Mar 13:08
8fbf56b
Compare
Choose a tag to compare
v1.166.0-rc.5 Pre-release
Pre-release
Fix snapshots extra slashes @haitham911 (#1148) ## what - Improved collapseExtraSlashes to normalize URLs by collapsing redundant slashes while preserving http:// and https:// structure. - Remove ` base_path` empty value from atmos.yaml

why

  • Ensures valid URL formatting

Summary by CodeRabbit

  • Refactor

    • Revised configuration settings by removing the base_path key for improved simplicity.
  • Bug Fixes

    • Enhanced URL normalization to correctly handle extra consecutive slashes, ensuring proper protocol formatting and robust handling of various URL patterns.
  • Tests

    • Added a new test function to validate the behavior of the URL normalization process with various input cases.
Add integration tests for templates in Atmos stack manifests @aknysh (#1142) ## what
  • Add integration/acceptance tests for templates in Atmos stack manifests
  • Add unit tests

why

  • Ensure the Go templates are evaluated in all Atmos sections
  • Ensure the Go templates are evaluated when executing atmos terraform generate backend and atmos terraform init commands
  • Increase Codecov test coverage

v1.166.0-rc.4

13 Mar 17:21
63dff98
Compare
Choose a tag to compare
v1.166.0-rc.4 Pre-release
Pre-release
Lint check for dogsleds and duplicated code @osterman (#1140) ## What - Raise errors on **dogsledding**: ```go _, _, isActive, err := getUserData() // Too many unused return values ``` - Raise errors on **duplicate code**

Why

  • Too many return values; should use structs.
  • Identifies repeated logic that should be refactored.

Summary by CodeRabbit

  • Chores
    • Enhanced internal code quality measures by updating static analysis rules to better identify redundant code patterns and potential assignment issues. These adjustments contribute to improved long-term maintainability and robustness of the software without affecting the user interface.
Change the level and severity of `function-result-limit` @osterman (#1138) ## what - Change severity from error to warning - Increase limit to 3 from 2

why

  • 2 is a bit extreme, many functions return 3-4 arguments.
  • 3 return arguments is still intelligible (according to @osterman) ;)
  • We should set the guidelines but not enforce it yet as an error since many existing functions return way more than this

Summary by CodeRabbit

  • Chores
    • Adjusted internal settings to allow increased flexibility in function outputs while reducing the alert level for designs that previously exceeded limits.
Use official `golangci` action together with CodeQL @osterman (#1137) ## What - Replace **reviewdog** with the official `golangci-lint-action` due to challenges in limiting reports to modified lines using `filter-mode`. - Output in **SARIF format** and upload results to **GitHub CodeQL** for enhanced analysis.

Why

  • Achieve better control over which linting issues cause check failures.
  • Utilize CodeQL's UI for improved lint review capabilities, including inline annotations and the ability to dismiss findings.
  • Enable status checks for linting to be based on CodeQL analysis results, streamlining the workflow.

Known Limitations

[!WARNING]
Small patches and line numbers do not always match line numbers in lint results, in which case those lines won't be raised

First, I was able to reproduce it. whitespace reports an issue at the "wrong" line: The change is on 301 and the report on 302, but 302 has not changed so golangci-lint skips the report.
It's not really the "wrong" line because the report is related to an empty line before the }, this empty line is only a problem because }.
We can see that as a more global limitation of the new-from-patch and new-from-rev: if a report is not directly on the line that changes then the report is skipped.
So technically, there is no possible fix for that.
The only way for those options to work, with reports that are not at the same places as the changes, is to use --whole-files

golangci-lint run --whole-files --new-from-rev main

references

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Enhanced automated workflow permissions for improved security.
    • Streamlined the linting process by removing the previous linting job.
    • Adjusted code quality checks for test files to better target error detection.
    • Improved warning messages to clearly communicate unsupported configuration settings.
    • Simplified linting command to run on all Go files in the project directory.
    • Added new jobs for linting and semantic versioning checks in the CodeQL workflow to enhance code quality.
    • Updated comments and guidance for handling large pull requests in the Mergify configuration.

🚀 Enhancements

Fix OCI Tests & Vendoring @haitham911 (#1093) ## what - [x] Ensure atmos exits non-zero when vendoring from OCI fails - [x] Inject GitHub token on requests to `ghcr.io` - [x] Do not `.gitignore` generated files in `test/fixtures` because then we cannot delete untracked files (regression) - [x] Do not commit files vendored in tests (e.g. `tests/fixtures/scenarios/vendor/test-components/`) - [x] Support `tar+gz` OCI artifacts - [x] Respect the `artifact-type: application/vnd.atmos.component.terraform.v1+tar+gzip` - [x] Check that files are actually vendored - [x] Support backward compatibility `tar` artifacts - [x] Use OCI fixtures managed by atmos for testing

why

  • We accidentally deleted the OCI repo that was used for testing fixtures
  • The OCI implementation was incomplete, lacking an vendor specific artifact-type
  • Files were not checked for OCI vendoring

references

Fork go-homedir into Atmos @haitham911 (#1139) ## what - Forked [mitchellh/go-homedir](https://github.com/mitchellh/go-homedir) into the Atmos organization. - Added a LICENSE file to ensure compliance with the original repository's licensing terms. - Created an ATTRIBUTIONS.md file to credit the original author. - Updated references in Atmos to use the new forked repository instead of the original ## why

references

Summary by CodeRabbit

  • New Features

    • Enhanced home directory functionality now reliably retrieves and expands user paths, ensuring seamless cross-platform support.
    • Updated dependency management improves overall module handling.
  • Documentation

    • Added comprehensive usage guidance, attributions, and licensing details for the new home directory library.
Update `overrides` section behavior in imports and inline @aknysh (#1122) ## what
  • Update overrides section behavior in imports and inline
  • Add acceptance tests for the overrides section for many scenarios (overrides at the stack level, team level, inline and in imports)
  • Update docs
  • Update Go to 1.24.0 and fix some issues in the code (1.24.0 is more strict about the Go format functions always requiring the format as the first argument)
  • Add unit tests

why

  • Importing the overrides did not cover all possible scenarios (e.g. when importing the overrides for the imported components, the inline overrides for the same stack were not taken into account). This PR fixes this and adds acceptance tests for all scenarios
  • Update the Share Data Between Components doc to describe how the !terraform.output YAML function can (and should be) used to to read the outputs (remote state) of components directly in Atmos stack manifests

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced configuration processing distinguishes inline and imported overrides for greater deployment flexibility.
    • Added sample configuration files for various environments (development, production, staging, sandbox, and test) with team-specific settings.
    • Introduced new YAML function !terraform.output for improved data sharing in stack manifests.
    • New workflows added for testing various Atmos commands across multiple environments.
  • Documentation

    • Updated documentation to showcase improved data sharing and new output functionalities.
  • Chores

    • Upgraded Atmos CLI and related dependencies for enhanced performance.
    • Improved command output formatting for clearer error messages.
    • Added .gitignore entry to exclude specific directories from version control.
  • Tests

    • Introduced test cases to validate configuration override behavior across environments.
    • Added tests for the aboutCmd and supportCmd commands to ensure correct output.
    • New test functions added for ProcessYAMLConfigFile, ValidateStacks, and workflow command to enhance coverage.
    • Comprehensive tests for markdown utility functions to ensure correct behavior.
    • New tests for handling invalid configurations and edge cases in YAML processing.
    • Added tests for vendor configuration handling and workflow execution.