Add public API and Terraform support for CODEOWNERS import
@cvxluo is already working on this.
Since Aug 31, 2026.
- 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/acceptsraw+codeMappingIdand works, but is privatePUTandDELETEon/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
- Publish the CODEOWNERS API endpoints (
GET/POST/PUT/DELETEon
/api/0/projects/{org}/{project}/codeowners/) asPUBLIC— lowest friction
path; enables scripting without new infrastructure - Add a
sentry_project_codeownersTerraform resource to the provider surface
alongside the existing code mapping resource — full IaC parity - Both — publish the API and add the Terraform resource; preferred for full parity
Action taken on behalf of Angelo de Voer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.