#atmos-dev (2024-10)

Discuss atmos core development (golang)

2024-10-12

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
11:56:03 PM

@Erik Osterman (Cloud Posse) has joined the channel

linen avatar
linen
11:56:04 PM

@linen has joined the channel

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
11:56:29 PM

@Andriy Knysh (Cloud Posse) has joined the channel

Igor Rodionov avatar
Igor Rodionov
11:56:29 PM

@Igor Rodionov has joined the channel

Jeremy G (Cloud Posse) avatar
Jeremy G (Cloud Posse)
11:56:29 PM

@Jeremy G (Cloud Posse) has joined the channel

Matt Calhoun avatar
Matt Calhoun
11:56:30 PM

@Matt Calhoun has joined the channel

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
11:56:55 PM

set the channel topic: Discuss atmos core development (golang)

haitham911eg avatar
haitham911eg
11:57:09 PM

@haitham911eg has joined the channel

Vinny avatar
Vinny
11:57:09 PM

@Vinny has joined the channel

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

@haitham911eg lets move discussion here. @Andriy Knysh (Cloud Posse) can you help answer some questions to unblock him?

1
Sahadat Hossain avatar
Sahadat Hossain
11:58:33 PM

@Sahadat Hossain has joined the channel

haitham911eg avatar
haitham911eg

@Andriy Knysh (Cloud Posse) it is related to the part func LogError log_utils.go line 85

func LogError(cliConfig schema.CliConfiguration, err error)

the cliConfig has value cliConfig.Logs.Level on many cases on call func they pass empty value that force me to add global value branch https://github.com/cloudposse/atmos/tree/DEV-340

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

the LogError functions are called in many diff places

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

eirlier in the pipline (before atmos.yaml is parsed), we don’t have cliConfig yet, so in those cases we use just an empty struct

u.LogError(schema.CliConfiguration{}, err)
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

later in the pipeline, we have already parsed atmos.yaml and have cliConfig in all functions, so we use it

u.LogError(cliConfig, err)
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

(no globals please, they will create a lot of issues)

haitham911eg avatar
haitham911eg

yes I know that globals value causes issues but we have to keep tracking cliConfig.Logs.Level value

haitham911eg avatar
haitham911eg

because we need to handle print logs according to lvl of log

haitham911eg avatar
haitham911eg

I think we should use struct methods instead of normal functions so we can add schema.CliConfiguration{} to struct alternative we pass it on function args

haitham911eg avatar
haitham911eg

on that case no need to global variable

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

we already passing cliConfig as func argument to all functions. In your new code, you can pass cliConfig using any method, including passing as func arg or as struct method

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

Lets keep a list of improvements we can make. But stick with existing conventions so as not to increase the scope.

haitham911eg avatar
haitham911eg

Yes sure we have not increase the scope I just put points to be clear what we should to improve

haitham911eg avatar
haitham911eg

Please @Andriy Knysh (Cloud Posse) review my code on logerror func You will see that I use the args on it

haitham911eg avatar
haitham911eg

Anyway no need to worry about the global value that I added later we can improve But please think on how we can keep tracking log lvl value for all cases

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

@haitham911eg i’ll review your PR

1
Volodymyr avatar
Volodymyr
12:06:24 AM

@Volodymyr has joined the channel

david avatar
david
02:10:47 AM

@david has joined the channel

Michael avatar
Michael
02:51:33 AM

@Michael has joined the channel

    keyboard_arrow_up