Skip to content

ci: disable omitzero modernizer - #2370

Open
cadejacobson wants to merge 1 commit into
coreos:mainfrom
cadejacobson:test/disable-omitzero-modernizer
Open

cadejacobson wants to merge 1 commit into
coreos:mainfrom
cadejacobson:test/disable-omitzero-modernizer

Conversation

@cadejacobson

@cadejacobson cadejacobson commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

This PR disables the omitzero modernizer in the Go 1.26 ci pipeline. All other modernizers remain enabled.

The analyzer here assumes that Ignition always uses standard-Golang-library JSON semantics, where omitempty has no effect on non-pointer structs. Butane instead imports github.com/clarketm/json and uses its Marshal and MarshalIndent functions which are not standard-library based. That encoder for Butane explicitly documents support for omitting structs whose fields are empty. Its implementation recursively checks exported fields and will honor the omitempty tag if present. Applying the suggestions would therefore change Butane’s output. Disabling the analyzer preserves existing serialization and removes 129 findings across eight generated schema files, including frozen specifications.

Note: the omitzero reference here is both a modernizer and the name of an optimization/flag. The omitzero analyzer checks for both omitzero and omitempty flags, both of which are harmless in this case but would introduce a change in behavior if accepted and removed. More information about this can be found at the official Golang omitzero modernizer documentation.

On the main branch, the checking gofmt line is at 1761, and on this branch, the checking gofmt line is at 420, so this successfully removes 76% of all go fix warnings.

@angelcerveraroldan angelcerveraroldan added the skip-notes This PR does not need release notes label Nov 27, 2026
@github-actions

Copy link
Copy Markdown

Binary size report (bin/amd64/ignition)

Size
Base (main) 33MiB
PR (#2370) 33MiB
Delta +0B (0.00%)

@yasminvalim yasminvalim left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks fro working on this @cadejacobson
LGTM!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-notes This PR does not need release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants