Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1856 +/- ##
==========================================
+ Coverage 87.18% 87.21% +0.03%
==========================================
Files 143 144 +1
Lines 5539 5532 -7
==========================================
- Hits 4829 4825 -4
+ Misses 423 421 -2
+ Partials 287 286 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
848995a to
1ee4072
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a centralized warning handler to manage registry warnings and reduces code duplication. The change extracts warning handling logic from the Remote struct into a dedicated WarningHandler component with proper concurrency handling.
- Adds a new
WarningHandlertype with thread-safe warning deduplication - Removes warning handling code from the
Remotestruct to reduce bloat - Provides comprehensive test coverage for the new warning handler functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmd/oras/internal/option/warning_handler.go | New warning handler implementation with sync.Map for thread-safe deduplication |
| cmd/oras/internal/option/warning_handler_test.go | Comprehensive test suite covering deduplication, concurrency, and multi-registry scenarios |
| cmd/oras/internal/option/remote.go | Removes old warning handling code and integrates new WarningHandler |
| cmd/oras/internal/option/binary_target.go | Removes manual warning map initialization that's no longer needed |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1ee4072 to
3395408
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| type warningHandler struct { | ||
| warned sync.Map | ||
| } |
There was a problem hiding this comment.
I found the name warningHandler and warned a bit hard to understand... I don't have a good suggestion though. Is it more like a warner pool or something?
There was a problem hiding this comment.
Sounds good. I renamed to warningDeduplicator and the warner is now seen
e11068a to
ae7669e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This is ready for review |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
2b99cf9 to
c476067
Compare
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
c476067 to
f2f80e5
Compare
What this PR does / why we need it:
Add a warning deduplicator and some tests for it. Gets a little bloat out of options/remote.go