-
Notifications
You must be signed in to change notification settings - Fork 295
Fix: Exclude stored procedures from health checks #2997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Aniruddh25 <[email protected]>
Co-authored-by: Aniruddh25 <[email protected]>
Co-authored-by: Aniruddh25 <[email protected]>
Co-authored-by: JerryNixon <[email protected]>
|
@copilot Let's simplify the test to a single assert. We do not need a DataRow, this can be a fact. ExcludeStoedProcedures only, can you do this in an effort to simplify? |
Co-authored-by: JerryNixon <[email protected]>
Simplified in b7d59f6. Now a single test with one |
|
@copilot This unit test logic only checks the logic inside the unit test and does not actually test anything in the code, would you agree? |
Yes, you're right. The test duplicates the filter logic rather than testing the actual |
|
@copilot You don't have to remove it if you can just make it test the correct code. |
Co-authored-by: JerryNixon <[email protected]>
Updated in 2cd0254. The test now creates a |
Co-authored-by: JerryNixon <[email protected]>
souvikghosh04
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is simple but wondering if this should be configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Assert.IsTrue(healthCheckEntities.Any(e => e.Value.Source.Type == EntitySourceType.Table), | ||
| "Tables should be included in health checks"); |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test only verifies that tables are included but doesn't test views. According to the issue description and PR description, health checks should include "ONLY tables and views". Consider adding an assertion to verify that views are also included in health checks, especially since EntitySourceType.View is one of the three possible entity source types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot remove this unit test, it is not adding any value since it is performing the same condition check as done in the service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Instead, write a test where you provide a configuration with one of the entities being a stored procedure entity and other to be a test entity, then hit the health endpoint to get its results. In the data returned from the health endpoint, verify the stored procedure entity is not present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 7ec7372. The unit test has been deleted as it was duplicating the service logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in f71da2c. Created integration test HealthEndpoint_ExcludesStoredProcedures() that sets up a config with both table and stored procedure entities, hits the health endpoint, and verifies the stored procedure entity is not present in the results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Approving after discussing with @JerryNixon that we don't need to keep this optional but have stored procedure changes permanently skipped from health check due to its non-deterministic behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes to fix the test.
Co-authored-by: Aniruddh25 <[email protected]>
…alth checks Co-authored-by: Aniruddh25 <[email protected]>
Aniruddh25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to merge!
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Why make this change?
Closes #2977
Health check endpoint was returning results for stored procedures. Stored procedures should be excluded because:
What is this change?
Added filter in
HealthCheckHelper.UpdateEntityHealthCheckResultsAsync()to exclude entities withEntitySourceType.StoredProcedure:Only tables and views are now included in entity health checks.
How was this tested?
Added integration test
HealthEndpoint_ExcludesStoredProcedures()that:Book) and a stored procedure entity (GetData)/healthendpointThis test validates the end-to-end behavior through the actual health endpoint.
Sample Request(s)
Health check response after fix (stored procedure
GetSeriesActorsno longer appears):{ "status": "Healthy", "checks": [ { "name": "MSSQL", "tags": ["data-source"] }, { "name": "Book", "tags": ["rest", "endpoint"] } ] }Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.