-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reporegistry: do not prepend repositories
in confPaths
#1179
Draft
mvo5
wants to merge
2
commits into
osbuild:main
Choose a base branch
from
mvo5:reporegistry-no-repos
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+34
−20
Conversation
This file contains 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
This commit changes `reporegistry.New()` to take a new parameter `repoConfigFS []fs.FS`. With that we can unexport the public `LoadAllRepositories{,FromFS}` as the only user for those is `composer` and that can simply use `.New()`. Note that we could also change `New()` to just take a single `repoConfig []fs.FS` but the downside of this is that the error reporting becomes more awkward, i.e. to report what paths where configured would (probably) require to build them manually via `fs.FS.Open(".").Stat().Name()` (but I have not tested this).
This commit breaks the API by changing the confPaths loading in reporegistry to stop prepending `repositories/`. This makes it easier to use this interface in e.g. `cmd/build`. Note that this requires changes in the upstream projecs, notably osbuild-composer and image-builder-cli.
mvo5
added a commit
to mvo5/osbuild-composer
that referenced
this pull request
Jan 29, 2025
This commit changes cmd/composer to use the `reporegistry.New` call again. This is a preparation for osbuild/images#1179 And undoes parts of osbuild#4378 but that is no longer necessary because in osbuild/images#946 the error is now passed on from `reporegistry.New()` in the same way as from `LoadRepositories()`.
This was referenced Jan 29, 2025
thozza
reviewed
Jan 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of the change looks good to me, but the code needs some fixes for tests to pass...
thozza
pushed a commit
to osbuild/osbuild-composer
that referenced
this pull request
Jan 29, 2025
This commit changes cmd/composer to use the `reporegistry.New` call again. This is a preparation for osbuild/images#1179 And undoes parts of #4378 but that is no longer necessary because in osbuild/images#946 the error is now passed on from `reporegistry.New()` in the same way as from `LoadRepositories()`.
mvo5
added a commit
to mvo5/osbuild-composer
that referenced
this pull request
Jan 29, 2025
This commit updates the cloudapi test that uses the real repositories to use the version of those from the "images" library. Composer no longer carries the default repos. Note that this can most likely be simplified once osbuild/images#1179 is merged.
mvo5
added a commit
to mvo5/osbuild-composer
that referenced
this pull request
Jan 29, 2025
This commit updates the cloudapi test that uses the real repositories to use the version of those from the "images" library. Composer no longer carries the default repos. Note that this can most likely be simplified once osbuild/images#1179 is merged.
mvo5
added a commit
to mvo5/osbuild-composer
that referenced
this pull request
Jan 29, 2025
This commit updates the cloudapi test that uses the real repositories to use the version of those from the "images" library. Composer no longer carries the default repos. Note that this can most likely be simplified once osbuild/images#1179 is merged.
mvo5
added a commit
to mvo5/osbuild-composer
that referenced
this pull request
Jan 30, 2025
This commit updates the cloudapi test that uses the real repositories to use the version of those from the "images" library. Composer no longer carries the default repos. Note that this can most likely be simplified once osbuild/images#1179 is merged.
mvo5
added a commit
to mvo5/osbuild-composer
that referenced
this pull request
Jan 30, 2025
This commit updates the cloudapi test that uses the real repositories to use the version of those from the "images" library. Composer no longer carries the default repos. Note that this can most likely be simplified once osbuild/images#1179 is merged.
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.
[draft as this has too few tests, but I want to get feedback
before writing them]
This PR changes the API for reporegistry in two incompatible
ways. The important change is that we want to drop the
prepending of
repositories
when loading from confPaths.Doing this on its own has the disadvantage of breaking
the API without breaking the builds. So this includes a
small tweak to allow adding repos via fs.FS directly
which will mean the code in ibcli will become simpler:
And for composer it will just be adding a
nil
to the New()call.
Note that this also allows us to unexport the LoadAllRepositories
repository loading as this is only used by composer or ibcli.
reporegistry: do not prepend
repositories
in confPathsThis commit breaks the API by changing the confPaths loading
in reporegistry to stop prepending
repositories/
. This makesit easier to use this interface in e.g.
cmd/build
.Note that this requires changes in the upstream projecs, notably
osbuild-composer and image-builder-cli.
This commit changes
reporegistry.New()
to take a new parameterrepoConfigFS []fs.FS
. With that we can unexport the publicLoadAllRepositories{,FromFS}
as the only user for those iscomposer
and that can simply use.New()
.