getsentry / getsentry/sentry

Add public API and Terraform support for CODEOWNERS import

Open
#116,573 2 comments 0 reactions 1 assignee View on GitHub

@cvxluo is already working on this.

Since Aug 31, 2026.

2. High Improvement
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 23m
Merged PRs (30d)
607

Description

The full CODEOWNERS setup flow requires two steps: creating a code mapping
(RepositoryProjectPathConfig) and importing the CODEOWNERS file
(ProjectCodeOwners). A Terraform resource exists for code mappings via the
community provider, but no equivalent exists for CODEOWNERS imports. The
underlying API endpoints (POST /api/0/projects/{org}/{project}/codeowners/
and related) are marked ApiPublishStatus.PRIVATE, making them unsuitable for
stable external consumption.

This means the CODEOWNERS import step cannot be automated through any
supported, stable interface — teams are forced to use the UI or rely on
undocumented private endpoints.

Current behavior

  • Code mappings: scriptable via Terraform (sentry_organization_code_mappings)
  • CODEOWNERS import: UI-only; backing endpoints are private with no stability guarantees
  • POST /api/0/projects/{org}/{project}/codeowners/ accepts raw + codeMappingId and works, but is private
  • PUT and DELETE on /api/0/projects/{org}/{project}/codeowners/{id}/ are also private

Gap

Teams that manage Sentry configuration as code (Terraform, CI scripts) can
automate code mappings but must manually complete CODEOWNERS setup in the UI.
Any automation built against the private endpoints is brittle — no versioning,
no changelog notice on breaking changes.

Options

  1. Publish the CODEOWNERS API endpoints (GET/POST/PUT/DELETE on
    /api/0/projects/{org}/{project}/codeowners/) as PUBLIC — lowest friction
    path; enables scripting without new infrastructure
  2. Add a sentry_project_codeowners Terraform resource to the provider surface
    alongside the existing code mapping resource — full IaC parity
  3. Both — publish the API and add the Terraform resource; preferred for full parity

Action taken on behalf of Angelo de Voer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.