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

[Feature] [API] Add Endpoint for Branch creation #11376

Closed
DominikPf opened this issue May 11, 2020 · 2 comments
Closed

[Feature] [API] Add Endpoint for Branch creation #11376

DominikPf opened this issue May 11, 2020 · 2 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@DominikPf
Copy link

DominikPf commented May 11, 2020

We want to automatically create Dev-Stacks in our Company (new Application, Package, ....)

To create a Repository we want to create the complete basic structure.
The Api of Gitea is already very powerfull, but we also need an Endpoint to create a new Branch.

proposal for: repository

add POST /repos/{owner}/{repo}/branches

Information to create a new branch should be

  • The Name of the new Branch
  • The Name of the Branch the new Branch is based on

I hope i didn't forgot something

tle-huu added a commit to tle-huu/gitea that referenced this issue May 29, 2020
Issue: go-gitea#11376

This commit introduces an API endpoint for branch creation.

The added route is POST /repos/{owner}/{repo}/branches.
A JSON with the name of the new branch and the name of the old branch is
required as parameters.

Signed-off-by: Terence Le Huu Phuong <[email protected]>
zeripath added a commit that referenced this issue May 29, 2020
* [FEATURE] [API] Add Endpoint for Branch Creation

Issue: #11376

This commit introduces an API endpoint for branch creation.

The added route is POST /repos/{owner}/{repo}/branches.
A JSON with the name of the new branch and the name of the old branch is
required as parameters.

Signed-off-by: Terence Le Huu Phuong <[email protected]>

* Put all the logic into CreateBranch and removed CreateRepoBranch

* - Added the error ErrBranchDoesNotExist in error.go
- Made the CreateNewBranch function return an errBranchDoesNotExist error
when the OldBranch does not exist
- Made the CreateBranch API function checks that the repository is not
empty and that branch exists.

* - Added a resetFixtures helper function in integration_test.go to
fine-tune test env resetting
- Added api test for CreateBranch
- Used resetFixture instead of the more general prepareTestEnv in the
repo_branch_test CreateBranch tests

* Moved the resetFixtures call inside the loop for APICreateBranch function

* Put the prepareTestEnv back in repo_branch_test

* fix import order/sort api branch test

Co-authored-by: zeripath <[email protected]>
@stale
Copy link

stale bot commented Jul 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Jul 11, 2020
@lunny lunny added type/proposal The new feature has not been accepted yet but needs to be discussed first. issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Jul 11, 2020
@stale stale bot removed the issue/stale label Jul 11, 2020
@lunny
Copy link
Member

lunny commented Jul 11, 2020

closed by #11607

@lunny lunny closed this as completed Jul 11, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this issue Jul 31, 2020
* [FEATURE] [API] Add Endpoint for Branch Creation

Issue: go-gitea#11376

This commit introduces an API endpoint for branch creation.

The added route is POST /repos/{owner}/{repo}/branches.
A JSON with the name of the new branch and the name of the old branch is
required as parameters.

Signed-off-by: Terence Le Huu Phuong <[email protected]>

* Put all the logic into CreateBranch and removed CreateRepoBranch

* - Added the error ErrBranchDoesNotExist in error.go
- Made the CreateNewBranch function return an errBranchDoesNotExist error
when the OldBranch does not exist
- Made the CreateBranch API function checks that the repository is not
empty and that branch exists.

* - Added a resetFixtures helper function in integration_test.go to
fine-tune test env resetting
- Added api test for CreateBranch
- Used resetFixture instead of the more general prepareTestEnv in the
repo_branch_test CreateBranch tests

* Moved the resetFixtures call inside the loop for APICreateBranch function

* Put the prepareTestEnv back in repo_branch_test

* fix import order/sort api branch test

Co-authored-by: zeripath <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants