From 5dae34cff8b34b7a14e9d2610fef371823b718dc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 21 Jan 2025 10:10:29 +0100 Subject: [PATCH] progress: move from an internal package to external This commit makes the previously internal `progress` package an external API. The is the result of the discussion in images PR#1150 where we decided that the progress module is not a great fit for the "images" library. We want to share this code between bootc-image-builder and image-builder-cli now. In the future we will also want to use it in the `worker-executor` in `osbuild-composer` to parse the stream data from `osbuild`. We plan to merge bootc-image-builder and image-builder-cli medium term so importing code from bootc-image-buider in image-builder cli is not that stange. When we (longer-term) use this code the `worker-executor` we will need to think about this again and maybe put it back into images. However this commit unblocks us without making anything worse. --- bib/cmd/bootc-image-builder/main.go | 2 +- bib/{internal => pkg}/progress/export_test.go | 0 bib/{internal => pkg}/progress/progress.go | 0 bib/{internal => pkg}/progress/progress_test.go | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename bib/{internal => pkg}/progress/export_test.go (100%) rename bib/{internal => pkg}/progress/progress.go (100%) rename bib/{internal => pkg}/progress/progress_test.go (98%) diff --git a/bib/cmd/bootc-image-builder/main.go b/bib/cmd/bootc-image-builder/main.go index ceecc13c1..68daeedc9 100644 --- a/bib/cmd/bootc-image-builder/main.go +++ b/bib/cmd/bootc-image-builder/main.go @@ -27,10 +27,10 @@ import ( "github.com/osbuild/bootc-image-builder/bib/internal/buildconfig" podman_container "github.com/osbuild/bootc-image-builder/bib/internal/container" "github.com/osbuild/bootc-image-builder/bib/internal/imagetypes" - "github.com/osbuild/bootc-image-builder/bib/internal/progress" "github.com/osbuild/bootc-image-builder/bib/internal/setup" "github.com/osbuild/bootc-image-builder/bib/internal/source" "github.com/osbuild/bootc-image-builder/bib/internal/util" + "github.com/osbuild/bootc-image-builder/bib/pkg/progress" ) const ( diff --git a/bib/internal/progress/export_test.go b/bib/pkg/progress/export_test.go similarity index 100% rename from bib/internal/progress/export_test.go rename to bib/pkg/progress/export_test.go diff --git a/bib/internal/progress/progress.go b/bib/pkg/progress/progress.go similarity index 100% rename from bib/internal/progress/progress.go rename to bib/pkg/progress/progress.go diff --git a/bib/internal/progress/progress_test.go b/bib/pkg/progress/progress_test.go similarity index 98% rename from bib/internal/progress/progress_test.go rename to bib/pkg/progress/progress_test.go index 97f048cec..67a720d16 100644 --- a/bib/internal/progress/progress_test.go +++ b/bib/pkg/progress/progress_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/osbuild/bootc-image-builder/bib/internal/progress" + "github.com/osbuild/bootc-image-builder/bib/pkg/progress" ) func TestProgressNew(t *testing.T) {