Skip to content

Conversation

TerryHowe
Copy link
Member

What this PR does / why we need it:

Add a warning handler and some tests for it. Gets a little bloat out of options/remote.go

Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.36%. Comparing base (d19ca44) to head (3395408).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1856      +/-   ##
==========================================
+ Coverage   85.32%   85.36%   +0.03%     
==========================================
  Files         143      144       +1     
  Lines        6739     6730       -9     
==========================================
- Hits         5750     5745       -5     
+ Misses        703      700       -3     
+ Partials      286      285       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TerryHowe TerryHowe force-pushed the feature-warning-handler branch from 848995a to 1ee4072 Compare September 12, 2025 17:03
@shizhMSFT shizhMSFT changed the title feature: add warning handler feat: add warning handler Sep 23, 2025
@shizhMSFT shizhMSFT requested a review from Copilot September 23, 2025 06:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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 WarningHandler type with thread-safe warning deduplication
  • Removes warning handling code from the Remote struct 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.

@TerryHowe TerryHowe force-pushed the feature-warning-handler branch from 1ee4072 to 3395408 Compare September 24, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant