Skip to content

Conversation

@zhiying-lin
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Requirements:

How has this code been tested

Special notes for your reviewer

@codecov
Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.30%. Comparing base (7473224) to head (f9e714f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ontrollers/hub/trafficmanagerprofile/controller.go 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #309   +/-   ##
=======================================
  Coverage   80.29%   80.30%           
=======================================
  Files          29       29           
  Lines        4101     4108    +7     
=======================================
+ Hits         3293     3299    +6     
- Misses        643      644    +1     
  Partials      165      165           

☔ 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.

@zhiying-lin zhiying-lin requested a review from Copilot May 23, 2025 07:13
Copy link

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 event emission for the TrafficManagerProfile controller to improve observability of key operations such as creation, update, and deletion. Key changes include:

  • Adding an EventRecorder to the Reconciler and initializing it in tests and main.
  • Updating controller logic to record events for API errors, successful programming, and deletion.
  • Enhancing integration tests to validate that the correct events are emitted during different operation scenarios.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pkg/controllers/hub/trafficmanagerprofile/suite_test.go Adds event recorder initialization in test setup.
pkg/controllers/hub/trafficmanagerprofile/controller_integration_test.go Introduces helper functions and assertions to validate emitted events in various cases.
pkg/controllers/hub/trafficmanagerprofile/controller.go Updates delete and update handlers to record events on error and success.
cmd/hub-net-controller-manager/main.go Passes the event recorder to the controller during manager setup.

@zhiying-lin zhiying-lin force-pushed the emit-profile-events branch from 327f897 to 32f3b09 Compare May 26, 2025 06:43
@zhiying-lin zhiying-lin force-pushed the emit-profile-events branch from 32f3b09 to f9e714f Compare May 26, 2025 07:17
@ryanzhang-oss ryanzhang-oss merged commit af25d4f into Azure:main May 26, 2025
10 of 12 checks passed
@zhiying-lin zhiying-lin deleted the emit-profile-events branch May 27, 2025 01:50
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.

2 participants