Skip to content

feat: Atmos List Deployments, Pro Deployments Upload #1254

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

Draft
wants to merge 124 commits into
base: main
Choose a base branch
from

Conversation

milldr
Copy link
Member

@milldr milldr commented May 15, 2025

what

New command for atmos list deployments

Includes option for --upload

  • If --drift-enabled is true, only return deployments with settings.pro.drift_detection.enabled: true
  • If --upload, send the result to Atmos Pro

New arg for atmos terraform plan, --upload

  • Upload the result of a Terraform plan to Atmos Pro

Other changes:

  • Remove the logger that the pro client was using and replace with charmbracelet logger
  • Begin to refactor schema in to multiple files

why

atmos list deployments

  1. We want to build drift detection into Atmos Pro. In order to do this, we need to upload an object similar to the describe affected object. This object needs specific component deployments for specific stacks
  2. We do not have an existing type for the combination of a component and a stack. We previously have discussed introducing the term "Deployments". This PR creates that schema and term officially

Combine these concepts for drift detection: atmos list deployments --upload

This will find all deployments, filter to drift enabled, then upload to Atmos Pro

atmos terraform plan --upload

  • When we trigger a plan with Atmos Pro for drift detection, we need to return the result of whether or not there is drift to AP

remove logger

We want to use the canonical logging that the rest of the application is using

schema refactor

The single schema.go file was getting extremely long (failing lint warnings) and difficult to navigate. First steps to start to refactor that out into a file per domain for the schema.

references

screenshots

CleanShot 2025-05-22 at 17 42 22@2x

Summary by CodeRabbit

  • New Features

    • Introduced a CLI command to list deployments, with optional upload of deployment data to a remote API.
    • Added support for uploading deployment status after running Terraform plan, including drift detection results.
    • Enhanced deployment listing to filter and display only deployments with specific features enabled.
    • Output formats for deployment listings now support both styled tables and CSV for non-TTY environments.
    • Added new configuration schemas for Atlantis integration, custom CLI commands, markdown styling, and vendored components.
  • Bug Fixes

    • Improved error handling and standardized error messages for deployment listing and status upload operations.
  • Tests

    • Added comprehensive unit and integration tests for deployment listing, upload functionality, CLI output validation, and Terraform execution with deployment status upload.
  • Chores

    • Updated and added configuration and manifest files for new test scenarios and improved test coverage.
    • Refactored and reorganized internal data structures for deployment, workflow, and configuration schemas.
    • Removed embedded logger dependencies from API client code and tests for simplification.
    • Enhanced Git repository interface abstraction for deployment status upload.

Copy link

mergify bot commented May 15, 2025

💥 This pull request now has conflicts. Could you fix it @milldr? 🙏

@mergify mergify bot added conflict This PR has conflicts triage Needs triage labels May 15, 2025
@milldr milldr added the minor New features that do not break anything label May 15, 2025
@mergify mergify bot removed the conflict This PR has conflicts label May 15, 2025
Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 47.84689% with 218 lines in your changes missing coverage. Please review.

Project coverage is 51.33%. Comparing base (e4ff11c) to head (8f4e248).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
pkg/list/list_deployments.go 37.56% 109 Missing and 9 partials ⚠️
internal/exec/pro.go 57.69% 20 Missing and 2 partials ⚠️
cmd/list_deployments.go 32.14% 19 Missing ⚠️
pkg/git/git.go 0.00% 12 Missing ⚠️
pkg/list/format/table.go 0.00% 12 Missing ⚠️
pkg/pro/api_client_deployment_status.go 62.50% 6 Missing and 3 partials ⚠️
pkg/pro/api_client_deployments.go 66.66% 6 Missing and 3 partials ⚠️
internal/exec/terraform.go 68.00% 7 Missing and 1 partial ⚠️
pkg/pro/api_client.go 84.61% 6 Missing ⚠️
internal/exec/describe_affected.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1254      +/-   ##
==========================================
+ Coverage   51.08%   51.33%   +0.25%     
==========================================
  Files         243      247       +4     
  Lines       26230    26585     +355     
==========================================
+ Hits        13399    13648     +249     
- Misses      11180    11251      +71     
- Partials     1651     1686      +35     
Flag Coverage Δ
unittests 51.33% <47.84%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@goruha goruha temporarily deployed to feature-releases June 25, 2025 21:59 — with GitHub Actions Inactive
@autofix-ci autofix-ci bot temporarily deployed to feature-releases June 25, 2025 22:00 Inactive
@autofix-ci autofix-ci bot temporarily deployed to feature-releases June 25, 2025 22:00 Inactive
@autofix-ci autofix-ci bot temporarily deployed to feature-releases June 25, 2025 22:09 Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:16 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:17 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:20 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:21 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:22 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:23 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:26 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:26 — with GitHub Actions Inactive
@autofix-ci autofix-ci bot temporarily deployed to feature-releases June 25, 2025 22:27 Inactive
@autofix-ci autofix-ci bot temporarily deployed to feature-releases June 25, 2025 22:28 Inactive
@autofix-ci autofix-ci bot temporarily deployed to feature-releases June 25, 2025 22:36 Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:36 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:37 — with GitHub Actions Inactive
@goruha goruha temporarily deployed to feature-releases June 25, 2025 22:44 — with GitHub Actions Inactive
Copy link

mergify bot commented Jul 2, 2025

💥 This pull request now has conflicts. Could you fix it @milldr? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflict This PR has conflicts minor New features that do not break anything needs-cloudposse Needs Cloud Posse assistance release/feature Create release from this PR size/xl Extra large size PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants