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

cherry-pick a commit to a branch #5483

Merged
merged 8 commits into from
Mar 16, 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
59 changes: 59 additions & 0 deletions api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,20 @@ components:
type: integer
description: when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert.

CherryPickCreation:
type: object
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also have an optional message? (Can just be an issue for now.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

required:
- ref
properties:
ref:
type: string
description: the commit to cherry-pick, given by a ref
parent_number:
type: integer
description: |
when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff.
The destination branch is parent 1, which is the default behaviour.

Commit:
type: object
required:
Expand Down Expand Up @@ -2734,6 +2748,51 @@ paths:
default:
$ref: "#/components/responses/ServerError"

/repositories/{repository}/branches/{branch}/cherry-pick:
parameters:
- in: path
name: repository
required: true
schema:
type: string
- in: path
name: branch
required: true
schema:
type: string
post:
tags:
- branches
operationId: cherryPick
summary: Cherry-Pick the given reference commit into the given branch
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CherryPickCreation"
responses:
201:
description: the cherry-pick commit
content:
application/json:
schema:
$ref: "#/components/schemas/Commit"
400:
$ref: "#/components/responses/ValidationError"
401:
$ref: "#/components/responses/Unauthorized"
404:
$ref: "#/components/responses/NotFound"
409:
description: Conflict Found
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
Comment on lines +2789 to +2792
Copy link
Contributor

Choose a reason for hiding this comment

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

Not in this PR, but ideally we will return some detailed error indication of what conflicts we found. For a merge the caller can probably at least diff, here it will be harder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but differing this for now. #5507

default:
$ref: "#/components/responses/ServerError"

/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}:
parameters:
- in: path
Expand Down
2 changes: 2 additions & 0 deletions clients/java/README.md

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

82 changes: 82 additions & 0 deletions clients/java/api/openapi.yaml

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

98 changes: 98 additions & 0 deletions clients/java/docs/BranchesApi.md

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

14 changes: 14 additions & 0 deletions clients/java/docs/CherryPickCreation.md

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

Loading