Skip to content

Commit addc5d5

Browse files
committed
Adding project ownership resource
Allow configuring project ownership via a new resource called `sentry_project_ownership`. You can read more about ownership rules at https://docs.sentry.io/product/issues/ownership-rules API documentation: * https://docs.sentry.io/api/projects/retrieve-ownership-configuration-for-a-project/ * https://docs.sentry.io/api/projects/update-ownership-configuration-for-a-project
1 parent 57a2a4f commit addc5d5

File tree

6 files changed

+710
-0
lines changed

6 files changed

+710
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "sentry_project_ownership Resource - terraform-provider-sentry"
4+
subcategory: ""
5+
description: |-
6+
Sentry Project Ownership. See the Sentry documentation https://docs.sentry.io/api/projects/update-ownership-configuration-for-a-project/ for more information.
7+
---
8+
9+
# sentry_project_ownership (Resource)
10+
11+
Sentry Project Ownership. See the [Sentry documentation](https://docs.sentry.io/api/projects/update-ownership-configuration-for-a-project/) for more information.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `auto_assignment` (String) The auto-assignment mode. The options are: `none` - No auto-assignment, `all` - Assign all issues, `unhandled` - Assign unhandled issues.
21+
- `codeowners_auto_sync` (Boolean) Whether to automatically sync codeowners.
22+
- `fallthrough` (Boolean) Whether to fall through to the default ownership rules.
23+
- `organization` (String) The organization of this resource.
24+
- `project` (String) The project of this resource.
25+
- `raw` (String) Raw input for ownership configuration.

internal/apiclient/api.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,62 @@ paths:
801801
description: Forbidden
802802
"404":
803803
description: Not Found
804+
/0/projects/{organization_id_or_slug}/{project_id_or_slug}/ownership:
805+
parameters:
806+
- $ref: "#/components/parameters/organization_id_or_slug"
807+
- $ref: "#/components/parameters/project_id_or_slug"
808+
get:
809+
summary: Retrieve ownership configuration for a project
810+
operationId: getProjectOwnership
811+
responses:
812+
"200":
813+
description: OK
814+
content:
815+
application/json:
816+
schema:
817+
$ref: "#/components/schemas/ProjectOwnership"
818+
"401":
819+
description: Unauthorized
820+
"403":
821+
description: Forbidden
822+
"404":
823+
description: Not Found
824+
put:
825+
summary: Update ownership configuration for a project
826+
operationId: updateProjectOwnership
827+
requestBody:
828+
required: true
829+
content:
830+
application/json:
831+
schema:
832+
type: object
833+
required:
834+
- autoAssignment
835+
- codeownersAutoSync
836+
- fallthrough
837+
- raw
838+
properties:
839+
raw:
840+
type: string
841+
fallthrough:
842+
type: boolean
843+
autoAssignment:
844+
type: string
845+
codeownersAutoSync:
846+
type: boolean
847+
responses:
848+
"200":
849+
description: OK
850+
content:
851+
application/json:
852+
schema:
853+
$ref: "#/components/schemas/ProjectRule"
854+
"401":
855+
description: Unauthorized
856+
"403":
857+
description: Forbidden
858+
"404":
859+
description: Not Found
804860

805861
security:
806862
- bearerAuth: []
@@ -2018,6 +2074,30 @@ components:
20182074
type: array
20192075
items:
20202076
type: object
2077+
ProjectOwnership:
2078+
type: object
2079+
required:
2080+
- autoAssignment
2081+
- codeownersAutoSync
2082+
- dateCreated
2083+
- fallthrough
2084+
- lastUpdated
2085+
- raw
2086+
properties:
2087+
raw:
2088+
type: string
2089+
fallthrough:
2090+
type: boolean
2091+
dateCreated:
2092+
type: string
2093+
format: date-time
2094+
lastUpdated:
2095+
type: string
2096+
format: date-time
2097+
autoAssignment:
2098+
type: string
2099+
codeownersAutoSync:
2100+
type: boolean
20212101
Team:
20222102
type: object
20232103
required:

0 commit comments

Comments
 (0)