Skip to content

libartifact: introduce handling of artifact store events#768

Open
nimdrak wants to merge 4 commits intocontainers:mainfrom
nimdrak:introduce_an_event_channel_for_artifactstore
Open

libartifact: introduce handling of artifact store events#768
nimdrak wants to merge 4 commits intocontainers:mainfrom
nimdrak:introduce_an_event_channel_for_artifactstore

Conversation

@nimdrak
Copy link
Copy Markdown

@nimdrak nimdrak commented Apr 15, 2026

fixed #465

@github-actions github-actions Bot added the common Related to "common" package label Apr 15, 2026
@nimdrak nimdrak force-pushed the introduce_an_event_channel_for_artifactstore branch from 4066258 to 0afac95 Compare April 15, 2026 08:47
@nimdrak nimdrak changed the title Introduce handling of artifact store events [WIP] Introduce handling of artifact store events Apr 15, 2026
@packit-as-a-service
Copy link
Copy Markdown

Packit jobs failed. @containers/packit-build please check.

@nimdrak nimdrak changed the title [WIP] Introduce handling of artifact store events [WIP] libartifact: Introduce handling of artifact store events Apr 15, 2026
@nimdrak nimdrak changed the title [WIP] libartifact: Introduce handling of artifact store events [WIP] libartifact: introduce handling of artifact store events Apr 15, 2026
@nimdrak nimdrak force-pushed the introduce_an_event_channel_for_artifactstore branch from 0afac95 to 3ee8036 Compare April 15, 2026 09:00
nimdrak added 2 commits April 15, 2026 09:50
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
@nimdrak nimdrak force-pushed the introduce_an_event_channel_for_artifactstore branch from 4f53335 to 6362450 Compare April 15, 2026 09:55
- Introduced withLockedLayout and copyArtifact helpers to resolve dupl lint issues.

- Maintained the original thread-locking scope for as.storePath access.

- Fixed a resource leak by ensuring the copier is always closed using defer and capturing the close error.

Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
@nimdrak nimdrak force-pushed the introduce_an_event_channel_for_artifactstore branch from ec94ce0 to 1770e3d Compare April 20, 2026 08:04
@nimdrak nimdrak marked this pull request as ready for review April 20, 2026 09:37
@nimdrak nimdrak changed the title [WIP] libartifact: introduce handling of artifact store events libartifact: introduce handling of artifact store events Apr 20, 2026
…annel

- TestArtifactStore_EventChannel deals with the cases: AddSuccessAndAddError, RemoveSuccess, PushError, PullError

Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
@nimdrak nimdrak force-pushed the introduce_an_event_channel_for_artifactstore branch from 1770e3d to 8afbf4d Compare April 20, 2026 10:13
// EventTypeArtifactPull represents an artifact pull.
EventTypeArtifactPull
// EventTypeArtifactPullError represents a failed artifact pull.
EventTypeArtifactPullError
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this new? Do we report errors as events?

Copy link
Copy Markdown
Author

@nimdrak nimdrak Apr 21, 2026

Choose a reason for hiding this comment

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

Yes, some of these are new.
Our podman/libpod and container-libs/common/libimage only handles PullError

I thought it would be beneficial to notify clients about other errors as well, such as AddError, RemoveError, and PushError. And I also add

However, if there's a specific reason why we only track PullError, I am completely open to removing these new additions.

What do you think?

Copy link
Copy Markdown
Author

@nimdrak nimdrak Apr 21, 2026

Choose a reason for hiding this comment

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

While I introduced AddEvent, I intentionally left out other events like Extract and Inspect. These are new too, but I only added AddEvent since it's the only one that actually modifies the artifact store.

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.

[libartifact] Introduce an event channel in ArtifactStore

2 participants