Skip to content

refactor: PackageInfo interface - #320

Merged
niemeyer merged 1 commit into
canonical:mainfrom
upils:info-interface
Aug 31, 2026
Merged

niemeyer merged 1 commit into
canonical:mainfrom
upils:info-interface

Conversation

@upils

@upils upils commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator
  • Have you signed the CLA?

Introduce a manifestutil.PackageInfo interface to keep a clear separation of concerns: the manifest is built from whatever a package source reports, not from archive-specific data. As a result, manifestutil no longer depends on archive; archive.PackageInfo keeps its apt-native fields and gains Pkg-prefixed accessors to satisfy the interface. validatePackage now rejects non-SHA256 digests, with a TODO marking recording store digests as future work. This prepares fetching and recording of store bins without changing current behavior.

⚠️ This is an implementation competing with #316. Only one approach should be adopted and the other one discarded.

@upils upils added the Simple Nice for a quick look on a minute or two label Aug 18, 2026

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a nice step forward and aligns with the previous discussions.

Thanks for nailing it.

@niemeyer
niemeyer merged commit 4cad410 into canonical:main Aug 31, 2026
19 checks passed
Comment on lines +21 to +25
type PackageInfo interface {
PkgName() string
PkgVersion() string
// PkgRevision further identifies the package when the source versions are
// not unique on their own. It returns 0 when the source does not use

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One detail to be discussed here: manifestutil feels like a strange place for this, in principle, as this is a general interface used across the board. Let's see if we can find a better place please.

@ROCKsBot

ROCKsBot commented Sep 1, 2026 •

Copy link
Copy Markdown
Command Mean [s] Min [s] Max [s] Relative
BASE 15.194 ± 0.266 14.845 15.764 1.00
HEAD 15.392 ± 0.272 15.048 15.849 1.01 ± 0.03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simple Nice for a quick look on a minute or two

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants