#atmos-dev (2024-12)

Discuss atmos core development (golang). If you want to help out, reach out to <@UB2EH889X>

2024-12-02

Vinny avatar

good for review https://github.com/cloudposse/atmos/pull/815 @Andriy Knysh (Cloud Posse)

2024-12-05

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

For those interested, here’s the current Atmos development roadmap: https://github.com/orgs/cloudposse/projects/34/views/1

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
04:00:47 PM

/github subscribe cloudposse/atmos pulls

 avatar
04:00:47 PM

:white_check_mark: Subscribed to cloudposse/atmos. This channel will receive notifications for pulls

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@haitham911eg should we close https://github.com/cloudposse/atmos/pull/715

#715 DO NOT MERGE (needs review and testing). Break error into parts

what

This pull request introduces error handling . Key changes include adding IError interface, updating error handling to use the new IError type, and setting the log level for detailed debug information.

why

Basically break error to parts. the parts that are info to info, and those that are debug to debug

issue url

https://linear.app/cloudposse/issue/DEV-340/change-log-level-of-output-when-imports-are-not-found-to-hide-this

Summary by CodeRabbit

New Features
• Enhanced logging capabilities for command execution based on CLI configuration.
• Improved error reporting with structured messages and debug information. • Bug Fixes
• Updated error handling to provide clearer insights into issues encountered during stack configuration retrieval.

haitham911eg avatar
haitham911eg

yes we should close it

#715 DO NOT MERGE (needs review and testing). Break error into parts

what

This pull request introduces error handling . Key changes include adding IError interface, updating error handling to use the new IError type, and setting the log level for detailed debug information.

why

Basically break error to parts. the parts that are info to info, and those that are debug to debug

issue url

https://linear.app/cloudposse/issue/DEV-340/change-log-level-of-output-when-imports-are-not-found-to-hide-this

Summary by CodeRabbit

New Features
• Enhanced logging capabilities for command execution based on CLI configuration.
• Improved error reporting with structured messages and debug information. • Bug Fixes
• Updated error handling to provide clearer insights into issues encountered during stack configuration retrieval.

haitham911eg avatar
haitham911eg

its already done on another PR

1
github3 avatar
github3
04:16:43 PM

what

atmos_autocomplete

• Refactor pkg/list functions to include configuration initialization so that the outputted component and stack lists could be easily used by Cobra valid argument functions and flag completion functions • Add ValidArgsFunction and RegisterFlagCompletionFunc for stacks and components in the following commands:
atmos describe component
atmos describe dependents
atmos docs
atmos list components
atmos list stacks
atmos validate component
atmos vendor pull

why

• Create a positive user experience by making it easier to view and autocomplete stacks and components

testing

• Conducted make build after each command autocompletion addition and tested

references

Cobra Autocompletion

Summary by CodeRabbit

Release Notes

New Features
• Enhanced command-line experience with autocompletion for component and stack names across multiple commands. • Bug Fixes
• Improved error handling and messaging for various commands when fetching components and stacks. • Chores
• Streamlined command logic by removing unnecessary initializations and focusing on core functionalities.

25 other checks have passed

1
github3 avatar
github3
07:13:14 PM

What

• Added improved workflow failure handling with clear error messages • Added --from-step flag to resume workflows from specific steps • Added documentation and help text for workflow failure handling • Added example workflow demonstrating failure scenarios

Why

• Makes it easier to debug and fix workflow failures by showing: • Which step failed • The exact command that failed • How to resume from the failed step • Saves time by allowing users to resume workflows from failed steps instead of restarting from beginning • Improves user experience with clear guidance on how to recover from failures

Example workflow demonstrating the feature:

workflows:

test-1: description: “Test workflow with intentionally failing steps” steps: - name: “step-1” type: shell command: “echo ‘This step will succeed’ && exit 0”

  - name: "step-2"
    type: shell
    command: "echo 'This step will fail' &amp;&amp; exit 1"
  
  - name: "step-3"
    type: shell
    command: "echo 'This step should not execute'"

Tests

Last test after requested changes @Erik Osterman (Cloud Posse) @aknysh
When step-2 fails, users will see:
CleanShot 2024-11-08 at 20 00 10

references

DEV-2717

Summary by CodeRabbit

New Features
• Enhanced error handling during workflow execution, providing detailed error messages and instructions for resuming from failed steps.
• Updated command documentation to include failure handling and resume functionality with examples. • Documentation
• Added a new section on “Workflow Failure Handling and Resume” to clarify user experience during workflow failures.
• Clarified the “Stack Precedence” section to improve understanding of stack definitions in workflows.

27 other checks have passed

2
 avatar
07:13:14 PM
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Dan Miller (Cloud Posse) this was something you had requested, I think.

Dan Miller (Cloud Posse) avatar
Dan Miller (Cloud Posse)

great! I’ll try it out next time I use workflows

github3 avatar
github3
12:13:28 AM

what

• Upload preview site static files as github actions artifact

why

• This is the first step of previed deployment strategy refactoring to support preview deployments from forks

references

https://linear.app/cloudposse/issue/DEV-2677/fix-preview-deployments-for-prs-from-forked-repositories

Summary by CodeRabbit

New Features
• Introduced a new GitHub Actions workflow for automating the deployment of a preview environment for the website.
• Added a step to the website deployment workflow for uploading build artifacts, improving retrieval and debugging processes. • Bug Fixes
• Enhanced error handling to ensure the workflow raises an error if no files are found during the artifact upload process. • Style
• Made formatting changes to the website/README.md file by adding additional blank lines after the “Getting Started” section.

26 other checks have passed

 avatar
09:09:55 AM
github3 avatar
github3
12:46:37 AM

what

• Implementing automatic detection and import of templated files (.yaml.tmpl or .yml.tmpl) in Atmos • Adding fallback to regular .yaml or .yml files when templated versions aren’t found • Simplifying import configuration by removing the need to explicitly specify .tmpl extensions • Maintaining backward compatibility with existing import configurations

why

• Improves developer experience by reducing manual configuration overhead

Summary by CodeRabbit

Release Notes

New Features
• Enhanced file import handling to support multiple YAML extensions, including templates.
• Introduced new functions for improved configuration file pattern matching and searching.
• Added a new package for centralized file extension constants.
• Automatic detection of template files during imports, streamlining the import process. • Bug Fixes
• Improved error handling for file searches and imports, providing clearer error messages when no matches are found. • Refactor
• Updated existing functions to accommodate new file extensions and refined logic for file type detection.
• Adjusted error reporting for component configuration processing. • Chores
• Removed deprecated constant declarations related to file extensions.

27 other checks have passed

 avatar
12:46:37 AM
github3 avatar
github3
02:17:50 AM

what

• Enable Go templates in metadata.terraform_workspace and metadata.terraform_workspace_template sections

why

• Allow using Go templates to dynamically construct Terraform workspaces for Atmos components

components: terraform: test: metadata: # Point to the Terraform component component: “test” # Override Terraform workspace using Go templates terraform_workspace: ‘{{ .vars.tenant }}-{{ .vars.environment }}-{{ .vars.stage }}-test’

Summary by CodeRabbit

Release Notes

New Features
• Enhanced support for Go templates in Atmos stack manifests, including a new metadata section.
• Improved Atlantis integration with detailed configuration methods and examples. • Bug Fixes
• Updated Atmos tool version to ensure access to the latest features and improvements. • Documentation
• Expanded documentation on Go template processing phases and performance considerations.
• Clarified workflows and configuration options for Atlantis integration. • Chores
• Updated dependency versions for improved performance and stability.

26 other checks have passed

 avatar
01:36:59 PM

2024-12-06

github3 avatar
github3
09:32:45 AM

what

• Test new preview deployment workflow

why

• Support preview deployments from forks

references

https://linear.app/cloudposse/issue/DEV-2677/fix-preview-deployments-for-prs-from-forked-repositories

26 other checks have passed

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Hrmmmmm… @Andriy Knysh (Cloud Posse) looks the brew formulae failed on the latest release.

https://github.com/Homebrew/homebrew-core/actions/runs/12200296819/job/34036272201

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

atmos 1.118.0 #492090

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Igor Rodionov I think we have a race condition, due to the awkward way the workflows are written.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
    uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

the test workflow calls go autoreleaser

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
  homebrew:
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

The build cannot wait on the tests to finish, thus the homebrew build fails

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
#721 fix: Cut release only when all tests passed

what

• Run release job only if all tests passed

why

• Do not release failed binaries

references

https://github.com/cloudposse/atmos/actions/runs/11307359580

Summary by CodeRabbit

New Features
• Reintroduced an automated release job that enhances the deployment process, triggered on push events. • Bug Fixes
• Corrected indentation and structure in the Docker job for improved workflow execution.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Which we didn’t merge

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I approved it

Igor Rodionov avatar
Igor Rodionov

@Erik Osterman (Cloud Posse) merged

1
github3 avatar
github3
03:32:45 PM

what

• Run release job only if all tests passed

why

• Do not release failed binaries

references

https://github.com/cloudposse/atmos/actions/runs/11307359580

Summary by CodeRabbit

New Features
• Reintroduced an automated release job that enhances the deployment process, triggered on push events. • Bug Fixes
• Corrected indentation and structure in the Docker job for improved workflow execution.

26 other checks have passed

 avatar
03:32:45 PM

2024-12-07

Vinny avatar

https://github.com/cloudposse/atmos/pull/798 @Andriy Knysh (Cloud Posse) good to QA

1
github3 avatar
github3
03:16:39 PM

what

This pull request introduces error handling . Key changes include adding IError interface, updating error handling to use the new IError type, and setting the log level for detailed debug information.

why

Basically break error to parts. the parts that are info to info, and those that are debug to debug

issue url

https://linear.app/cloudposse/issue/DEV-340/change-log-level-of-output-when-imports-are-not-found-to-hide-this

Summary by CodeRabbit

New Features
• Enhanced logging capabilities for command execution based on CLI configuration.
• Improved error reporting with structured messages and debug information. • Bug Fixes
• Updated error handling to provide clearer insights into issues encountered during stack configuration retrieval.

18 other checks have passed

 avatar
03:16:39 PM
github3 avatar
github3
03:18:59 PM

what

New Feature interactive package manager for vendor pull
interactive shell for atmos vendor pull –everything • Support –everything flag for test non TTY mod run atmos vendor pull --everything </dev/null |& cat > atmos_vendor_pull.log

screenshots

example for process with error
2024-12-08 1443_16-vendor_utils go - atmos WSL Ubuntu - Visual Studio Code
example for process successfully done
image (2)

why

Build an interface for a package manager using bubbletea

references

https://linear.app/cloudposse/issue/DEV-270/atmos-vendor-pull-uxhttps://linear.app/cloudposse/issue/DEV-2716/support-atmos-vendor-pull-everything • Closes #792 • Closes #301

Summary by CodeRabbit

Summary by CodeRabbit

New Features
• Enhanced user interface for vendor commands utilizing the Bubble Tea framework.
• New --everything flag for the vendorPullCmd command, allowing users to vendor all components in one go.
• Improved functionality for managing vendor package installations, including enhanced error handling and progress feedback.
• Updated configuration files (atmos.yaml) to utilize the new --everything option in vendor commands.
• Expanded documentation on vendoring commands, including examples and OCI registry support in vendor-manifest.mdx. • Bug Fixes
• Refined validation logic for command-line flags to prevent conflicts. • Refactor
• Modularized code structure for better readability and maintainability.
• Improved error handling and logging for vendor operations. • Documentation
• Revised CLI Commands Cheat Sheet and other documentation to include the new --everything flag for vendor commands.
• Enhanced the vendor-manifest.mdx documentation with detailed examples.

26 other checks have passed

1
 avatar
03:18:59 PM
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@haitham911eg why did we close this? It’s not yet implemented in any other PR

 avatar
03:38:11 PM
haitham911eg avatar
haitham911eg

@Erik Osterman (Cloud Posse) Pull request reopened

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse) would love to get this merged before Monday

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@haitham911eg please resolve the conflicts

haitham911eg avatar
haitham911eg

@Andriy Knysh (Cloud Posse) reolved

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@haitham911eg I reviewed the PR, it looks good and the new functionality is nice. Please see and address the comments

1
haitham911eg avatar
haitham911eg

fixed

haitham911eg avatar
haitham911eg
haitham911eg avatar
haitham911eg
github3 avatar
github3
03:20:47 PM

what

Checked all commands that –help usage doesn’t require stack configurations. Here is the summary

modules_issues_status

Please note - had to make func ProcessCommandLineArgs exportable for use to check for help flag earlier in terraform and helmfile, thus all the changes in the rest of exec files (changed p to capital).

Found out that terraform and helmfile modules indeed have the issue (i.e. check configs before showing help + version).

This is how it looked before for terrafrom
broken_terraaform
And the same issue is with helmfile
broken_helmfile

After the fix for terraform

terraform_fixed_1_of_2
terraform_fixed_2_of_2

And fixed for helmfile looks like this
helmfile_fixed

why

We need to show help message and version/upgrade information irrespective if configs are in place or not.

references

Linear issue - <urlhttps://linear.app/cloudposse/issue/DEV-2797/any-usage-of-help-should-not-require-stack-configurations>

Summary by CodeRabbit

Release Notes

New Features
• Introduced a new function for printing upgrade messages with styled output, enhancing user experience when updates are available. • Improvements
• Enhanced command-line argument processing across various commands, improving error handling and visibility of functions.
• Added version checking logic to prompt users for upgrades when newer versions are available. • Bug Fixes
• Streamlined error handling and control flow in multiple command execution functions, ensuring consistent behavior. • Documentation
• Improved comments and formatting for better code readability and understanding.

26 other checks have passed

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse) please review

what

Checked all commands that –help usage doesn’t require stack configurations. Here is the summary

modules_issues_status

Please note - had to make func ProcessCommandLineArgs exportable for use to check for help flag earlier in terraform and helmfile, thus all the changes in the rest of exec files (changed p to capital).

Found out that terraform and helmfile modules indeed have the issue (i.e. check configs before showing help + version).

This is how it looked before for terrafrom
broken_terraaform
And the same issue is with helmfile
broken_helmfile

After the fix for terraform

terraform_fixed_1_of_2
terraform_fixed_2_of_2

And fixed for helmfile looks like this
helmfile_fixed

why

We need to show help message and version/upgrade information irrespective if configs are in place or not.

references

Linear issue - <urlhttps://linear.app/cloudposse/issue/DEV-2797/any-usage-of-help-should-not-require-stack-configurations>

Summary by CodeRabbit

Release Notes

New Features
• Introduced a new function for printing upgrade messages with styled output, enhancing user experience when updates are available. • Improvements
• Enhanced command-line argument processing across various commands, improving error handling and visibility of functions.
• Added version checking logic to prompt users for upgrades when newer versions are available. • Bug Fixes
• Streamlined error handling and control flow in multiple command execution functions, ensuring consistent behavior. • Documentation
• Improved comments and formatting for better code readability and understanding.

26 other checks have passed

 avatar
04:56:17 PM
github3 avatar
github3
05:11:08 PM

what

• Fixes a minor typo and grammar error.

why

references

Summary by CodeRabbit

Documentation
• Enhanced and restructured the guide on configuring Terraform backends, focusing on the S3 backend.
• Added emphasis on the importance of using remote backends for production environments.
• Expanded sections on S3 backend advantages and configuration examples.
• Introduced new subsections for provisioning the S3 backend with Atmos, including organization-wide settings.
• Discussed backend inheritance and management of multiple Terraform backends.

24 other checks have passed

 avatar
05:11:09 PM
Vinny avatar

@Andriy Knysh (Cloud Posse) good to QA https://github.com/cloudposse/atmos/pull/815

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Vinny did you address the @Erik Osterman (Cloud Posse) comments? If you did, please mark them as resolved or with

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

a few comments, looks good otherwise

Vinny avatar

thank you

github3 avatar
github3
12:23:00 AM

Bumps the website group with 2 updates in the /website directory: posthog-js and prettier.

Updates posthog-js from 1.194.0 to 1.194.5

Release notes

Sourced from posthog-js’s releases.

1.194.5 - 2024-12-06

• feat: Added better sub logging utils (#1581)

1.194.4 - 2024-12-05

• feat: RemoteConfig loader (#1577)

1.194.3 - 2024-12-03

• fix: parse Chrome instead of Android as browser (#1575)

1.194.2 - 2024-12-02

• fix: use previous site-app variables (#1574)

1.194.1 - 2024-11-30

• fix: Don’t crash on bigints (#1573) • feat: Add customization to print events drop them (#1572)

Changelog

Sourced from posthog-js’s changelog.

1.194.5 - 2024-12-06

• feat: Added better sub logging utils (#1581)

1.194.4 - 2024-12-05

• feat: RemoteConfig loader (#1577)

1.194.3 - 2024-12-03

• fix: parse Chrome instead of Android as browser (#1575)

1.194.2 - 2024-12-02

• fix: use previous site-app variables (#1574)

1.194.1 - 2024-11-30

• fix: Don’t crash on bigints (#1573) • feat: Add customization to print events drop them (#1572)

Commits • 26e8ddd chore: Bump version to 1.194.5 • a334cc3 feat: Added better sub logging utils (#1581) • eb8151f chore: Bump version to 1.194.4 • bd75190 feat: RemoteConfig loader (#1577) • 909eda0 chore: Bump version to 1.194.3 • 4d705fd fix: parse Chrome instead of Android as browser (#1575) • b3b6ef6 chore: Bump version to 1.194.2 • e2689c0 fix: use previous site-app variables (#1574) • d586455 chore: Bump version to 1.194.1 • fce2141 fix: Don’t crash on bigints (#1573) • Additional commits viewable in compare view

Updates prettier from 3.4.1 to 3.4.2

Release notes

Sourced from prettier’s releases.

3.4.2

:link: Changelog

Changelog

Sourced from prettier’s changelog.

3.4.2

diff

Treat U+30A0 & U+30FB in Katakana Block as CJK (#16796 by @​tats-u)

Prettier doesn’t treat U+30A0 & U+30FB as Japanese. U+30FB is commonly used in Japanese to represent the delimitation of first and last names of non-Japanese people or “and”. The following “C言語・C++・Go・Rust” means “C language & C++ & Go & Rust” in Japanese.

C言 語 ・ C++ ・ Go ・ Rust C言語・ C++ ・ Go ・ Rust C言語・C++・Go・Rust

U+30A0 can be used as the replacement of the - in non-Japanese names (e.g. “Saint-Saëns” (Charles Camille Saint-Saëns) can be represented as “サン゠サーンス” in Japanese), but substituted by ASCII hyphen (U+002D) or U+FF1D (full width hyphen) in many cases (e.g. “サン=サーンス” or “サン=サーンス”).

Fix comments print on class methods with decorators (#16891 by @​fisker)

// Input class A { @decorator /**

  • The method description * */ async method(foo: Foo, bar: Bar) { console.log(foo); } } // Prettier 3.4.1 class A { @​decorator async /**

</tr></table>

… (truncated)

Commits • cca9461 Release 3.4.2 • 572bebe Fix comments on class methods with decorators (#16891) • 359c4f0 chore(deps): update dependency @​angular/compiler to v19.0.1 (#16903) • 6470996 chore(deps): update dependency @​glimmer/syntax to v0.93.1 (#16904) • e13614f Correct fit() for fill() (#16899) • 10db357 Remove check on TSImportType.isTypeOf (#16892) • ac46a4f Treat U+30A0 & U+30FB in Katakana Block as CJK (#16796) • d52e905 Add test for #16207 (#16890) • a1e354d Clean changelog_unreleased • 99875da Bump Prettier dependency to 3.4.1 • See full diff in compare view

Dependabot will resolve any conflicts with this PR as lo…

24 other checks have passed

github3 avatar
github3
12:23:08 AM

Bumps the website group with 2 updates in the /website directory: posthog-js and prettier.

Updates posthog-js from 1.194.0 to 1.194.3

Release notes

Sourced from posthog-js’s releases.

1.194.3 - 2024-12-03

• fix: parse Chrome instead of Android as browser (#1575)

1.194.2 - 2024-12-02

• fix: use previous site-app variables (#1574)

1.194.1 - 2024-11-30

• fix: Don’t crash on bigints (#1573) • feat: Add customization to print events drop them (#1572)

Changelog

Sourced from posthog-js’s changelog.

1.194.3 - 2024-12-03

• fix: parse Chrome instead of Android as browser (#1575)

1.194.2 - 2024-12-02

• fix: use previous site-app variables (#1574)

1.194.1 - 2024-11-30

• fix: Don’t crash on bigints (#1573) • feat: Add customization to print events drop them (#1572)

Commits • 909eda0 chore: Bump version to 1.194.3 • 4d705fd fix: parse Chrome instead of Android as browser (#1575) • b3b6ef6 chore: Bump version to 1.194.2 • e2689c0 fix: use previous site-app variables (#1574) • d586455 chore: Bump version to 1.194.1 • fce2141 fix: Don’t crash on bigints (#1573) • a151df5 feat: Add customization to print events drop them (#1572) • See full diff in compare view

Updates prettier from 3.4.1 to 3.4.2

Release notes

Sourced from prettier’s releases.

3.4.2

:link: Changelog

Changelog

Sourced from prettier’s changelog.

3.4.2

diff

Treat U+30A0 & U+30FB in Katakana Block as CJK (#16796 by @​tats-u)

Prettier doesn’t treat U+30A0 & U+30FB as Japanese. U+30FB is commonly used in Japanese to represent the delimitation of first and last names of non-Japanese people or “and”. The following “C言語・C++・Go・Rust” means “C language & C++ & Go & Rust” in Japanese.

C言 語 ・ C++ ・ Go ・ Rust C言語・ C++ ・ Go ・ Rust C言語・C++・Go・Rust

U+30A0 can be used as the replacement of the - in non-Japanese names (e.g. “Saint-Saëns” (Charles Camille Saint-Saëns) can be represented as “サン゠サーンス” in Japanese), but substituted by ASCII hyphen (U+002D) or U+FF1D (full width hyphen) in many cases (e.g. “サン=サーンス” or “サン=サーンス”).

Fix comments print on class methods with decorators (#16891 by @​fisker)

// Input class A { @decorator /**

  • The method description * */ async method(foo: Foo, bar: Bar) { console.log(foo); } } // Prettier 3.4.1 class A { @​decorator async /**

</tr></table>

… (truncated)

Commits • cca9461 Release 3.4.2 • 572bebe Fix comments on class methods with decorators (#16891) • 359c4f0 chore(deps): update dependency @​angular/compiler to v19.0.1 (#16903) • 6470996 chore(deps): update dependency @​glimmer/syntax to v0.93.1 (#16904) • e13614f Correct fit() for fill() (#16899) • 10db357 Remove check on TSImportType.isTypeOf (#16892) • ac46a4f Treat U+30A0 & U+30FB in Katakana Block as CJK (#16796) • d52e905 Add test for #16207 (#16890) • a1e354d Clean changelog_unreleased • 99875da Bump Prettier dependency to 3.4.1 • See full diff in compare view

Dependabot will resolve any conflicts with this PR as long as you don’t alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it • @dependabot merge will merge this PR after your CI passes on it • @dependabot squash and merge will squash and merge this PR after your CI passes on it • @dependabot cancel merge will cancel a previously requested merge and block automerging • @dependabot reopen will reopen this PR if it is closed • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any…

26 other checks have passed

 avatar
12:23:09 AM
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Vinny please take a look at this:

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

now if we have a template file stacks/catalog/aws-config/packs.yaml.tmpl with the following content

components:
  terraform:
    aws-config:
      metadata:
        component: compliance/aws-config
      vars:
        conformance_packs:
          {{- range $pack := .conformance_packs -}}
          {{ $path := index $pack "path" | default $.defaults.path }}
          - conformance_pack: {{$path}}/{{$pack.filename}}
            name: {{replace ".yaml" "" (toString $pack.filename)}}
            {{- $params := index $pack "parameter_overrides" | default dict -}}
            {{ if gt (len $params) 0 }}
            parameter_overrides:
              {{- range $key, $value := $params }}
              {{ $key }}: {{ $value }}
              {{- end -}}
            {{ else }}
            parameter_overrides: {}
            {{ end -}}
          {{ end -}}
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

this is not a valid YAML

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

when executing atmos validate stacks, it now throws an error

yaml: line 9: did not find expected node content
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

(which is expected since the file is not a valid YAML)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

before the change in the v1.117.0 release, we did not treat the template files as YAML files and atmos validate stacks returned a success (we only selected the files with extensions .yaml and .yaml for validation)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

now we treat all of the files as Atmos stack manifests and fail if a file is not a valid YAML as the above

Vinny avatar

Ok this raises an important edge case: Should .yaml.tmpl files with errors be ignored during validation, allowing the process to continue? If we choose to ignore these files, we need to carefully consider the implications of this decision

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

They are invalid yaml files so it doesn’t make sense to validate

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We have a separate task to render then validate

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

But since we broke existing behavior, and this is widely adopted, we don’t have time to do anything else than re-ignore them like before implementing it a better way

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

we broke it for one of the clients, and i asked them to change the file extension from .tmpl to .templ. - this extension is not validated automatically

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Vinny please confirm that it’s working

Vinny avatar

@Andriy Knysh (Cloud Posse) PR to address this issue https://github.com/cloudposse/atmos/pull/830

#830 Ignore tmpl files to be validated

what

• Exclude template files (.yaml.tmpl, .yml.tmpl, .tmpl) from YAML validation during atmos validate stacks • Maintain automatic template file detection for imports and normal operations • Update documentation to clarify template file handling behavior

why

• Preserve backward compatibility for existing workflows that previously used tmpl files.

CleanShot 2024-12-08 at 17 29 15@2x

references

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Vinny a few comments, please review

Vinny avatar

thank you Andriy all resolved please check again

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Vinny please review a few more comments

github3 avatar
github3
07:07:47 AM

what

• Export Atmos Terraform configuration information in shell launched by Atmos

why

• When Atmos launches a shell, it configures the shell for Terraform to reference a certain component and stack. The configuration is such that Terraform commands will work with a specific component and stack when run from a specific directory, and that informations is output to the user, but it has not been available in the environment for scripts or other automation to reference. By exposing that information in the environment, tools (e.g. the command prompt) can notify the user of the invisible state information and also warn the user if they are executing commands from the wrong directory and help them get back to the right one, among other possibilities.

Summary by CodeRabbit

New Features
• Enhanced Terraform command functionality with additional environment variables for improved configuration. • Documentation
• Added comments to clarify the use of custom shell prompts within the Geodesic environment.

25 other checks have passed

2024-12-08

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
01:46:46 PM

/github unsubscribe cloudposse/atmos

 avatar
01:46:46 PM

Unsubscribed from cloudposse/atmos

2024-12-09

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Vinny please also resolve the conflicts here https://github.com/cloudposse/atmos/pull/815

#815 Dynamic width terminal calculation for help

what

Help should detect proper screen width

why

Terminal Width should be dynamic calculated when the user prints help menu

Screenshot 2024-12-02 at 18 09 40
Screenshot 2024-12-02 at 18 09 20

references

Summary by CodeRabbit

Summary by CodeRabbit

New Features
• Enhanced flag description formatting based on available terminal width.
• Added functionality to dynamically determine terminal width for improved flexibility.
• Introduced new command formatting capabilities for improved styling in the help documentation. • Bug Fixes
• Streamlined logic for printing flag names and descriptions, ensuring better display based on available space. • Documentation
• Updated help documentation for the Atmos tool, including improved flag descriptions for consistency.

Pulak Kanti Bhowmick avatar
Pulak Kanti Bhowmick

Hi Team, this PR is good to review

https://github.com/cloudposse/atmos/pull/828

#828 improve `atmos list components` view

what

why

references

• closes #833

Summary by CodeRabbit

Release Notes

New Features
• Introduced a new list subsection in the configuration, allowing structured representation of components, stacks, and folders.
• Enhanced component filtering and listing functionality with additional configuration options. • Bug Fixes
• Improved error handling with color-coded error messages. • Documentation
• Updated method signatures to reflect changes in functionality and parameters. • Tests
• Modified test cases to accommodate new configuration options in the component listing functionality.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Pulak Kanti Bhowmick if there is a tty attached it should be a polished table.

#828 improve `atmos list components` view

what

why

references

• closes #833

Summary by CodeRabbit

Release Notes

New Features
• Introduced a new list subsection in the configuration, allowing structured representation of components, stacks, and folders.
• Enhanced component filtering and listing functionality with additional configuration options. • Bug Fixes
• Improved error handling with color-coded error messages. • Documentation
• Updated method signatures to reflect changes in functionality and parameters. • Tests
• Modified test cases to accommodate new configuration options in the component listing functionality.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
charmbracelet/lipgloss

Style definitions for nice terminal layouts

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

See section for rendering tables

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

If no tty attached , for example, piping through grep, then it should display the way you have it now

Pulak Kanti Bhowmick avatar
Pulak Kanti Bhowmick

okay, got it. updating

Pulak Kanti Bhowmick avatar
Pulak Kanti Bhowmick

@Erik Osterman (Cloud Posse) this is the latest image

Pulak Kanti Bhowmick avatar
Pulak Kanti Bhowmick

btw, this is a sample. I might update color and add the values

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Yes, this is on the right track

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Let’s use the purple colors like in the lipgloss example

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Also, we still need to add the filters for real/abstract components

2024-12-10

Vinny avatar
1
1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse)

Vinny avatar

I am starting pushing charmbracellet everywhere I visit while working on the issues, so we can have better UI btw

1

2024-12-11

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
02:23:14 PM

set the channel topic: Discuss atmos core development (golang). If you want to help out, reach out to @Erik Osterman (Cloud Posse)

Vinny avatar

@Andriy Knysh (Cloud Posse) so here https://linear.app/cloudposse/issue/DEV-2785/running-atmos-workflow-incorrectly-produces-useless-usage I noticed running things like atmos workflow list throws an error because theres no stacks path so I was thinking in something more user friendly like

Workflows directory not found at '/Users/viniciuscardoso/Developer/atmos/stacks/workflows'

To set up workflows:
1. Create a workflows directory at '/Users/viniciuscardoso/Developer/atmos/stacks/workflows'
2. Add your workflow YAML files in this directory
3. Configure the workflows path in your atmos.yaml:

   workflows:
     basePath: stacks/workflows

For more information, visit: <https://atmos.tools/cli/commands/workflow>

of course I am going to remove those uselless error msgs, but I am also think in ways to improve that btw we can improve this output using charmbracelet

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Let’s do that

1

2024-12-13

Michael avatar
Michael

It’s not urgent, but can I get a review on this PR that implements a basic pager for the atmos docs command? https://github.com/cloudposse/atmos/pull/848

#848 feat: add pagination and searching to `atmos docs` command

what

atmos_docs

• Add pagination helper function to utils • Add pagination setting to Doc struct • Update website documentation to incorporate new CLI settings

why

• Enhance the user experience by making it possible to paginate and search component documentation

references

Paging Output Implementation Reference

Summary by CodeRabbit

Release Notes

New Features
• Introduced pagination options for displaying component documentation.
• Added a new docs section in the atmos.yaml configuration file for enhanced documentation settings. • Bug Fixes
• Improved error handling in the documentation display process. • Documentation
• Updated documentation for the atmos.yaml configuration file, including detailed descriptions of new settings and merge strategies. • Chores
• Minor formatting adjustments made for improved readability.

Aaron Bidderman avatar
Aaron Bidderman

@Andriy Knysh (Cloud Posse) hi, have pushed the PR, would appreciate if you could please take a look when you have a minute. https://github.com/cloudposse/atmos/pull/844 @Erik Osterman (Cloud Posse) FYI

Aaron Bidderman avatar
Aaron Bidderman

@Andriy Knysh (Cloud Posse) hi, noticed Confirm auto-merge button appeared at the bottom of the PR. Should I press it or you guys will take care of if?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse) has been consumed by client work this week, so reviews have ground to a halt

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Just continue with the next tasks

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

i’ll review all of this tomorrow (still need to finish some client work)

1
1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Yes, we usually merge it, so no need to select that option

1

2024-12-17

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse) cannot reproduce the problem you raised: https://github.com/cloudposse/atmos/pull/768

We also added a test for this that is passing. Can you try again?

#768 package manager for vendor pull

what

New Feature interactive package manager for vendor pull
interactive shell for atmos vendor pull –everything • Support –everything flag for test non TTY mod run atmos vendor pull --everything </dev/null |& cat > atmos_vendor_pull.log

screenshots

example for process with error
2024-12-08 1443_16-vendor_utils go - atmos WSL Ubuntu - Visual Studio Code
example for process successfully done
image (2)

why

Build an interface for a package manager using bubbletea

references

https://linear.app/cloudposse/issue/DEV-270/atmos-vendor-pull-uxhttps://linear.app/cloudposse/issue/DEV-2716/support-atmos-vendor-pull-everything • Closes #792 • Closes #301

Summary by CodeRabbit

New Features
• Introduced a --everything flag for the vendor pull command, allowing users to vendor all components at once.
• Enhanced documentation to clarify the new command behavior and usage. • Bug Fixes
• Improved error handling and validation for vendor commands. • Documentation
• Updated CLI command cheat sheets and documentation to reflect the new --everything flag and its usage.
• Enhanced clarity in the vendor-manifest documentation regarding vendoring from OCI registries. • Tests
• Adjusted test cases to accommodate changes in vendor configuration processing.

1
Shubham Tholiya avatar
Shubham Tholiya

https://linear.app/cloudposse/issue/DEV-2322/help-not-showing-for-custom-commands-when-using-the-nested-command Do we know who raised this ticket. We would require reproduction steps.

Whenever someone creates a bug ticket please mention the steps, This avoids back and forth.

  1. Steps
  2. Screenshots
  3. Expected behavior These 3 are a must in a bug ticket
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse) do you know if there are any of these unsupported commands we actually support?

@Shubham Tholiya is helping us clean up atmos terraform --help

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
#857 Merge atmos specific and terraform help documentation

Draft Reason

This pr is just to spin up conversation about which commands and how we need to handle things.

  1. I just want to confirm the design.
  2. I want to check if some of the logical changes really makes sense (we might not need them)

what

Current:
image

After this change :
image


image

• Merge help for terraform and atmos • Updated tab mechanism • Fade out not supported commands

why

• We want to help customers show both native terraform commands and atmos terraform commands

references

https://linear.app/cloudposse/issue/DEV-2821/atmos-terraform-help-should-also-show-terraform-help

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)


do you know if there are any of these unsupported commands we actually support?

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos terrafrom xxx (and atmos helmfile xxx) are special cases in the sense that we did not hardcode any of the native sub-commands in Cobra

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

all of that is “transparent” and just sent to the native terraform/tofu/helmfile CLI

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

that made the code more “convoluted”, but allows us to support any new subcommands they release w/o updating the Atmos code

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

I would say we support many (if not all) of those subcommands, maybe except the ones with a diff invocation sysntax

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

and b/c of that “transparency”, we can’t use the native Cobra help functionality

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

we had to implement atmos terrafrom --help by ourselves (which is the point of this discussion)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

It’s less important that we support any new command in terraform

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

What is most useful is a cli help menu that is consistent with the product

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

So we are adding the commands to the cobra menu and not trying to be clever

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

So I say, unless we have tested the command and verified it works, it should be unsupported

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Rather than “supported” and broken

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos terraform output <component> -s <stack> has the same syntax as atmos terraforn apply, and is used all the time

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos terraform force-unlock <component> -s <stack> --force <lock ID> - used all the time

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos terraform import <component> -s <stack> <ADDRESS> <ID> - used all the time

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos terraform show <component> -s <stack> - works and has the same syntax as atmos terraform plan

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

the rest are not used often (if at all), we need to confirm them

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Ok, great

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Shubham Tholiya let’s verify these flags and usage are available with help

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos terraform validate <component> -s <stack> should work too

Shubham Tholiya avatar
Shubham Tholiya

cool thanks for letting me know

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Also, I see we’re missing deploy

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

And shell subcommands

Shubham Tholiya avatar
Shubham Tholiya

i guess that might be native to atmos terraform command right? because in terraform i don’t see it

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos terraform deploy <component> -s <stack> atmos terraform shell <component> -s <stack>

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

these are atmos command, not present in terraform

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

These commands should go under the top section, of atmos-native commands like generate

2024-12-18

Shubham Tholiya avatar
Shubham Tholiya

Hey anyone found this issue the long description for terraform does not get printed. i added .Long in template and now every command shows description twice for all other commands except terraform

Shubham Tholiya avatar
Shubham Tholiya

just noticed this has to do something with duplicated help strategy that we follow we have exec/help.go and templater.go so when migrating there is some missing change.

But for long term i would recommend cobra based command help

@Andriy Knysh (Cloud Posse) Wdyt?

Shubham Tholiya avatar
Shubham Tholiya

@Erik Osterman (Cloud Posse) i would recommend we migrate all commands first

This will be

  1. Consistent help UX for customer
  2. Consistent dev Experience and less confusion for new Dev to implement the help
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I would prefer we find some way to use the cobra help menu for everything even if it means duplication

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

And by duplication, I mean duplication of effort that we have to copy everything into cobra

2024-12-19

Aaron Bidderman avatar
Aaron Bidderman

@Andriy Knysh (Cloud Posse) hi, if it wouldn’t be too much trouble, could you please take a look when you have a minute? https://github.com/cloudposse/atmos/pull/866

#866 Fix panic on atmos terraform providers lock

what

The following command atmos terraform providers lock foo --stack bar resulted in a panic message like this.

before

and after

after

why

• The panic shouldn’t be shown instead put the check for not nil map assignemnet. • Closes #794

references

Link to the ticket - https://linear.app/cloudposse/issue/DEV-2767/panic-on-atmos-terraform-providers-lock

Summary by CodeRabbit

Summary by CodeRabbit

Bug Fixes
• Improved error handling for component and stack processing, providing clearer error messages.
• Ensured robust handling of ComponentSection to prevent nil pointer dereferences. • New Features
• Introduced a store configuration management feature, enhancing the CLI configuration initialization.
• Added support for AWS SSM Parameter Store and in-memory storage options. • Refactor
• Updated function signatures to improve data integrity and processing logic.
• Streamlined the invocation of related functions for better context management.
• Enhanced the structure of YAML function processing for improved readability and maintainability.

1

2024-12-20

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

:alert: main is currently broken. It was accidentally broken in https://github.com/cloudposse/atmos/pull/856, which broke Windows support because we had no tests run on Windows.

We merged https://github.com/cloudposse/atmos/pull/875, which adds windows & macos tests, so until we resolve the breaking change in 856, windows tests are failing.

1
1
1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Shubham Tholiya is looking into why the tests are failing

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

heads up @Matt Calhoun

Vinny avatar

let me know if you guys need help

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Matt Calhoun is also going to take a quick look.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Also, it’s worth saying, until this is fixed, every release include 1.128 and later is broken.

1
Aaron Bidderman avatar
Aaron Bidderman

Not sure if its worth noticing but any –help is not working either now. And I’m on a win machine.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Oh, wonderful, you’re on windows~!

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

You can probably help us fix this problem

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Matt Calhoun opened a PR that fixed one of the problems.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Maybe you can expand this to the rest

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

But please confirm if. you can work on this now, otherwise @Shubham Tholiya was going to work on it. I’m not sure if he’s on windows.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Matt Calhoun is no longer working on this problem. So not sure who can pick it up fastest. We need to get this fixed ASAP.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
#878 fix windows paths

what

Fix a bug where globs are erroring on windows

why

The functionality is broken on Windows

relates to

#875#877#856

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

The fix is something like

	// Conver the pattern to use / as the separatoratorator regardless of platform
	allOsSafePattern := filepath.ToSlash(pattern)

	base, cleanPattern := doublestar.SplitPattern(allOsSafePattern)
	f := os.DirFS(base)
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

and we need to do that probably in more places.

Shubham Tholiya avatar
Shubham Tholiya

I am already working on this

1
Shubham Tholiya avatar
Shubham Tholiya

I mean i am fixing code

1
Shubham Tholiya avatar
Shubham Tholiya

But good to know we have one more issue

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Ok, thanks @Shubham Tholiya

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Shubham Tholiya there is another problem I tried to fix, but won’t get back to this before Monday.

https://github.com/cloudposse/atmos/pull/877

#877 add conditionals based on flavor

what

• Run commands depending on the flavor of OS

why

• Windows behaves differently from Linux/macOS • #875 introduced windows testing

Summary by CodeRabbit

Bug Fixes
• Improved conditional execution of tests based on operating system.
• Enhanced clarity in test execution step names. • Chores
• Updated testing workflow to differentiate commands for Windows, Linux, and macOS.
• Added a step to set the build artifacts directory in the PATH for Windows targets.
• Refined the process for downloading build artifacts with OS-specific naming.
• Added GNU tar to PATH for improved build efficiency on Windows targets.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

The problem is that in the matrix, when we run on windows, it doesn’t find atmos.exe. I am not to versed on windows, and tried to fix it in this PR. I think the general techniques are here, but still needs a tweak to get it working.

Aaron Bidderman avatar
Aaron Bidderman

Hi, just a quck status update about the –help issue on Windows I reported above. It has gone once I rolled back the history of commits to this one 2394a9d fix tests (#868). On this commit as HEAD –help on Win works fine. @Andriy Knysh (Cloud Posse) fyi

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

It should have started on 856 (1.128)

Shubham Tholiya avatar
Shubham Tholiya

Thanks for the update @Aaron Bidderman

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Aaron Bidderman DM’d me some other info

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Aaron Bidderman
Hi @Erik Osterman (Cloud Posse) Im not sure if its a windows problem at least with the –help. I wanted to rollback a few commits to see if the –help starts work and when and did $ git log --oneline

80058a8 (HEAD -> main, origin/main, origin/add-vars-parameter, origin/HEAD) refactor loading and checking of atmos config (#869) fe637fa rename CliConfiguration to AtmosConfiguration (#867) 2394a9d fix tests (#868) 05606ad (upstream/main) atmos read storage interface (#865) 1defdce (tag: v1.130.0) package manager for vendor pull (#768) c4fe769 (tag: v1.129.0) Improve !terraform.output Atmos YAML function. Implement static remote state backend for !terraform.output and atmos.Component functions (#863) 2051592 (tag: v1.128.0) Replace path.Join with filepath.Join (#856) 74f3931 Mergify (#862) b205a0d (tag: v1.127.0) Implement Atmos Version Check Configuration (#844) e9a610e (tag: v1.126.0) add support for terraform version (#846) 11ec388 Add support for helmfile version command (#854) 58b46f5 Append new lines to end of json files before writing (#849) ed93da1 (tag: v1.125.0) Exclude abstract components from list (#851) 5681e54 (tag: v1.124.0) feat: add pagination and searching to atmos docs command (#848) c0e7054 (tag: v1.123.1) Fix terraform plan file should not be deleted (#855) 22c9b28 (tag: v1.123.0) Dynamic width terminal calculation for help (#815) b144ba2 Fix deployments inactivate (#843) 1bf5dc2 Update Atmos stack manifest JSON schema. Fix docs (#842) 36a595e Fix deployments overrides (#841) abddf14 (tag: v1.122.0) Ignore tmpl files to be validated (#830) bf867be Fix preview deployment (#839) 067a99f Refactor preview deployments workflows (#836)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)


So the - 2051592 (tag: v1.128.0) Replace path.Join with filepath.Join (#856) is still there with me but any changes as adding pointers to config schema/renaming it are gone and –help works. So I guess - refactor loading and checking of atmos config (#869) - has issues and as a side note adding pointers to config is major change that requires retesting everything. Please disregard as I caould be totally wrong and didnt want to point fingers to anyone.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Vinny @Aaron Bidderman @Shubham Tholiya please hold off on working on this one any more

3
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I think we need @Andriy Knysh (Cloud Posse) to address this

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

So part of the problem is that the paths are being returned as absolute paths on Windows and relative on linux

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We should get them all as relative

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
#887 Revert "Replace path.Join with filepath.Join (#856)"

This reverts commit 2051592.

what

• Manual revert of #856

why

• It broke too many things that were are to debug, and we lacked tests to catch the situation. • We’ve added windows tests in, and should revisit this.
#877
#875

Summary by CodeRabbit

Bug Fixes
• Updated path handling across multiple files to use a more appropriate method for constructing paths. • Documentation
• Adjusted comments and logging to reflect changes in path construction. • Tests
• Modified test cases to utilize the updated path handling method, ensuring consistency across tests. • Chores
• Updated GitHub Actions workflow to streamline acceptance test execution, enhancing maintainability.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

This PR is almost ready. There’s only one failing test and I can’t figure it out.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse)

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Main is now stable

1

2024-12-21

2024-12-22

2024-12-23

2024-12-24

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse) , @haitham911eg helped me fix the tests: https://github.com/cloudposse/atmos/pull/887

#887 Revert "Replace path.Join with filepath.Join (#856)"

This reverts commit 2051592.

what

• Manual revert of #856

why

• It broke too many things that were are to debug, and we lacked tests to catch the situation. • We’ve added windows tests in, and should revisit this.
#877
#875

Summary by CodeRabbit

Bug Fixes
• Updated path handling across multiple files to use a more appropriate method for constructing paths. • Documentation
• Adjusted comments and logging to reflect changes in path construction. • Tests
• Modified test cases to utilize the updated path handling method, ensuring consistency across tests. • Chores
• Updated GitHub Actions workflow to streamline acceptance test execution, enhancing maintainability. • New Features
• Introduced a new function to sanitize filenames for better cross-platform compatibility.

1
1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

This should restore atmos behavior and ensure windows is tested moving forward

#887 Revert "Replace path.Join with filepath.Join (#856)"

This reverts commit 2051592.

what

• Manual revert of #856

why

• It broke too many things that were are to debug, and we lacked tests to catch the situation. • We’ve added windows tests in, and should revisit this.
#877
#875

Summary by CodeRabbit

Bug Fixes
• Updated path handling across multiple files to use a more appropriate method for constructing paths. • Documentation
• Adjusted comments and logging to reflect changes in path construction. • Tests
• Modified test cases to utilize the updated path handling method, ensuring consistency across tests. • Chores
• Updated GitHub Actions workflow to streamline acceptance test execution, enhancing maintainability. • New Features
• Introduced a new function to sanitize filenames for better cross-platform compatibility.

1

2024-12-26

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Vinny would be great to get your glamour inprovements ready. I think we need it to finish the work @Shubham Tholiya is doing on the terraform help pages.

Shubham Tholiya avatar
Shubham Tholiya

We have more improvements?

@Vinny would be great if we could collaborate

https://linear.app/cloudposse/issue/DEV-2722/format-examples-output-by-atmos-help-command-in-color

Based on this issue. I or you can incorporate that in the examples section of the template. This way we would not change the structure we are looking for yet work collaboratively.

My pr that we should be updating is: https://github.com/cloudposse/atmos/pull/857

Let me know if you need some help

#857 Merge atmos specific and terraform help documentation

what

Current:
image

After this change :
image


image

• Merge help for terraform and atmos • Updated tab mechanism • Fade out not supported commands

why

• We want to help customers show both native terraform commands and atmos terraform commands

references

https://linear.app/cloudposse/issue/DEV-2821/atmos-terraform-help-should-also-show-terraform-help

Summary by CodeRabbit

New Features
• Enhanced help command output with a styled logo for non-“terraform” commands.
• Improved error handling and user feedback for the terraform command.
• Introduced a comprehensive set of Terraform commands with detailed descriptions and examples.
• Dynamic generation of help documentation based on command properties.
• Enhanced command formatting capabilities to indicate unsupported commands. • Bug Fixes
• Simplified help output for “terraform” commands to reduce clutter. • Documentation
• Updated command descriptions for clarity and detail. • Refactor
• Improved command formatting and usage templates for better representation of command availability. • Chores
• Added TODO comments for future improvements in help processing.

Vinny avatar

good point I think theres a bunch of things solved on the glamour improvements that @Shubham Tholiya can reuse

Vinny avatar

I will make it a bit more generic so we can integrate all faster

2

2024-12-27

Shubham Tholiya avatar
Shubham Tholiya

Just putting things here so that we do not re work everytime on help:

We have a pr: https://github.com/cloudposse/atmos/pull/857

This pr will try to depricate help.go in favour of supporting native cobra help.

Please do not add/edit help.go . If required contribute to the pr above

#857 Merge atmos specific and terraform help documentation

what

Current:
image

After this change :
image


image

• Merge help for terraform and atmos • Updated tab mechanism • Fade out not supported commands

why

• We want to help customers show both native terraform commands and atmos terraform commands

references

https://linear.app/cloudposse/issue/DEV-2821/atmos-terraform-help-should-also-show-terraform-help

Summary by CodeRabbit

New Features
• Enhanced help command output with a styled logo for non-“terraform” commands.
• Improved error handling and user feedback for the terraform command.
• Introduced a comprehensive set of Terraform commands with detailed descriptions and examples.
• Dynamic generation of help documentation based on command properties.
• Enhanced command formatting capabilities to indicate unsupported commands. • Bug Fixes
• Simplified help output for “terraform” commands to reduce clutter. • Documentation
• Updated command descriptions for clarity and detail. • Refactor
• Improved command formatting and usage templates for better representation of command availability. • Chores
• Added TODO comments for future improvements in help processing.

1
Shubham Tholiya avatar
Shubham Tholiya

We would have followup pr’s ofcourse that i will update as and when required.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

thanks for the PR @Shubham Tholiya

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

i left some comments

Shubham Tholiya avatar
Shubham Tholiya

I updated the pr based on your comment. A follow up pr would be required for sure. There are still things i am sorting up like

There are two places where we set the help func This should not be the case because it makes the cobra help itself inconsistent.

Post fixing that i will have to do the same thing i did with terraform for helm And then eventually have it our way.

Just to make @Erik Osterman (Cloud Posse) aware of this. A lot of help are so mixed up that is the reason we are moving in phases This will help us to test effectively and avoid breaking anything

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

thank you, i’ll review it

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

yes, help was convoluted, because we started with one way , then manually added terraform and helmfile help

2024-12-28

Shubham Tholiya avatar
Shubham Tholiya

Just wanted to understand this I observe that viper and cobra are not binded as per recommendations While i do understand why it might have been that way. I would recommend let us change that so that we remove a lot of code

Wdyt @Andriy Knysh (Cloud Posse) cc: @Erik Osterman (Cloud Posse)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

please explain in more details how they are not integrated and how we can improve the code

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

note that you don’t need to use Viper with Cobra, Cobra can be used separately

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

in the current code, we are using Viper to merge the CLI configurations loaded from different places

Shubham Tholiya avatar
Shubham Tholiya

So what i noticed is we manually check if a flag was set and the modify the config. If i remember the viper and cobra correctly viper can directly handle this binding

Unless this is something we already have planned to remove and i am looking at some old code

Shubham Tholiya avatar
Shubham Tholiya

ohh sorry it is cobra+viper or viper+native that automatically handles this. Not sure if we want to do that or we already droped that for some reasons

Shubham Tholiya avatar
Shubham Tholiya
Shubham Tholiya avatar
Shubham Tholiya

a snippet from chat gpt

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We do want to use viper, but I have not written the task

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We want to convert our handling of atmos.yml to use viper

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I probably won’t get to writing task until Monday

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

we already using Viper to handle atmos.yaml and merge the config from many files if they are found

Shubham Tholiya avatar
Shubham Tholiya

Ok… this: https://github.com/cloudposse/atmos/blob/main/pkg/config/utils.go#L188-L387 Could be handled by viper viper help attached for reference:

``` basePath := os.Getenv(“ATMOS_BASE_PATH”) if len(basePath) > 0 { u.LogTrace(*atmosConfig, fmt.Sprintf(“Found ENV var ATMOS_BASE_PATH=%s”, basePath)) atmosConfig.BasePath = basePath }

vendorBasePath := os.Getenv("ATMOS_VENDOR_BASE_PATH")
if len(vendorBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_VENDOR_BASE_PATH=%s", vendorBasePath))
	atmosConfig.Vendor.BasePath = vendorBasePath
}

stacksBasePath := os.Getenv("ATMOS_STACKS_BASE_PATH")
if len(stacksBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_STACKS_BASE_PATH=%s", stacksBasePath))
	atmosConfig.Stacks.BasePath = stacksBasePath
}

stacksIncludedPaths := os.Getenv("ATMOS_STACKS_INCLUDED_PATHS")
if len(stacksIncludedPaths) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_STACKS_INCLUDED_PATHS=%s", stacksIncludedPaths))
	atmosConfig.Stacks.IncludedPaths = strings.Split(stacksIncludedPaths, ",")
}

stacksExcludedPaths := os.Getenv("ATMOS_STACKS_EXCLUDED_PATHS")
if len(stacksExcludedPaths) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_STACKS_EXCLUDED_PATHS=%s", stacksExcludedPaths))
	atmosConfig.Stacks.ExcludedPaths = strings.Split(stacksExcludedPaths, ",")
}

stacksNamePattern := os.Getenv("ATMOS_STACKS_NAME_PATTERN")
if len(stacksNamePattern) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_STACKS_NAME_PATTERN=%s", stacksNamePattern))
	atmosConfig.Stacks.NamePattern = stacksNamePattern
}

stacksNameTemplate := os.Getenv("ATMOS_STACKS_NAME_TEMPLATE")
if len(stacksNameTemplate) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_STACKS_NAME_TEMPLATE=%s", stacksNameTemplate))
	atmosConfig.Stacks.NameTemplate = stacksNameTemplate
}

componentsTerraformCommand := os.Getenv("ATMOS_COMPONENTS_TERRAFORM_COMMAND")
if len(componentsTerraformCommand) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_TERRAFORM_COMMAND=%s", componentsTerraformCommand))
	atmosConfig.Components.Terraform.Command = componentsTerraformCommand
}

componentsTerraformBasePath := os.Getenv("ATMOS_COMPONENTS_TERRAFORM_BASE_PATH")
if len(componentsTerraformBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_TERRAFORM_BASE_PATH=%s", componentsTerraformBasePath))
	atmosConfig.Components.Terraform.BasePath = componentsTerraformBasePath
}

componentsTerraformApplyAutoApprove := os.Getenv("ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE")
if len(componentsTerraformApplyAutoApprove) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE=%s", componentsTerraformApplyAutoApprove))
	applyAutoApproveBool, err := strconv.ParseBool(componentsTerraformApplyAutoApprove)
	if err != nil {
		return err
	}
	atmosConfig.Components.Terraform.ApplyAutoApprove = applyAutoApproveBool
}

componentsTerraformDeployRunInit := os.Getenv("ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT")
if len(componentsTerraformDeployRunInit) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT=%s", componentsTerraformDeployRunInit))
	deployRunInitBool, err := strconv.ParseBool(componentsTerraformDeployRunInit)
	if err != nil {
		return err
	}
	atmosConfig.Components.Terraform.DeployRunInit = deployRunInitBool
}

componentsInitRunReconfigure := os.Getenv("ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE")
if len(componentsInitRunReconfigure) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE=%s", componentsInitRunReconfigure))
	initRunReconfigureBool, err := strconv.ParseBool(componentsInitRunReconfigure)
	if err != nil {
		return err
	}
	atmosConfig.Components.Terraform.InitRunReconfigure = initRunReconfigureBool
}

componentsTerraformAutoGenerateBackendFile := os.Getenv("ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE")
if len(componentsTerraformAutoGenerateBackendFile) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE=%s", componentsTerraformAutoGenerateBackendFile))
	componentsTerraformAutoGenerateBackendFileBool, err := strconv.ParseBool(componentsTerraformAutoGenerateBackendFile)
	if err != nil {
		return err
	}
	atmosConfig.Components.Terraform.AutoGenerateBackendFile = componentsTerraformAutoGenerateBackendFileBool
}

componentsHelmfileCommand := os.Getenv("ATMOS_COMPONENTS_HELMFILE_COMMAND")
if len(componentsHelmfileCommand) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_HELMFILE_COMMAND=%s", componentsHelmfileCommand))
	atmosConfig.Components.Helmfile.Command = componentsHelmfileCommand
}

componentsHelmfileBasePath := os.Getenv("ATMOS_COMPONENTS_HELMFILE_BASE_PATH")
if len(componentsHelmfileBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_HELMFILE_BASE_PATH=%s", componentsHelmfileBasePath))
	atmosConfig.Components.Helmfile.BasePath = componentsHelmfileBasePath
}

componentsHelmfileUseEKS := os.Getenv("ATMOS_COMPONENTS_HELMFILE_USE_EKS")
if len(componentsHelmfileUseEKS) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_HELMFILE_USE_EKS=%s", componentsHelmfileUseEKS))
	useEKSBool, err := strconv.ParseBool(componentsHelmfileUseEKS)
	if err != nil {
		return err
	}
	atmosConfig.Components.Helmfile.UseEKS = useEKSBool
}

componentsHelmfileKubeconfigPath := os.Getenv("ATMOS_COMPONENTS_HELMFILE_KUBECONFIG_PATH")
if len(componentsHelmfileKubeconfigPath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_HELMFILE_KUBECONFIG_PATH=%s", componentsHelmfileKubeconfigPath))
	atmosConfig.Components.Helmfile.KubeconfigPath = componentsHelmfileKubeconfigPath
}

componentsHelmfileHelmAwsProfilePattern := os.Getenv("ATMOS_COMPONENTS_HELMFILE_HELM_AWS_PROFILE_PATTERN")
if len(componentsHelmfileHelmAwsProfilePattern) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_HELMFILE_HELM_AWS_PROFILE_PATTERN=%s", componentsHelmfileHelmAwsProfilePattern))
	atmosConfig.Components.Helmfile.HelmAwsProfilePattern = componentsHelmfileHelmAwsProfilePattern
}

componentsHelmfileClusterNamePattern := os.Getenv("ATMOS_COMPONENTS_HELMFILE_CLUSTER_NAME_PATTERN")
if len(componentsHelmfileClusterNamePattern) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_COMPONENTS_HELMFILE_CLUSTER_NAME_PATTERN=%s", componentsHelmfileClusterNamePattern))
	atmosConfig.Components.Helmfile.ClusterNamePattern = componentsHelmfileClusterNamePattern
}

workflowsBasePath := os.Getenv("ATMOS_WORKFLOWS_BASE_PATH")
if len(workflowsBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_WORKFLOWS_BASE_PATH=%s", workflowsBasePath))
	atmosConfig.Workflows.BasePath = workflowsBasePath
}

jsonschemaBasePath := os.Getenv("ATMOS_SCHEMAS_JSONSCHEMA_BASE_PATH")
if len(jsonschemaBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_SCHEMAS_JSONSCHEMA_BASE_PATH=%s", jsonschemaBasePath))
	atmosConfig.Schemas.JsonSchema.BasePath = jsonschemaBasePath
}

opaBasePath := os.Getenv("ATMOS_SCHEMAS_OPA_BASE_PATH")
if len(opaBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_SCHEMAS_OPA_BASE_PATH=%s", opaBasePath))
	atmosConfig.Schemas.Opa.BasePath = opaBasePath
}

cueBasePath := os.Getenv("ATMOS_SCHEMAS_CUE_BASE_PATH")
if len(cueBasePath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_SCHEMAS_CUE_BASE_PATH=%s", cueBasePath))
	atmosConfig.Schemas.Cue.BasePath = cueBasePath
}

atmosManifestJsonSchemaPath := os.Getenv("ATMOS_SCHEMAS_ATMOS_MANIFEST")
if len(atmosManifestJsonSchemaPath) > 0 {
	u.LogTrace(*atmosConfig, fmt.Sprintf("Found ENV var ATMOS_SCHEMAS_ATMOS_MANIFEST=%s", atmosManifestJsonSchemaPath))
	atmosConfig.Schemas.Atmos.Manifest = atmosManifestJsonSchemaPath
}

logsFile := os.Getenv("…
Shubham Tholiya avatar
Shubham Tholiya

~We can even standardize env and arguments in a future Major version so it is intutive for the user to know the env and flag maybe~i class=”em em-slightly_smiling_face”></i>

Not diverging the topic avoid this

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

yes, you are right, we can use Viper to handle the ENV vars (this will need to be tested for all scenarios)

2024-12-30

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
Comment on #832 Vendor Pull Operation Does Not Work on Windows

I wanted to come back and say that this scenario still fails:
“With a github source and no version specified, no error is thrown but the resulting directory is empty.”

I found that it’s tied to the included_paths.
Works:
included_paths: ["**"]
Fails with empty directory:
included_paths: ["**/**.tf"]
For a repo that contains just ./main.tf and ./README.md.

Looks like it could be the same as this issue:
#835

I’ll track the other issue for resolution. Thanks again for the quick fix for Windows!

1
haitham911eg avatar
haitham911eg

yes windows has issue when search for files I will review

1

2024-12-31

Shubham Tholiya avatar
Shubham Tholiya

Hey team this is an important observation please check my comment: https://github.com/cloudposse/atmos/pull/896/files#r1899825937 @Andriy Knysh (Cloud Posse) or @Erik Osterman (Cloud Posse) might know if there are specific reasons for this (if they are aware of this) Currently i stand on the side that this should not work the way it is. Unless someone convinces me of the reasons these special file configs exists.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Correct, changing the destination of the logs, should have no bearing on what is emitted. That should be strictly controlled by the log level.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I have also noticed that setting the ATMOS_LOGS_LEVEL environment variable, or passing the —logs-level flag seems to have no bearing

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Maybe it’s because we usually set the file to stderr

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Andriy Knysh (Cloud Posse)

Shubham Tholiya avatar
Shubham Tholiya

I guess we should create a medium - high priority task to fix log level

This is one of the basic thing we should not mess up. Ofcourse we can discuss the behavior before we standardize something

Also just curioius. Do we have a document subscription like Norton or Quip where we propose and discuss stuff? or it is github issue? I am fine with github issue as well just wanted to know what we prefer

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

atmos logs level env variable has been working correctly

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

i’ll check your comments in a few

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

We have another task for @Vinny to implement the charm logger. We can do the work as part of that.

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Shubham Tholiya i commented on your comment

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

if you have trouble with that, let’s sync tomorrow with you, Erik and myself to discuss

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

note that the two places that you pointed out

<https://github.com/cloudposse/atmos/blob/main/pkg/logger/logger.go#L61-L98>
<https://github.com/cloudposse/atmos/blob/main/pkg/utils/log_utils.go#L106-L143>
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

the second one is a new way of login, the second one is a very old code

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

(they will need to be consolidated eventually, all the old places need to be switched to use the new Logger)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

When I discussed with @Matt Calhoun we decided to do a 2 phased approach. Update the current logging functions to use the charm logger, and everything new call the charm logger directly.

1
Shubham Tholiya avatar
Shubham Tholiya

@Andriy Knysh (Cloud Posse)

I believe my initial concern was misunderstood, so I clarified it here: https://github.com/cloudposse/atmos/pull/896/files#r1900454315 Since we’re moving to a new logger, this issue might resolve itself, so it may not need further discussion. Just sharing this in case it’s helpful.

1
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

@Shubham Tholiya i commented on your comment

We have the correct handling of log levels and log files now via the top-level functions LogTrace, LogDebug, LogInfo (which are called from the Go code), and the internal (not exported) function log (which handles the log files and file descriptors

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

this is how the rest of the code calls the LogXXX functions

// func "a" logs at the log level Info, meaning the messages will be logged when the configured log level is Info, Debug, Trace, etc.
func a() {
  LogInfo(..., "Starting doing something")
  .....
  LogInfo(..., "Finished doing something")
}

// func "b" logs at the log level Trace, meaning the messages will be logged only when the configured log level is Trace 
func b() {
  LogTrace(..., "Starting doing something")
  .....
  LogTrace(..., "Finished doing something")
}
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

only the code that actually logs (e.g the a and b funcs above) knows at what log level it wants the messages to be logged

    keyboard_arrow_up