github cloudposse/atmos v1.166.0-rc.4

pre-releaseone day ago
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.

Don't miss a new atmos release

NewReleases is sending notifications on new releases.