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

Move setting endpoints to be under /settings/ #6649

Merged
merged 18 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
156 changes: 143 additions & 13 deletions api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2329,6 +2329,130 @@ paths:
default:
$ref: "#/components/responses/ServerError"

/repositories/{repository}/settings/gc_rules:
parameters:
- in: path
name: repository
required: true
schema:
type: string
get:
tags:
- repositories
operationId: getGCRules
summary: get repository GC rules
responses:
200:
description: repository GC rules
content:
application/json:
schema:
$ref: "#/components/schemas/GarbageCollectionRules"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
default:
$ref: "#/components/responses/ServerError"
put:
tags:
- repositories
operationId: setGCRules
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/GarbageCollectionRules"
responses:
204:
description: set garbage collection rules successfully
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
default:
$ref: "#/components/responses/ServerError"
delete:
tags:
- repositories
operationId: deleteGCRules
responses:
204:
description: deleted garbage collection rules successfully
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
default:
$ref: "#/components/responses/ServerError"

/repositories/{repository}/settings/branch_protection:
parameters:
- in: path
name: repository
required: true
schema:
type: string
get:
tags:
- repositories
operationId: getBranchProtectionRules
summary: get branch protection rules
responses:
200:
description: branch protection rules
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/BranchProtectionRule"
headers:
ETag:
schema:
type: string
description: ETag of the branch protection rules
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
default:
$ref: "#/components/responses/ServerError"

put:
parameters:
- in: header
name: If-Match
schema:
type: string
description: if provided, the branch protection rules will be updated only if the current ETag match the provided value
allowEmptyValue: true
tags:
- repositories
operationId: setBranchProtectionRules
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/BranchProtectionRule"
responses:
204:
description: branch protection rule created successfully
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
412:
$ref: "#/components/responses/PreconditionFailed"
default:
$ref: "#/components/responses/ServerError"

/otf/diffs:
get:
tags:
Expand Down Expand Up @@ -4068,9 +4192,10 @@ paths:
schema:
type: string
get:
deprecated: true
tags:
- retention
operationId: getGarbageCollectionRules
- internal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the new settings path, are the old ones internal or deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are deprecated: marking them as internal was a way to make sure users know they are deprecated. I will also add the deprecated notation like you did in your recent PR.

operationId: internalGetGarbageCollectionRules
responses:
200:
description: gc rule list
Expand All @@ -4086,9 +4211,10 @@ paths:
$ref: "#/components/responses/ServerError"

post:
deprecated: true
tags:
- retention
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not leave retention and add internal? same goes for other removed tags

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tags are reflected in the method names in the SDK, we want them to appear as "internal" to emphasize the fact that they are deprecated. These endpoints will be removed in the future.

operationId: set garbage collection rules
- internal
operationId: internalSetGarbageCollectionRules
requestBody:
required: true
content:
Expand All @@ -4105,9 +4231,10 @@ paths:
default:
$ref: "#/components/responses/ServerError"
delete:
deprecated: true
tags:
- retention
operationId: delete garbage collection rules
- internal
operationId: internalDeleteGarbageCollectionRules
responses:
204:
description: deleted garbage collection rules successfully
Expand Down Expand Up @@ -4208,9 +4335,10 @@ paths:
schema:
type: string
get:
deprecated: true
tags:
- repositories
operationId: getBranchProtectionRules
- internal
operationId: internalGetBranchProtectionRules
summary: get branch protection rules
responses:
200:
Expand All @@ -4229,9 +4357,10 @@ paths:
$ref: "#/components/responses/ServerError"

post:
deprecated: true
tags:
- repositories
operationId: createBranchProtectionRule
- internal
operationId: internalCreateBranchProtectionRule
requestBody:
required: true
content:
Expand All @@ -4248,9 +4377,10 @@ paths:
default:
$ref: "#/components/responses/ServerError"
delete:
deprecated: true
tags:
- repositories
operationId: deleteBranchProtectionRule
- internal
operationId: internalDeleteBranchProtectionRule
requestBody:
required: true
content:
Expand Down Expand Up @@ -4331,7 +4461,7 @@ paths:
/config/garbage-collection:
get:
tags:
- config
- internal
operationId: getGarbageCollectionConfig
description: get information of gc settings
responses:
Expand Down
19 changes: 12 additions & 7 deletions clients/java/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading