Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose change request config #33

Merged
merged 4 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ README.md
api/openapi.yaml
api_api_tokens.go
api_auth.go
api_change_requests.go
api_context.go
api_environments.go
api_projects.go
Expand All @@ -20,6 +21,8 @@ docs/AdminPermissionsSchemaPermissionsEnvironmentsInner.md
docs/ApiTokenSchema.md
docs/ApiTokensSchema.md
docs/AuthAPI.md
docs/ChangeRequestEnvironmentConfigSchema.md
docs/ChangeRequestsAPI.md
docs/ContextAPI.md
docs/ContextFieldSchema.md
docs/CreateApiTokenSchema.md
Expand Down Expand Up @@ -89,6 +92,7 @@ docs/ServiceAccountsAPI.md
docs/ServiceAccountsSchema.md
docs/SetSamlSettings415Response.md
docs/UpdateApiTokenSchema.md
docs/UpdateChangeRequestEnvironmentConfigSchema.md
docs/UpdateContextFieldSchema.md
docs/UpdateEnvironmentSchema.md
docs/UpdateProjectEnterpriseSettingsSchema.md
Expand All @@ -105,6 +109,7 @@ model_admin_permissions_schema_permissions.go
model_admin_permissions_schema_permissions_environments_inner.go
model_api_token_schema.go
model_api_tokens_schema.go
model_change_request_environment_config_schema.go
model_context_field_schema.go
model_create_api_token_schema.go
model_create_api_token_schema_one_of.go
Expand Down Expand Up @@ -170,6 +175,7 @@ model_service_account_schema.go
model_service_accounts_schema.go
model_set_saml_settings_415_response.go
model_update_api_token_schema.go
model_update_change_request_environment_config_schema.go
model_update_context_field_schema.go
model_update_environment_schema.go
model_update_project_enterprise_settings_schema.go
Expand All @@ -181,6 +187,7 @@ model_user_with_project_role_schema.go
response.go
test/api_api_tokens_test.go
test/api_auth_test.go
test/api_change_requests_test.go
test/api_context_test.go
test/api_environments_test.go
test/api_projects_test.go
Expand Down
4 changes: 4 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Class | Method | HTTP request | Description
*AuthAPI* | [**SetOidcSettings**](docs/AuthAPI.md#setoidcsettings) | **Post** /api/admin/auth/oidc/settings | Set OIDC settings
*AuthAPI* | [**SetSamlSettings**](docs/AuthAPI.md#setsamlsettings) | **Post** /api/admin/auth/saml/settings | Update SAML auth settings
*AuthAPI* | [**SetSimpleSettings**](docs/AuthAPI.md#setsimplesettings) | **Post** /api/admin/auth/simple/settings | Update Simple auth settings
*ChangeRequestsAPI* | [**GetProjectChangeRequestConfig**](docs/ChangeRequestsAPI.md#getprojectchangerequestconfig) | **Get** /api/admin/projects/{projectId}/change-requests/config | Retrieves change request configuration for a project
*ChangeRequestsAPI* | [**UpdateProjectChangeRequestConfig**](docs/ChangeRequestsAPI.md#updateprojectchangerequestconfig) | **Put** /api/admin/projects/{projectId}/environments/{environment}/change-requests/config | Updates change request configuration for an environment in the project
*ContextAPI* | [**CreateContextField**](docs/ContextAPI.md#createcontextfield) | **Post** /api/admin/context | Create a context field
*ContextAPI* | [**DeleteContextField**](docs/ContextAPI.md#deletecontextfield) | **Delete** /api/admin/context/{contextField} | Delete an existing context field
*ContextAPI* | [**GetContextField**](docs/ContextAPI.md#getcontextfield) | **Get** /api/admin/context/{contextField} | Gets context field
Expand Down Expand Up @@ -135,6 +137,7 @@ Class | Method | HTTP request | Description
- [AdminPermissionsSchemaPermissionsEnvironmentsInner](docs/AdminPermissionsSchemaPermissionsEnvironmentsInner.md)
- [ApiTokenSchema](docs/ApiTokenSchema.md)
- [ApiTokensSchema](docs/ApiTokensSchema.md)
- [ChangeRequestEnvironmentConfigSchema](docs/ChangeRequestEnvironmentConfigSchema.md)
- [ContextFieldSchema](docs/ContextFieldSchema.md)
- [CreateApiTokenSchema](docs/CreateApiTokenSchema.md)
- [CreateApiTokenSchemaOneOf](docs/CreateApiTokenSchemaOneOf.md)
Expand Down Expand Up @@ -200,6 +203,7 @@ Class | Method | HTTP request | Description
- [ServiceAccountsSchema](docs/ServiceAccountsSchema.md)
- [SetSamlSettings415Response](docs/SetSamlSettings415Response.md)
- [UpdateApiTokenSchema](docs/UpdateApiTokenSchema.md)
- [UpdateChangeRequestEnvironmentConfigSchema](docs/UpdateChangeRequestEnvironmentConfigSchema.md)
- [UpdateContextFieldSchema](docs/UpdateContextFieldSchema.md)
- [UpdateEnvironmentSchema](docs/UpdateEnvironmentSchema.md)
- [UpdateProjectEnterpriseSettingsSchema](docs/UpdateProjectEnterpriseSettingsSchema.md)
Expand Down
116 changes: 116 additions & 0 deletions client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,65 @@ paths:
summary: Get the environment with `name`
tags:
- Environments
/api/admin/projects/{projectId}/change-requests/config:
get:
description: "Given a projectId, this endpoint will retrieve change request\
\ configuration for the project"
operationId: getProjectChangeRequestConfig
parameters:
- explode: false
in: path
name: projectId
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/changeRequestConfigSchema'
description: changeRequestConfigSchema
summary: Retrieves change request configuration for a project
tags:
- Change Requests
/api/admin/projects/{projectId}/environments/{environment}/change-requests/config:
put:
description: "This endpoint will change the change request configuration for\
\ a given environment, set it to either on/off and optionally configure the\
\ number of approvals needed. The minimum number of approvals is 1 and the\
\ maximum number is 10. If you provide a number higher than 10 or lower than\
\ 1, Unleash will clamp it to the allowed range."
operationId: updateProjectChangeRequestConfig
parameters:
- explode: false
in: path
name: projectId
required: true
schema:
type: string
style: simple
- explode: false
in: path
name: environment
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/updateChangeRequestEnvironmentConfigSchema'
description: updateChangeRequestEnvironmentConfigSchema
required: true
responses:
"200":
description: This response has no body.
summary: Updates change request configuration for an environment in the project
tags:
- Change Requests
/api/admin/service-account:
get:
description: Returns the list of all service accounts.
Expand Down Expand Up @@ -3583,6 +3642,63 @@ components:
- $ref: '#/components/schemas/samlSettingsSchema_oneOf'
- $ref: '#/components/schemas/samlSettingsSchema_oneOf_1'
type: object
changeRequestConfigSchema:
description: "A list of environment-specific [change request](https://docs.getunleash.io/reference/change-requests)\
\ configurations."
items:
$ref: '#/components/schemas/changeRequestEnvironmentConfigSchema'
type: array
changeRequestEnvironmentConfigSchema:
additionalProperties: true
description: "The [change request](https://docs.getunleash.io/reference/change-requests)\
\ configuration for a specific environment."
example:
environment: my-dev-environment
changeRequestEnabled: true
requiredApprovals: 2
type: development
properties:
environment:
description: The environment that this configuration applies to.
example: my-dev-environment
type: string
type:
description: "The [type of the environment](https://docs.getunleash.io/reference/environments#environment-types)\
\ listed in `environment`."
example: development
type: string
changeRequestEnabled:
description: "`true` if this environment has change requests enabled, otherwise\
\ `false`."
example: true
type: boolean
requiredApprovals:
description: The number of approvals that are required for a change request
to be fully approved and ready to be applied in this environment.
example: 2
nullable: true
type: number
required:
- changeRequestEnabled
- environment
- requiredApprovals
- type
type: object
updateChangeRequestEnvironmentConfigSchema:
description: Data used to update change request in an environment
properties:
changeRequestsEnabled:
description: "`true` if change requests should be enabled, otherwise `false`."
type: boolean
requiredApprovals:
description: The number of approvals required before a change request can
be applied in this environment.
example: 3
minimum: 0
type: integer
required:
- changeRequestsEnabled
type: object
updateEnvironmentSchema:
description: "Data used to update an [environment](https://docs.getunleash.io/reference/environments)."
properties:
Expand Down
Loading
Loading