Skip to content

Conversation

@baude
Copy link
Member

@baude baude commented Dec 3, 2025

Created two new types ArtifactReference and ArtifactStorageReference and switch the relevant exported functions to use these types.

ArtifactReference is a theoretical reference to an artifact. It is essentially a named. As such, anything a named can be, so can this. This type is used in functions like pull and add.

ArtifactStorageReference is also a theoretical reference to an artifact but to an artifact in the local store. The input to this type can be similar to an ArtifactReference. But it can also be a full or partial digest (sometimes called an ID) of the artifact in the store. It is used in functions like inspect and remove.

GetByNameOrDigest was removed we now lookup artifacts using an unexported function (for now) as an object of the store.

In my previous PR, issues outside the scope of typing were pointed out and while they are valid, I would like to address these issues in separate PRs. This PR does not address:

  • any locking issues that exist in artifacts
  • tests for the store or primary artifact functions

@github-actions github-actions bot added the common Related to "common" package label Dec 3, 2025
@baude
Copy link
Member Author

baude commented Dec 3, 2025

it should be noted that in addition to what my commit comments are, this will replace #463 ... but only a portion of it. i will address the broader issues in subsequent prs.

podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Dec 3, 2025
@podmanbot
Copy link

✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6565

Copy link
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

ACK overall

@@ -1,36 +1 @@
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks drastic (and potentially affects our ability to detect malicious tag changes) — if tools were complaining, go work sync && go work vendor might be sufficient.

Copy link
Contributor

Choose a reason for hiding this comment

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

I’m not sure what is going on here — this PR is not changing dependencies, is it? Try just dropping this file out of the commit, perhaps.

}

func getArtifactAndImageSource(ctx context.Context, as ArtifactStore, nameOrDigest string, options *libartTypes.FilterBlobOptions) (*libartifact.Artifact, types.ImageSource, error) {
func getArtifactAndImageSource(ctx context.Context, as ArtifactStore, asr ArtifactStoreReference, options *libartTypes.FilterBlobOptions) (*libartifact.Artifact, types.ImageSource, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably document that the store must be locked…

@mtrmac
Copy link
Contributor

mtrmac commented Dec 3, 2025

Given the API change, do we need a Podman PR lined up before merging this, to minimize drift/breakage?

@baude
Copy link
Member Author

baude commented Dec 6, 2025

Given the API change, do we need a Podman PR lined up before merging this, to minimize drift/breakage?

Yup!. I have a working branch that will just need a little TLC with the recent changes. Ill probably have done so by the time this merges.

@baude
Copy link
Member Author

baude commented Dec 6, 2025

I think I have address all the review comments that are non-locking based, reserving those for later.

podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Dec 6, 2025
Copy link
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

I’d think the change from .String() to .Name() in lookup code would break everything — am I missing something?

@@ -1,36 +1 @@
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m not sure what is going on here — this PR is not changing dependencies, is it? Try just dropping this file out of the commit, perhaps.

Created two new types ArtifactReference and ArtifactStorageReference and
switch the relevant exported functions to use these types.

ArtifactReference is a theoretical reference to an artifact.  It is
essentially a named.  As such, anything a named can be, so can this.
This type is used in functions like pull and add.

ArtifactStorageReference is also a theoretical reference to an artifact
but to an artifact in the local store.  The input to this type can be
similar to an ArtifactReference.  But it can also be a full or partial
digest (sometimes called an ID) of the artifact in the store.  It is
used in functions like inspect and remove.

GetByNameOrDigest was removed we now lookup artifacts using an
unexported function (for now) as an object of the store.

In my previous PR, issues outside the scope of typing were pointed out
and while they are valid, I would like to address these issues in
separate PRs. This PR does not address:
* any locking issues that exist in artifacts
* tests for the store or primary artifact functions

Signed-off-by: Brent Baude <bbaude@redhat.com>
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Dec 9, 2025
Copy link
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

LGTM if tests (and Podman tests against this) pass.

Thanks!

@mtrmac
Copy link
Contributor

mtrmac commented Dec 9, 2025

… OK still that unexpected go.work.sum change… but if CI doesn’t catch that, we get what we get.

@mheon
Copy link
Member

mheon commented Dec 9, 2025

/lgtm
/approve

@mheon
Copy link
Member

mheon commented Dec 9, 2025

Oh, that's right, we have no mergebot.

@mheon mheon enabled auto-merge December 9, 2025 20:51
@mheon mheon merged commit 5c13184 into containers:main Dec 9, 2025
38 checks passed
@Luap99
Copy link
Member

Luap99 commented Dec 10, 2025

Where is the ready to go podman PR for this? I don't even see the test PR on the podman side.

Folks, can we please stop merging breaking changes like this if the other side is not ready as well. Because now we block other people from doing the normal vendoring due the breaking changes.

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

Labels

common Related to "common" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants