Skip to content

Fix CODEOWNERS empty path parsing#117484

Closed
cursor[bot] wants to merge 2 commits into
masterfrom
validationerror-raw-errordetailstringparse-ad2zf4
Closed

Fix CODEOWNERS empty path parsing#117484
cursor[bot] wants to merge 2 commits into
masterfrom
validationerror-raw-errordetailstringparse-ad2zf4

Conversation

@cursor

@cursor cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes CODEOWNERS schema updates when path mapping collapses a CODEOWNERS path to an empty ownership matcher such as codeowners: #team.

Summary

  • Preserve mapped CODEOWNERS root paths as / so conversion never emits codeowners: with an empty matcher.
  • Skip legacy/invalid empty codeowners: matchers before invoking the strict grammar parser.
  • Preserve ownerless CODEOWNERS rules with non-empty paths as exclusions, including mapped-root exclusions like codeowners:/.
  • Add regression coverage for conversion, schema creation, and the update_code_owners_schema task path.

Test Plan

  • python3 - <<'PY' ... PY isolated smoke test passed: converted '/apps @octocat\n' to 'codeowners:/ octocat@sentry.io\n', converted the ownerless exclusion '/apps\n' to 'codeowners:/\n', skipped codeowners: #discover, and verified codeowners:/apps/github still parses as a valid ownerless exclusion.
  • python3 -m compileall -q src/sentry/issues/ownership/grammar.py tests/sentry/issues/ownership/test_grammar.py tests/sentry/tasks/test_code_owners.py
  • git diff --check
  • Attempted .venv/bin/pytest -n3 -svv --reuse-db ... but .venv/bin/pytest is unavailable in this cloud workspace.
  • Attempted .venv/bin/prek run -q --files ... but .venv/bin/prek is unavailable in this cloud workspace.
  • Attempted SENTRY_DEVENV_FRONTEND_ONLY=1 devenv sync but devenv is unavailable in this cloud workspace.
  • Attempted make test-selective but it fails before running tests because gcloud is not installed.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Open in Web Open in Cursor 

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 11, 2026
@cvxluo cvxluo closed this Jun 12, 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.

2 participants