Repository navigation
distro: set distro.ID in DistroYAML by loader - #1688
Merged
Merged
Conversation
mvo5
force-pushed
the
distro-defs-cleanup1
branch
2 times, most recently
from
July 29, 2025 15:35
2db6ed3 to
ad22c3a
Compare
mvo5
marked this pull request as ready for review
July 29, 2025 15:35
achilleas-k
previously approved these changes
Jul 29, 2025
achilleas-k
left a comment
Member
There was a problem hiding this comment.
LGTM, but the linter is unhappy.
mvo5
force-pushed
the
distro-defs-cleanup1
branch
from
July 29, 2025 16:31
ad22c3a to
a090d5f
Compare
supakeen
previously approved these changes
Jul 30, 2025
supakeen
left a comment
Member
There was a problem hiding this comment.
The YAML linter seems to be complaining about a file you didn't touch.
mvo5
force-pushed
the
distro-defs-cleanup1
branch
from
July 30, 2025 06:21
a090d5f to
ae769eb
Compare
By setting the parsed distro.ID into DistroYAML we can simplify a lot of the cases where we currently use `nameVer string` for the various helpers. By using the id we avoid re-parsing the name and potentially raising error. This will simplify the code in the comming commits.
We use(d) `distroNameVer` a lot when accessing YAML data because that is what we had when transitioning from fedora/rhel distro abstraction to the generic distro. But now that everything is a generic distro we can actually use `distro.ID` everywhere which simplifies a lot of code and avoids (re)parsing the `distroNameVer`.
mvo5
force-pushed
the
distro-defs-cleanup1
branch
from
August 1, 2025 07:43
ae769eb to
5c227f2
Compare
supakeen
approved these changes
Aug 4, 2025
thozza
approved these changes
Aug 4, 2025
thozza
left a comment
Member
There was a problem hiding this comment.
Amazing! Thanks for figuring this out.
| dist, err := defs.NewDistroYAML("fedora-43") | ||
| require.NoError(t, err) | ||
| assert.Equal(t, &defs.DistroYAML{ | ||
| assert.Equal(t, dist, &defs.DistroYAML{ |
Member
There was a problem hiding this comment.
Nitpick: technically, the dist should be the third argument to Equal(), because the second is the "expected" value and the third is the "actual" value.
Contributor
Author
There was a problem hiding this comment.
Nice catch! Thank you, I will fix this in a followup (usually I get this right but sometimes I forget :)
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 4, 2025
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
distro: set
distro.IDinDistroYAMLby loaderBy setting the parsed distro.ID into DistroYAML we can
simplify a lot of the cases where we currently use
nameVer stringfor the various helpers. By using theid we avoid re-parsing the name and potentially raising
error. This will simplify the code in the comming commits.
distro: add/use
DistroYAML.IDconsistentlyWe use(d)
distroNameVera lot when accessing YAMLdata because that is what we had when transitioning
from fedora/rhel distro abstraction to the generic
distro. But now that everything is a generic distro
we can actually use
distro.IDeverywhere whichsimplifies a lot of code and avoids (re)parsing
the
distroNameVer.