abra recipe upgrade -m can't be parsed as JSON #477

Closed
opened 2025-01-08 17:54:02 +00:00 by 3wordchant · 3 comments
Owner
➜ abra-dev recipe upgrade -m discourse
INFO no new versions available for redis, assuming 7.4-alpine is the latest (use -a/--all-tags to see all anyway)
{"app":{"service":"app","image":"bitnami/discourse","tag":"3.3.1","upgrades":["9.0.4","9.0.3","3.3.3","3.3.2"]},"db":{"service":"db","image":"postgres","tag":"13","upgrades":["17","16","15","14"]},"sidekiq":{"service":"sidekiq","image":"bitnami/discourse","tag":"3.3.1","upgrades":["9.0.4","9.0.3","3.3.3","3.3.2"]}}

@cas's suggestion (and I agree) is to have that (and any other) INFO warnings JSON-formatted, but sent to STDERR instead of STDOUT so they can easily be handled separately by scripts

``` ➜ abra-dev recipe upgrade -m discourse INFO no new versions available for redis, assuming 7.4-alpine is the latest (use -a/--all-tags to see all anyway) {"app":{"service":"app","image":"bitnami/discourse","tag":"3.3.1","upgrades":["9.0.4","9.0.3","3.3.3","3.3.2"]},"db":{"service":"db","image":"postgres","tag":"13","upgrades":["17","16","15","14"]},"sidekiq":{"service":"sidekiq","image":"bitnami/discourse","tag":"3.3.1","upgrades":["9.0.4","9.0.3","3.3.3","3.3.2"]}} ``` @cas's suggestion (and I agree) is to have that (and any other) INFO warnings JSON-formatted, but sent to STDERR instead of STDOUT so they can easily be handled separately by scripts
3wordchant added the
bug
label 2025-01-08 17:54:02 +00:00
Owner

@3wordchant @cas nice yeh, thx for reporting. I faced this elsewhere. My solution was to send this output to DEBUG level instead (only appears with you --debug). It's a lazier option but is much easier to implement. What do you think?

@3wordchant @cas nice yeh, thx for reporting. I faced this elsewhere. My solution was to send this output to `DEBUG` level instead (only appears with you `--debug`). It's a lazier option but is much easier to implement. What do you think?
decentral1se added the
release-candidate
label 2025-01-08 21:44:11 +00:00
Owner

Hmmm on second thoughts, that might break expectations on the non-machine output. I could potentially conditionally not output if we see --machine but that be feels a bit weird. But equally as weird as putting some INFO into stderr for specific commands? Perhaps logging should be disabled for --machine output? I'm not sure.

Hmmm on second thoughts, that might break expectations on the non-machine output. I could potentially conditionally not output if we see `--machine` but that be feels a bit weird. But equally as weird as putting some `INFO` into `stderr` for specific commands? Perhaps logging should be disabled for `--machine` output? I'm not sure.
Member

Could we log to stderr only when --machine is provided?

Could we log to stderr only when --machine is provided?
decentral1se added this to the abra v0.10.0 project 2025-01-09 11:04:33 +00:00
decentral1se moved this to Done in abra v0.10.0 on 2025-04-14 22:00:59 +00:00
decentral1se moved this to Done in abra v0.10.0 on 2025-04-14 22:01:01 +00:00
decentral1se moved this to Done in abra v0.10.0 on 2025-04-16 05:16:08 +00:00
decentral1se moved this to Done in abra v0.10.0 on 2025-04-16 05:16:10 +00:00
decentral1se moved this to Done in abra v0.10.0 on 2025-04-19 07:28:29 +00:00
decentral1se moved this to Done in abra v0.10.0 on 2025-04-21 17:48:16 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#477
No description provided.