Skip to content

Add multi package support#579

Merged
joaquimrocha merged 8 commits intomainfrom
multi-pkg
Mar 11, 2022
Merged

Add multi package support#579
joaquimrocha merged 8 commits intomainfrom
multi-pkg

Conversation

@joaquimrocha
Copy link
Copy Markdown
Collaborator

@joaquimrocha joaquimrocha commented Feb 25, 2022

  • Add DB and backend support
  • Add UI
  • Add base testing
  • Ensure the files' positions are kept as originally added, after edition
  • Make sure the syncer can retrieve also more than one file

fixes #473

Copy link
Copy Markdown
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Looking good.

(I started a review, but it took a while... so am pausing for lunch. After I will test it out too.)

It's not clear to me why you didn't make extraFiles just files, and get rid of the existing file fields? Seems like it would make it less code and edge cases. I guess because it's quite an invasive change to do that?

@joaquimrocha
Copy link
Copy Markdown
Collaborator Author

It's not clear to me why you didn't make extraFiles just files, and get rid of the existing file fields? Seems like it would make it less code and edge cases. I guess because it's quite an invasive change to do that?

Yeah, I considered that, but it'd require a migration, and since we require at least one file to be associated with the package (the reason why the legacy code-base had the file as part of the package), I thought we may as well keep it like this.
I think the whole DB will require a re-design at some point, and these changes shouldn't make it more complicated than it is now to migrate at some point.

@joaquimrocha joaquimrocha force-pushed the multi-pkg branch 2 times, most recently from d5f625e to a026f50 Compare March 4, 2022 12:33
@illume
Copy link
Copy Markdown
Contributor

illume commented Mar 4, 2022

When I run make backend the lint fix changes backend/test/api/flatcar_package_test.go

22:05:54-rene~/dev/nebraska (multi-pkg)$ git diff
diff --git a/backend/test/api/flatcar_package_test.go b/backend/test/api/flatcar_package_test.go
index 3bd21bd..5fdc1aa 100644
--- a/backend/test/api/flatcar_package_test.go
+++ b/backend/test/api/flatcar_package_test.go
@@ -10,10 +10,11 @@ import (
        "testing"

        "github.com/google/uuid"
-       "github.com/kinvolk/nebraska/backend/pkg/config"
-       "github.com/kinvolk/nebraska/backend/pkg/server"
        "github.com/stretchr/testify/assert"
        "github.com/stretchr/testify/require"
+
+       "github.com/kinvolk/nebraska/backend/pkg/config"
+       "github.com/kinvolk/nebraska/backend/pkg/server"
 )

 func TestHostFlatcarPackage(t *testing.T) {

@pothos
Copy link
Copy Markdown
Member

pothos commented Mar 10, 2022

I've tested it with a Flatcar client and it works well (it ignored the second package).

The omaha protocol supports multiple packages and we need to also
allow several files in a response. Due to how Nebraska structures its
packages internally, this commit implements this feature as "extra
files" which can optionally be added to each package.
This will be needed and was extracted from the Headlamp project.
This commit adds the needed UI and API requests related to supporting
extra files in packages.
@joaquimrocha
Copy link
Copy Markdown
Collaborator Author

When I run make backend the lint fix changes backend/test/api/flatcar_package_test.go

22:05:54-rene~/dev/nebraska (multi-pkg)$ git diff
diff --git a/backend/test/api/flatcar_package_test.go b/backend/test/api/flatcar_package_test.go
index 3bd21bd..5fdc1aa 100644
--- a/backend/test/api/flatcar_package_test.go
+++ b/backend/test/api/flatcar_package_test.go
@@ -10,10 +10,11 @@ import (
        "testing"

        "github.com/google/uuid"
-       "github.com/kinvolk/nebraska/backend/pkg/config"
-       "github.com/kinvolk/nebraska/backend/pkg/server"
        "github.com/stretchr/testify/assert"
        "github.com/stretchr/testify/require"
+
+       "github.com/kinvolk/nebraska/backend/pkg/config"
+       "github.com/kinvolk/nebraska/backend/pkg/server"
 )

 func TestHostFlatcarPackage(t *testing.T) {

While we should fix this. It's not related to the PR.

@joaquimrocha joaquimrocha merged commit 91ddaea into main Mar 11, 2022
@joaquimrocha joaquimrocha deleted the multi-pkg branch March 11, 2022 18:59
@pothos
Copy link
Copy Markdown
Member

pothos commented Mar 13, 2022

Thanks everyone!

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.

[RFE] Ship multiple files with one update, let client pick which files to download

4 participants