Skip to content

command/output: Ignore warnings in JSON mode#38530

Merged
radeksimko merged 2 commits intomainfrom
radek/ignore-warns-in-output-json
May 6, 2026
Merged

command/output: Ignore warnings in JSON mode#38530
radeksimko merged 2 commits intomainfrom
radek/ignore-warns-in-output-json

Conversation

@radeksimko
Copy link
Copy Markdown
Member

@radeksimko radeksimko commented May 6, 2026

Fixes #38512
Closes #38513

Ideally we would just print out the diagnostics in the JSON mode, like we do in other JSON formatted output from other commands, but as @SarahFrench pointed out, this cannot be done easily (without breaking changes) since the format does not currently support versioning and doesn't allow for easy expansion:

{
	"foo":{
		"sensitive":false,
		"type":"string",
		"value":"bar"
	}
}

If we were to break things in the future and introduce the diagnostics, the likely format would be something like this:

{
  "format_version": "1.0",
  "outputs": {
    "greeting": {
        "sensitive": false,
        "type": "string",
        "value": "hello world"
    }
  },
  "diagnostics": []
}

Target Release

1.15.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@radeksimko radeksimko requested a review from a team as a code owner May 6, 2026 09:04
@radeksimko radeksimko added the 1.15-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label May 6, 2026
Copy link
Copy Markdown
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! The day we can get JSON output (more) standardised will be a good day 🌥️

@radeksimko radeksimko merged commit badc70c into main May 6, 2026
8 of 9 checks passed
@radeksimko radeksimko deleted the radek/ignore-warns-in-output-json branch May 6, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.15-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation warning pollutes STDOUT with output -json

2 participants