reporegistry: add new LoadAllRepositoriesFromFS and use in tests#1038
Merged
thozza merged 1 commit intoosbuild:mainfrom Nov 16, 2024
Merged
reporegistry: add new LoadAllRepositoriesFromFS and use in tests#1038thozza merged 1 commit intoosbuild:mainfrom
LoadAllRepositoriesFromFS and use in tests#1038thozza merged 1 commit intoosbuild:mainfrom
Conversation
This commit is a (hopefully) less controversial version of: osbuild#1037 Here only a new helper to load repository information from an `fs.FS` is added and only used for loading the test repositories. This will help to have a single test repository that can be embedded accross osbuild-composer, image-builder and images. It also removes the public "NewTestedDefault()" in favor of a new `testrepos.New()` helper so that the `reporegistry` only has non-test API left.
This was referenced Nov 12, 2024
thozza
approved these changes
Nov 16, 2024
Member
thozza
left a comment
There was a problem hiding this comment.
This looks good to me.
I admit that it feels a bit weird to use embedded repos in the gen-manifests tool (other places are perfectly fine), but I could not come up with a reasonable scenario in which it would be an issue. Since previously, it would default to the repositories from <project_root>/test/data/repositories, this looks OK.
Contributor
Author
|
Thanks! With this in I can now open the first real |
thozza
added a commit
to thozza/osbuild-images
that referenced
this pull request
Nov 27, 2024
After the rework done by PR#1038 [1], the `configFile` changed from the file path string to `fs.File` instance. As a result, logging it makes the output verbose, as it logs the whole content of the loaded file (repo URLs, GPG keys, etc.). Revert to the old behavior by logging `fileEntry.Name()` for the loaded repository. [1] osbuild#1038 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
thozza
added a commit
to thozza/osbuild-images
that referenced
this pull request
Nov 27, 2024
After the rework done by PR#1038 [1], the `configFile` changed from the file path string to `fs.File` instance. As a result, logging it makes the output verbose, as it logs the whole content of the loaded file (repo URLs, GPG keys, etc.). Revert to the old behavior by logging `fileEntry.Name()` for the loaded repository. [1] osbuild#1038 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Nov 28, 2024
After the rework done by PR#1038 [1], the `configFile` changed from the file path string to `fs.File` instance. As a result, logging it makes the output verbose, as it logs the whole content of the loaded file (repo URLs, GPG keys, etc.). Revert to the old behavior by logging `fileEntry.Name()` for the loaded repository. [1] #1038 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
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.
This commit is a (hopefully) less controversial version of: #1037
Here only a new helper to load repository information from an
fs.FSis added and only used for loading the test repositories.This will help to have a single test repository that can be embedded accross osbuild-composer, image-builder and images.
It also removes the public "NewTestedDefault()" in favor of a new
testrepos.New()helper so that thereporegistryonly has non-test API left.[maybe this should be split into two commits actually]
This will allow me to use the test repos in the new
image-builder-clirepo without the need to copy/import files from another git repo.