feat(codeowners): Add codeowners enforcement#110578
Conversation
TLDR; 1. Codeowners coverage is now enforced in CI. Make sure new code has a github team in CODEOWNERS. 2. Try not to add to the exclusion-list. 3. If you are getting notified about changes you don’t care about, remind the dev to move their code into an owned part of the application to help us [modularize](https://www.notion.so/Application-Modularization-5454eff79f024b2bb0bc32a63a29cb44?pvs=21). More: https://www.notion.so/sentry/Enforcing-ownership-31f8b10e4b5d80c99362fe35e7b1ca8b?showMoveTo=true&saveParent=true
| # Agent files | ||
| - '.claude/**' | ||
| - '.cursor/**' | ||
| - '.craft.yml' |
There was a problem hiding this comment.
nit: i wouldn't say .craft.yml is an "agent file", this is a config file thats used to publish new releases
| # CODEOWNERS Coverage Baseline | ||
| # Files lacking CODEOWNERS coverage (sorted) | ||
| # Goal: Reduce this list to zero | ||
| # | ||
| # Generated by: codeowners-coverage baseline |
There was a problem hiding this comment.
It would be good if this header could explain how to rebuild the baseline file.
There was a problem hiding this comment.
codeowners-coverage baseline is the command to regenerate it!
Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
Co-authored-by: Mark Story <mark@mark-story.com>
Co-authored-by: Mark Story <mark@mark-story.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Duplicate CODEOWNERS entry for
/tests/sentry/api/- Removed the duplicate line 16 that assigned /tests/sentry/api/ to @getsentry/app-backend.
- ✅ Fixed: Multiple CODEOWNERS teams missing from
team_allowlist- Added four missing teams to the allowlist: app-backend, value-discovery, coding-workflows-sentry-frontend, and coding-workflows-sentry-backend.
Or push these changes by commenting:
@cursor push 12d32c0dfc
Preview (12d32c0dfc)
diff --git a/.codeowners-config.yml b/.codeowners-config.yml
--- a/.codeowners-config.yml
+++ b/.codeowners-config.yml
@@ -9,10 +9,13 @@
team_allowlist:
- getsentry/alerts-create-issues
- getsentry/alerts-notifications
+ - getsentry/app-backend
- getsentry/app-frontend
- getsentry/codecov
- getsentry/codecov-merge
- getsentry/coding-workflows
+ - getsentry/coding-workflows-sentry-backend
+ - getsentry/coding-workflows-sentry-frontend
- getsentry/crons
- getsentry/dashboards
- getsentry/data
@@ -58,6 +61,7 @@
- getsentry/team-javascript-sdks
- getsentry/team-web-sdk-backend
- getsentry/telemetry-experience
+ - getsentry/value-discovery
# File patterns to exclude from coverage checking
exclusions:
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -13,7 +13,6 @@
/src/sentry/testutils/ @getsentry/app-backend
/src/sentry/users/ @getsentry/app-backend
/tests/sentry/api/ @getsentry/app-backend
-/tests/sentry/api/ @getsentry/app-backend
/src/sentry/templates/ @getsentry/app-backend
/src/sentry/tasks/ @getsentry/app-backend
/.agents/skills/sentry-backend-bugs/ @getsentry/app-backendThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| /tests/sentry/deletions/ @getsentry/owners-snuba | ||
| /src/sentry/services/nodestore/ @getsentry/owners-snuba | ||
| /src/sentry/nodestore/ @getsentry/owners-snuba | ||
| /src/sentry/services/eventstore/ @getsentry/owners-snuba | ||
| /src/sentry/eventstore/ @getsentry/owners-snuba | ||
| /src/sentry/filestore/ @getsentry/owners-snuba |
There was a problem hiding this comment.
I'm not really sure this is right. I'd probably give these to backend, since they're kind of unowned
| /src/sentry/api/helpers/source_map_helper.py @getsentry/issue-workflow | ||
| /src/sentry/api/endpoints/ @getsentry/issue-workflow | ||
| /src/sentry/rules/ @getsentry/issue-detection-backend | ||
| /src/sentry/processing_errors/ @getsentry/issue-detection-backend |
There was a problem hiding this comment.
/src/sentry/processing_errors/ belongs to value-discovery
### Fixes - Removed duplicate `/tests/sentry/api/` entry from `.github/CODEOWNERS`. - Added missing teams (`getsentry/app-backend`, `getsentry/value-discovery`, `getsentry/coding-workflows-sentry-frontend`, `getsentry/coding-workflows-sentry-backend`) to the `team_allowlist` in `.codeowners-config.yml` to ensure accurate CODEOWNERS coverage checks. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| /static/app/stories/ @getsentry/design-engineering | ||
| /static/app/views/navigation/ @getsentry/design-engineering | ||
| /static/less/ @getsentry/design-engineering | ||
| /static/app/views/settings/ @getsentry/design-engineering |
There was a problem hiding this comment.
Broad settings rule overrides many specific team ownerships
High Severity
The new /static/app/views/settings/ rule for @getsentry/design-engineering at line 794 silently overrides at least 9 earlier, more specific settings ownership rules because CODEOWNERS uses "last match wins" semantics. Teams like alerts-notifications (projectAlerts, account/notifications), replay-frontend (featureFlags), enterprise (organizationAuth, organizationMembers), telemetry-experience (dynamicSampling), and ecosystem (organizationIntegrations, organizationDeveloperSettings, organizationDataForwarding) all lose their ownership of settings subdirectories.
Additional Locations (2)
| /static/app/views/navigation/ @getsentry/design-engineering | ||
| /static/less/ @getsentry/design-engineering | ||
| /static/app/views/settings/ @getsentry/design-engineering | ||
| /static/app/views/nav/ @getsentry/design-engineering |
There was a problem hiding this comment.
Broad nav rule overrides issue-workflow nav ownership
Medium Severity
The new /static/app/views/nav/ rule for @getsentry/design-engineering at line 795 overrides the earlier /static/app/views/nav/secondary/sections/issues/ rule for @getsentry/issue-workflow at line 665, because CODEOWNERS uses last-match-wins semantics. The issues nav section will incorrectly be owned by design-engineering instead of issue-workflow.
Additional Locations (1)
| python-version: '3.11' | ||
|
|
||
| - name: Install codeowners-coverage | ||
| run: pip install codeowners-coverage==0.2.1 |
There was a problem hiding this comment.
Bug: The CI workflow attempts to install codeowners-coverage==0.2.1 from the public PyPI, but the package only exists in a private index, causing the pip install step to fail.
Severity: HIGH
Suggested Fix
Modify the pip install command in the workflow file to use the private Sentry PyPI index. Add the --index-url flag pointing to Sentry's private index (https://pypi.devinfra.sentry.io/simple) to the pip install command to ensure it can locate and download the package.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: .github/workflows/codeowners-coverage.yml#L31
Potential issue: The GitHub Actions workflow at
`.github/workflows/codeowners-coverage.yml` executes `pip install
codeowners-coverage==0.2.1`. This command defaults to searching the public PyPI
repository. However, the `codeowners-coverage` package is hosted on a private Sentry
PyPI index. Since the workflow does not configure `pip` to use this private index via
the `--index-url` flag or a configuration file, the `pip install` command will fail with
a "Package not found" error, causing the CI build to fail.
claiming some unowned files for @getsentry/design-engineering per #110578



TLDR;
More: https://www.notion.so/sentry/Enforcing-ownership-31f8b10e4b5d80c99362fe35e7b1ca8b?showMoveTo=true&saveParent=true