Conversation
Reviewer's GuideThis PR centralizes Docker image pulling logic, adds utilities for inspecting and retrieving image labels, introduces generic map helpers for tests, defines required image labels, and extends acceptance tests to validate image metadata. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @petrpinkas - I've reviewed your changes - here's some feedback:
- You’re creating a new Docker client (and deferring Close) in almost every helper – consider centralizing client creation (and context passing) so you can reuse a single client and avoid repeated setup/teardown.
- In FileFromImage you
panicon client initialization failure – it would be better to return an error instead so the caller can handle failures gracefully rather than crashing the test binary. - Most functions call context.TODO(); accepting a context parameter from the caller would make it easier to manage timeouts and cancellations across these image operations.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You’re creating a new Docker client (and deferring Close) in almost every helper – consider centralizing client creation (and context passing) so you can reuse a single client and avoid repeated setup/teardown.
- In FileFromImage you `panic` on client initialization failure – it would be better to return an error instead so the caller can handle failures gracefully rather than crashing the test binary.
- Most functions call context.TODO(); accepting a context parameter from the caller would make it easier to manage timeouts and cancellations across these image operations.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
This is how labels report looks like: |
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Consider refactoring Docker client creation (and closing) into a shared helper so you don’t recreate a new client in every utility function.
- In FileFromImage you’re panicking on client init error—switch that to returning an error to keep error handling consistent across your utilities.
- Rather than using context.TODO inside InspectImageForLabels and PullImageIfNotPresentLocally, accept a context.Context parameter to enable cancellation and timeouts.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider refactoring Docker client creation (and closing) into a shared helper so you don’t recreate a new client in every utility function.
- In FileFromImage you’re panicking on client init error—switch that to returning an error to keep error handling consistent across your utilities.
- Rather than using context.TODO inside InspectImageForLabels and PullImageIfNotPresentLocally, accept a context.Context parameter to enable cancellation and timeouts.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
kdacosta0
left a comment
There was a problem hiding this comment.
Great PR
I've left two minor comments in the code: one required typo fix and one non-blocking suggestion.
I tested this locally: the tests pass against the 1.3.0 snapshot and correctly fail when I introduce an invalid expectation - the logic works perfectly
LGTM, approved once the typo is addressed
Check labels of all images
Currently we check only few basic labels, other will be decided later.
Other improvement is, that images are pulled only once for all the tests. This improves performance significantly.
Summary by Sourcery
Add utilities and tests for inspecting and validating Docker image labels, refactor existing image handling to reuse a shared pull function, and extend test support with generic map operations
New Features:
Enhancements:
Tests:
Summary by Sourcery
Add reusable utilities for pulling Docker images and inspecting their labels, refactor existing image handling to use the new pull logic, and extend acceptance tests to validate image labels using generic map helpers
New Features:
Enhancements:
Tests: