Skip to content

Conversation

@macrat
Copy link
Owner

@macrat macrat commented May 17, 2025

Summary

  • avoid panic when checking if a target history is active
  • add unit test covering missing target case

Testing

  • go test ./internal/store -run ProbeHistoryMap_isActive -count=1

PR made by Codex

@macrat macrat requested a review from Copilot May 17, 2025 15:00
Copy link
Contributor

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 fixes a panic in the probe history map by updating the isActive function to safely handle absent targets, and it adds a unit test to verify this behavior.

  • Update isActive to safely check for target presence before evaluation
  • Add unit test to cover the case when a target is missing

Reviewed Changes

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

File Description
internal/store/probehistory_internal_test.go Added a unit test to ensure isActive behaves correctly on empty map
internal/store/probehistory.go Updated isActive to prevent a panic when the target is not found
Comments suppressed due to low confidence (1)

internal/store/probehistory.go:103

  • [nitpick] Consider updating the isActive function comment for clarity. A suggested update: 'isActive returns whether the specified target is active in the current execution.'
// isActive returns if is the specified target active in current execution or not.

@codecov-commenter
Copy link

codecov-commenter commented May 17, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.79%. Comparing base (92c47cc) to head (33ccb26).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            v0.17      #23   +/-   ##
=======================================
  Coverage   87.78%   87.79%           
=======================================
  Files          74       74           
  Lines        6460     6463    +3     
=======================================
+ Hits         5671     5674    +3     
  Misses        648      648           
  Partials      141      141           

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

@macrat macrat merged commit ac58be9 into v0.17 May 17, 2025
7 checks passed
@macrat macrat deleted the codex/update-isactive-method-to-handle-missing-targets branch May 17, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants