Skip to content

reporegistry: add new LoadAllRepositoriesFromFS and use in tests#1038

Merged
thozza merged 1 commit intoosbuild:mainfrom
mvo5:load-repositories-fs
Nov 16, 2024
Merged

reporegistry: add new LoadAllRepositoriesFromFS and use in tests#1038
thozza merged 1 commit intoosbuild:mainfrom
mvo5:load-repositories-fs

Conversation

@mvo5
Copy link
Copy Markdown
Contributor

@mvo5 mvo5 commented Nov 12, 2024

This commit is a (hopefully) less controversial version of: #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.

[maybe this should be split into two commits actually]

This will allow me to use the test repos in the new image-builder-cli repo without the need to copy/import files from another git repo.

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.
Copy link
Copy Markdown
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

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

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.

@thozza thozza added this pull request to the merge queue Nov 16, 2024
Merged via the queue into osbuild:main with commit d7ae209 Nov 16, 2024
@mvo5
Copy link
Copy Markdown
Contributor Author

mvo5 commented Nov 18, 2024

Thanks! With this in I can now open the first real ibuilder PR :) in osbuild/image-builder-cli#1

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants