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

API endpoint to configure default branch and protected branches is missing #2922

Closed
nblock opened this issue Nov 15, 2017 · 8 comments · Fixed by #9311
Closed

API endpoint to configure default branch and protected branches is missing #2922

nblock opened this issue Nov 15, 2017 · 8 comments · Fixed by #9311
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Comments

@nblock
Copy link

nblock commented Nov 15, 2017

  • Gitea version: 1.2.3

Description

Gitea allows to configure the default branch and protected branches via GITEA_URL/org/repo/settings/branches but I could not find an API alternative in the local Swagger documentation.

@nblock nblock changed the title API endpoint to configure default branch and protected branches missing API endpoint to configure default branch and protected branches is missing Nov 15, 2017
@lunny lunny added modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Nov 15, 2017
@davidlt
Copy link

davidlt commented May 29, 2018

I am also looking for such API especially since 1.4.1 set random default branch on git push --mirror ( #3913 ). Thus I wanted to use API to reset it back to master.

@davidlt
Copy link

davidlt commented Jun 2, 2018

Looks like GitHub supports it at least since 2012: https://developer.github.com/changes/2012-10-24-set-default-branch/

It's done via PATCH /repos/:owner/:repo : https://developer.github.com/v3/repos/#edit

@jonasfranz
Copy link
Member

Currently you cannot update repository at all.

@jonasfranz
Copy link
Member

Getting the DefaultBranch is support.

@sankethpb
Copy link

any updates on this? Is this already supported in Gitea 1.5.x and above?

@lunny
Copy link
Member

lunny commented Dec 12, 2018

@sankethpb nobody are working on this.

@stale
Copy link

stale bot commented Feb 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 10, 2019
@lafriks lafriks added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Feb 10, 2019
@stale stale bot removed the issue/stale label Feb 10, 2019
@davidsvantesson
Copy link
Contributor

If wildcard protected branches (#2529) get implemented it is necessary to consider how this affect the API.

I would suggest two API endpoints:

  • ...{repo}/branches(/{branch}) corresponds to actual branches and only gives some limited information on effective branch protection (e.g. if branch is protected, number of approvals required, name of effective branch protection)
  • ...{repo}/branch_protections(/{branch}) where branch is a configured branch protection (specific branch or wildcard). To edit a branch protection this endpoint should be used.

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 modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
7 participants