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

Enable Update PR base branch through API #11552

Closed
blaggacao opened this issue May 22, 2020 · 12 comments · Fixed by #11666
Closed

Enable Update PR base branch through API #11552

blaggacao opened this issue May 22, 2020 · 12 comments · Fixed by #11666
Labels
type/enhancement An improvement of existing functionality
Milestone

Comments

@blaggacao
Copy link

func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) {

This API method, together with it's implementation in https://gitea.com/gitea/go-sdk should implement mutating the base branch just as available on the UI, based on adding this field into the following struct

type EditPullRequestOption struct {
Title string `json:"title"`
Body string `json:"body"`
Assignee string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone int64 `json:"milestone"`
Labels []int64 `json:"labels"`
State *string `json:"state"`
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
RemoveDeadline *bool `json:"unset_due_date"`
}

This is required for full git-town support git-town/git-town#1451 since git town extensively uses branch hierarchy: if the an ancestor get's merged, all it's children branches must be reassigned to the ancestor's target merge branch.

@6543
Copy link
Member

6543 commented May 28, 2020

@blaggacao If I can remember correctly UI dont support this

and why exactly do you need this?
you can Create/Update/Close/Merge a Pull via API ...

@blaggacao
Copy link
Author

blaggacao commented May 29, 2020

I just checked, in UI you can do this.

The use case is the following:

  1. As colleague B, I want to complement colleague A with a sub-feature on his feature branch fbA, so I'm working on sub-feature-branch sfbB based off fbA.

  2. Since, I'm a good dev citizen in my team, I opened a WIP branch early on with the intent to merge into fbA, so everybody could ealy track changes and advancements.

  3. Now, colleague A's feature branch fbA was accepted into master, but my lower priority sfbB didn't make it in time and I'm still developing.

  4. Result: my target branch is gone, therefore my PR would need to be retargeted to master.

Note: nesting is not limited to just one level, if it's a big feature in the making.

git town has first class API support in github for this workflow. In big teams, such as where git town is used, this is a not so uncommon occurrence.

@kevgo did I miss something?

I'm in the process of adding gitea support to git town to close the gap for self-hosters, like me.

@6543
Copy link
Member

6543 commented May 29, 2020

@blaggacao sorry didnt noticed this feature exist, since it exist on UI it is relatifely easy to do so via API

@6543
Copy link
Member

6543 commented May 29, 2020

@blaggacao -> #11666

@kevgo
Copy link

kevgo commented May 29, 2020

Another use case is described here: developing a complex feature as a series of branches, each one implementing one change and potentially being reviewed by different people.

@blaggacao
Copy link
Author

@6543 Thanks for the quick effort
@kevgo Thanks for the good read

@blaggacao
Copy link
Author

@6543 Once this is closed, should I open a follow up issue in https://gitea.com/gitea/go-sdk ?

@blaggacao
Copy link
Author

https://gitea.com/gitea/go-sdk/pulls/353

@blaggacao
Copy link
Author

git-town/git-town#1518 has been merged, gitea is no supported in git town, still awaiting to get this closed asap!

@blaggacao
Copy link
Author

https://gitea.com/gitea/go-sdk/pulls/353 has been merged too! Nice

@blaggacao
Copy link
Author

So we are waiting for #11666 ... ⌛

zeripath pushed a commit that referenced this issue Jun 7, 2020
* EditPull: add option to change base

Close #11552
6543 added a commit to 6543-forks/gitea that referenced this issue Jun 7, 2020
@lafriks lafriks added the type/enhancement An improvement of existing functionality label Jun 7, 2020
@lafriks lafriks added this to the 1.12.0 milestone Jun 7, 2020
lafriks added a commit that referenced this issue Jun 7, 2020
* EditPull: add option to change base

Close #11552

Co-authored-by: Lauris BH <lauris@nix.lv>
@blaggacao
Copy link
Author

Wondeful, and thank you for retargeting to 1.12.0 !

ydelafollye pushed a commit to ydelafollye/gitea that referenced this issue Jul 31, 2020
@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
type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants