#atmos-dev (2025-01)

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

2025-01-01

2025-01-02

Vinny avatar

@Andriy Knysh (Cloud Posse) this is ready for review https://github.com/cloudposse/atmos/pull/853

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

@Vinny the PR looks very good. Just one misconfiguration in atmos.yaml, please see the comment (and ping me when you fix it)

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

it was fixed in another PR, we can close this ticket

1

2025-01-03

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

@Andriy Knysh (Cloud Posse) this LGTM https://github.com/cloudposse/atmos/pull/905

#905 Support Default Values for Arguments in Custom Commands

what

The task is was “If a default is provided for a custom command, and required is true, then it shouldn’t error.”

before

before

a custom cli-command is defined

custom_cli_command

after

after

why

Provide a deafult value in atmos.yaml for a custom CLI command, so it doesn’t error out (before it did).

references

Link to the ticket - https://linear.app/cloudposse/issue/DEV-2327/default-value-for-demo-argument-should-not-cause-an-error

Summary by CodeRabbit

New Features
• Enhanced custom command argument handling with required and default value support.
• Added new “greet” command with a configurable name argument. • Documentation
• Updated documentation for custom commands, including command name change from “hello” to “greet”.
• Clarified positional argument requirements and default value handling. • Bug Fixes
• Improved argument validation logic for custom commands.
• Added more robust error messaging for invalid command configurations. • Tests
• Introduced new test cases for the “greet” command to validate argument handling and default values.

1
1
Vinny avatar

@Andriy Knysh (Cloud Posse) looks like good now https://github.com/cloudposse/atmos/pull/853

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

@Vinny this config in atmos.yaml

# Syntax highlighting configuration
  syntax:
    enabled: true
    theme: "dracula"      # or use custom colors from theme
    line_numbers: true
    wrap: false
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

looks like it’s a separate sub-section under settings

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

but it’s not in schema.go

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

it’s eigher needs to be removed from atmos.yaml and the docs, or used in schema.go and in the code

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

this should be settings.terminal.syntax

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

(Which it currently is)

Vinny avatar

I think we are good to remove this syntax

Vinny avatar

colorize should handle yaml

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

@Vinny please ping me here when you finish all the changes

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

Why remove? What does removing it solve

Vinny avatar

we don’t need it there at all as we have custom colors

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

But themes is nice too :-)

Vinny avatar

yeah indeed its your guys decision at the end

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

But I don’t understand why we have both “syntax” and “syntax_highlighting”

Vinny avatar

will be only this syntax_highlighting we can rename it

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

Let’s combine

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

But yes, I prefer we keep support for themes

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

But document where the list of themes is found

Vinny avatar

so to summarize right now we have

Glamour with markdown with custom colors

Themes for yaml colorized

• (chroma themes for Glamour also) This is not implemented now

Vinny avatar

I can do this chroma in the same glamour PR or we can create another feature to implement it, up to you @Erik Osterman (Cloud Posse)

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

Let’s do that in a new PR

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

But yes, let’s do that. Can you write a linear task and self assign

Vinny avatar

sounds good

Vinny avatar

@Andriy Knysh (Cloud Posse) good to check now please

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

@Andriy Knysh (Cloud Posse) I think this is also ready https://github.com/cloudposse/atmos/pull/906

#906 Support for a circuit breaker to avoid recursive calls to atmos commands (infinite loop)

what

This PR contains the code that counts the number of recursive calls, and in case it exceeds the threshold, terminates the processes (parent + all children).

Add-on to atmos.yaml

atmos_yaml_addon

The circuit breaker in use

atmos_loop_termination

why

Avoid infinite loops

references

• Closes #765DEV-2688

Summary by CodeRabbit

New Features
• Added a circuit breaker mechanism to prevent infinite shell command loops.
• Implemented maximum shell depth limit of 10 levels.
• Introduced a new command loop for testing infinite loops in the CLI.
• Enhanced environment variable tracking for nested shell executions. • Tests
• Added a new test case to verify circuit breaker functionality.
• Ensured CLI handles infinite loop scenarios gracefully.

Vinny avatar

This is good to start review @Andriy Knysh (Cloud Posse) https://github.com/cloudposse/atmos/pull/907

    keyboard_arrow_up