What are the next steps on <https://github.com/clo...
# atmos-dev
e
What are the next steps on https://github.com/cloudposse/atmos/pull/1036? @Vinny do you need @Andriy Knysh (Cloud Posse)’s help to ensure templating works?
👀 1
v
I will address Andriy comments give few minutes
e
What’s the status @Vinny ?
v
hold on I got stuck resolving a lot lints, and breaking the tests again 🥲
@Erik Osterman (Cloud Posse) @Andriy Knysh (Cloud Posse) this is done all issues resolved
a
i'll review today
🫡 1
v
my wife said that I was sleeping and saying atmos list values
a
During sleep, the brain consolidates new memories, especially during REM and slow-wave sleep, by replaying and strengthening neural connections, which can lead to improved recall and learning
🙇‍♂️ 1
picard fail 1
@Vinny I'm sorry to do this (I understand why you see all of this in your sleep, the PR has 240 comments), but I see a few issues: •
atmos list values c1 --format yaml
Copy code
dev:
    stage: dev
    test:
        a: a-dev
        b: b-team2
        c: c-team1
        d: d
prod:
    stage: prod
    test:
        a: a-prod
        b: b-prod
        c: c-prod
        d: d
sandbox:
    stage: sandbox
    test:
        a: a-team2
        b: b-team2
        c: c-team1
        d: d
staging:
    stage: staging
    test:
        a: a-staging
        b: b-team2
        c: c-team1
        d: d
• but
atmos list vars c1 --format yaml
Copy code
dev:
    value:
        stage: dev
        test:
            a: a-dev
            b: b-team2
            c: c-team1
            d: d
prod:
    value:
        stage: prod
        test:
            a: a-prod
            b: b-prod
            c: c-prod
            d: d
sandbox:
    value:
        stage: sandbox
        test:
            a: a-team2
            b: b-team2
            c: c-team1
            d: d
staging:
    value:
        stage: staging
        test:
            a: a-staging
            b: b-team2
            c: c-team1
            d: d
what if that
value
? we don't need it?
it also makes the table view not possible to understand
atmos list vars c1
image.png
2. Do we need that
INFO
before executing every command? Let's make it
DEBUG
3.
atmos list settings c1 --format yaml
shows some (empty) output
Copy code
dev: {}
prod: {}
sandbox: {}
staging: {}
test: {}
image.png
but
atmos list metadata c1
shows this
Copy code
INFO Filtering metadata component=c1 query="" maxColumns=0 format="" stackPattern="" templates=true
No metadata found for component 'c1'
let's make them the same
4.
atmos list values sdsddsds
Copy code
INFO Filtering values component=sdsddsds componentFilter=sdsddsds query="" includeAbstract=false maxColumns=0 format="" stackPattern="" processTemplates=true processYamlFunctions=true
ERRO no values found for component 'sdsddsds'
would be nice to say "component 'sdsddsds' does not exist"
5.
atmos list settings weweweewew
Copy code
INFO Filtering settings query="" component=weweweewew maxColumns=0 format="" stackPattern="" processTemplates=true processYamlFunctions=true
ERRO failed to list settings error="error filtering and listing settings: no settings found for component 'weweweewew'"
atmos list metadata weweweewew
Copy code
INFO Filtering metadata component=weweweewew query="" maxColumns=0 format="" stackPattern="" templates=true
No metadata found for component 'weweweewew'
let's make the outputs of all commands the same: • If the component does not exis, it's an
ERRO
• if
vars
,
values
,
metadata
or
settings
does not exist, it should be a message like
Copy code
No metadata found for component 'c1'
v
Updates: values Key removed changed INFO to DEBUG
CleanShot 2025-03-28 at 10.39.33.png
e
What is the exit code on those errors?
I am conflicted and using log error for that, because it’s really log fatal.
v
not exit code only log.Error
e
When you ran those commands above, we need to be certain the exit code was non zero
v
if we need to exit I agree that makes more sense using fatal
at last I have all implementation consistent now so its fast to change
you guys decide
ok so for to clarify now is just a error and return
Copy code
if errors.As(err, &componentNotFoundErr) {
				log.Error(componentNotFoundErr.Error())
				return
			}
we can remove the return and use log.Fatal and that's it
all your comments is handled at this point
I also improved the tests cases for these edge cases above @Erik Osterman (Cloud Posse)
e
In Atmos — as with any well-behaved shell command — if the expected outcome isn’t achieved, the command should exit with a non-zero status. This is a foundational Unix convention. Exit codes are how scripts (and humans) know if a command succeeded or failed, and relying on output parsing to determine success is considered an anti-pattern. If you see this pattern missing elsewhere in Atmos, it doesn’t mean it’s intentional — it was an oversight from before we started emphasizing this. We realized not everyone was aware of this norm, so we’re being more deliberate about enforcing it now. Now, regarding how we exit: technically, all exits should happen from
main()
. The Go best practice is to return errors up the stack and handle exits in main, rather than calling
log.Fatal
or
os.Exit
midstream. We’re not doing this consistently today, and fixing it properly would require a larger refactor. So if you want to take the shortcut and use
log.Fatal
, that’s fine for now — it’s still better than silently failing. But if you’d prefer to do it the right way and return to main, that’s the preferred long-term direction.
v
I agree the way I am trying to do is always pop the error and exit in main()
ok let me change that and make sure we are doing it correctly
👍 1