Skip to content

Clarify CODEOWNERS code mapping binding in ownership rules docs #19347

Description

@sentry-junior

The Ownership Rules docs state:

This requires code mappings from stack trace linking to be configured first, so Sentry can map file paths between your build output and your repository.

This reads as a general prerequisite, but doesn't convey that CODEOWNERS import binds to one specific code mapping row at import/sync time. In getsentry/sentry, ProjectCodeOwners.repository_project_path_config is a unique FK to a single RepositoryProjectPathConfig, and convert_codeowners_syntax() bakes that mapping's stack/source root transform into the stored rule once, rather than resolving dynamically against the repo's current code mapping(s) at match time.

Practical implications not covered in the docs:

  • If a repo has multiple code mappings, CODEOWNERS must be (re-)imported once per mapping to cover each path variant ("Import CODEOWNERS" can be run multiple times with different mappings selected).
  • If a code mapping is added or changed after CODEOWNERS was imported, existing CODEOWNERS rules keep the old transform baked in and won't automatically pick up the new mapping without a re-import/re-sync.
  • A mismatched or no-op mapping (e.g., empty source root) silently produces CODEOWNERS rules that don't match actual in-app frame paths, with no error surfaced to the user.

Suggest clarifying in the #code-owners section that the code mapping used for CODEOWNERS is explicitly selected during import and is not automatically kept in sync with other mappings on the same repository integration.

via simon.

--

View Junior Session [Sentry]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions