Skip to content

Auto-discover ignored users from silent escalation policies#276

Merged
clcollins merged 1 commit into
mainfrom
srepd/replace-ignoredusers
Jun 6, 2026
Merged

Auto-discover ignored users from silent escalation policies#276
clcollins merged 1 commit into
mainfrom
srepd/replace-ignoredusers

Conversation

@clcollins

Copy link
Copy Markdown
Owner

Summary

Closes #269

  • Adds ClassifyEscalationPolicy() — classifies policies as REAL (has schedule_reference targets) or SILENT (only user_reference targets)
  • Adds ExtractSilentPolicyUsers() — extracts deduplicated bot user IDs from all SILENT policies
  • Wires auto-discovery into NewConfigWithClient: when ignoredusers is absent, auto-discovers from silent policies; when present, uses manual list with deprecation warning
  • Adds ignoredusers to the deprecation registry
  • Enhances mock with EscalationPolicyResponses for testing policies with escalation rules

Test plan

  • 16 new unit tests (6 classify, 7 extract, 3 auto-discovery integration)
  • All existing tests pass unchanged
  • make test-all passes (fmt, vet, lint, test, race)
  • Manual test: removed ignoredusers from config → auto-discovery produces same incident list
  • Manual test: kept ignoredusers → deprecation warning logged, still works

🤖 Generated with Claude Code

Replace manual ignoredusers config with auto-discovery: classify
escalation policies as REAL (has schedule_reference) or SILENT
(user_reference only), then extract bot user IDs from SILENT policies.
Backward compatible — manual ignoredusers still works with deprecation
warning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.47826% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.56%. Comparing base (db7f237) to head (c21853e).

Files with missing lines Patch % Lines
pkg/pd/pd.go 93.02% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #276      +/-   ##
==========================================
+ Coverage   67.36%   67.56%   +0.19%     
==========================================
  Files          34       34              
  Lines        5169     5210      +41     
==========================================
+ Hits         3482     3520      +38     
- Misses       1468     1470       +2     
- Partials      219      220       +1     

☔ View full report in Codecov by Harness.
📢 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.

@clcollins clcollins merged commit bd30bb8 into main Jun 6, 2026
10 checks passed
Mhodesty pushed a commit to Mhodesty/srepd that referenced this pull request Jun 8, 2026
Follow-up to clcollins#276: now that ignored users are auto-discovered from
silent escalation policies, remove ignoredusers from the example
config generated by --create and from the optional keys help text.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

"IgnoredUsers" should be replaced with a filter based on EscalationPolicy

2 participants