Skip to content

feat(codeowners): Add codeowners enforcement#110578

Merged
mikejihbe merged 19 commits intomasterfrom
ihbe/codeowners
Mar 18, 2026
Merged

feat(codeowners): Add codeowners enforcement#110578
mikejihbe merged 19 commits intomasterfrom
ihbe/codeowners

Conversation

@mikejihbe
Copy link
Contributor

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.

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

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
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 12, 2026
# Agent files
- '.claude/**'
- '.cursor/**'
- '.craft.yml'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i wouldn't say .craft.yml is an "agent file", this is a config file thats used to publish new releases

Comment on lines +1 to +5
# CODEOWNERS Coverage Baseline
# Files lacking CODEOWNERS coverage (sorted)
# Goal: Reduce this list to zero
#
# Generated by: codeowners-coverage baseline
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if this header could explain how to rebuild the baseline file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codeowners-coverage baseline is the command to regenerate it!

mikejihbe and others added 3 commits March 18, 2026 09:36
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>
@mikejihbe mikejihbe marked this pull request as ready for review March 18, 2026 18:39
@mikejihbe mikejihbe requested a review from a team as a code owner March 18, 2026 18:39
@mikejihbe mikejihbe changed the title feat(codeowners): Add codeownsers enforcement feat(codeowners): Add codeowners enforcement Mar 18, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Create PR

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-backend

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment on lines +66 to +71
/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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@wedamija wedamija Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/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>
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

/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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

python-version: '3.11'

- name: Install codeowners-coverage
run: pip install codeowners-coverage==0.2.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mikejihbe mikejihbe merged commit c4b6c49 into master Mar 18, 2026
55 checks passed
@mikejihbe mikejihbe deleted the ihbe/codeowners branch March 18, 2026 22:13
natemoo-re added a commit that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants