Skip to content
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

Select latest package from multiple archives #79

Closed

Conversation

woky
Copy link
Contributor

@woky woky commented Jun 21, 2023

In the future, we'd like to support different kinds of archives which
have a non-empty intersection of packages. In other words, we'd like to
support archives that partly override the Ubuntu archive.

Currently, each sliced package is tied to an archive via the "archive"
property that defaults to the default archive. Drop this link from the
sliced packages to the archives and select the latest available version
of the package from all configured archives.

This commit, in effect, doesn't change the current behavior because we
don't allow archives to define their URLs. It's only preparation for
future commits that will add support for different types of archives.

@woky woky added Blocked Waiting for something external and removed Blocked Waiting for something external labels Jun 21, 2023
@woky woky force-pushed the pub/slicer-multi-archive-package-selection branch from b11946f to a022ce6 Compare June 21, 2023 17:54
@woky woky mentioned this pull request Jun 21, 2023
1 task
@woky
Copy link
Contributor Author

woky commented Jun 21, 2023

This PR depends on #69

@woky woky added the Blocked Waiting for something external label Jun 21, 2023
@woky woky force-pushed the pub/slicer-multi-archive-package-selection branch 2 times, most recently from 2cb56b4 to cb31486 Compare June 22, 2023 10:38
@woky woky force-pushed the pub/slicer-multi-archive-package-selection branch 2 times, most recently from 3f31d55 to b3f7a09 Compare August 30, 2023 12:04
@woky woky force-pushed the pub/slicer-multi-archive-package-selection branch from b3f7a09 to 21d919f Compare September 19, 2023 06:07
@woky woky force-pushed the pub/slicer-multi-archive-package-selection branch 3 times, most recently from 8c43341 to 7e27954 Compare October 9, 2023 19:15
woky added 3 commits October 12, 2023 18:39
Currently we only test with the embedded base-files files package. This
quite limits what we can test. But since commit a3315e3
("testutil/pkgdata: Create deb programatically") we have the ability to
define our own custom package content.

Add support for testing with custom packages. These can be defined in
each test case per archive name. The content can be defined directly in
test case definition with the help of testutil.MustMakeDeb().

The package content is wrapped in the testPackage structure. This
introduces one level of nesting in each test case package definition. In
future, we will add package metadata to the package definition, namely
version. So wrapping the package content in the structure now and later
just adding a new field to it the structure later will make the future
diff much smaller.
At some point we will need to get information about (deb) packages from
(Go) packages other than archive, namely from the slicer package.
For instance:
- Package entries in Chisel DB will include version, digest and
  architecture.
- Multi-archive package selection will need to know versions of a
  package in all configured archives.

Add Info() method to the Archive interface that returns a new
PackageInfo interface that contains accessors for the underlying
control.Section of the package. Currently these accessors are Name(),
Version(), Arch() and SHA256() methods.

The reason to introduce PackageInfo interface instead of returing
control.Section directly is keep the archive abstraction and not leak
implementation details.
In the future, we'd like to support different kinds of archives which
have a non-empty intersection of packages. In other words, we'd like to
support archives that partly override the Ubuntu archive.

Currently, each sliced package is tied to an archive via the "archive"
property that defaults to the default archive. Drop this link from the
sliced packages to the archives and select the latest available version
of the package from all configured archives.

This commit, in effect, doesn't change the current behavior because we
don't allow archives to define their URLs. It's only preparation for
future commits that will add support for different types of archives.
@woky woky force-pushed the pub/slicer-multi-archive-package-selection branch from 7e27954 to c551dc3 Compare October 12, 2023 16:40
@letFunny
Copy link
Collaborator

Per our offline discussion, I think our best way forward is to close this PR and discuss with @rebornplusplus to see if it is a priority right now, and how to amend the code here to make it compatible with the latest changes. We will take that discussion offline and we can always re-open the PRs or create new ones as we see fit.

@cjdcordeiro cjdcordeiro added the Decaying It's been a while, close or act on it label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Waiting for something external Decaying It's been a while, close or act on it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants