perf(internal/civisibility): cache CODEOWNERS discovery misses#4699
Conversation
BenchmarksBenchmark execution time: 2026-04-28 10:12:35 Comparing candidate commit 3c237c5 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 210 metrics, 8 unstable metrics.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 3c237c5 | Docs | Datadog PR Page | Give us feedback! |
1f7ab1c
into
main
What does this PR do?
Caches CI Visibility CODEOWNERS discovery misses. Successful CODEOWNERS loads were already cached, but when no CODEOWNERS file existed, each call to
GetCodeOwners()repeated the same filesystem checks. This PR records that the initial lookup completed with no file and returnsnildirectly on later calls.The change keeps CODEOWNERS parsing and matching behavior unchanged. Existing-but-invalid CODEOWNERS files are not cached as misses, so they remain retryable if fixed during tests.
Motivation
Reduce repeated CI Visibility startup/test-source overhead in repositories without CODEOWNERS while preserving the existing process-local configuration model.
Reviewers Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Validation performed:
go test ./internal/civisibility/utils/...go test ./internal/civisibility/integrations/...go test ./internal/civisibility/utils -run 'TestGetCodeOwners' -count=10git diff --check