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

Show Pull Request button or status of latest PR in branch list #6990

Merged

Conversation

saitho
Copy link
Contributor

@saitho saitho commented May 19, 2019

Resolves #4547.

If a branch already has a pull request it will be shown instead of the "Create PR" button with its status (open, merged, closed). Similarly to GitHub, the latest pull request for a branch will be shown there.
Deleted branches will not have the pull request button.

Also, as a little follow-up on #6695, I've also hidden the commit divergence section for deleted branches as it won't contain useful information since the branch is deleted.

Screenshot

branch_list-pull_requests-smaller_buttons

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
@saitho
Copy link
Contributor Author

saitho commented May 19, 2019

Failing due to the Git for libravatar being down. :(

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 19, 2019
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label May 19, 2019
@saitho
Copy link
Contributor Author

saitho commented May 19, 2019

Failing due to the Git for libravatar being down. :(

Should work again. Can someone restart the build? :)

@lunny
Copy link
Member

lunny commented May 19, 2019

restarted

models/pull.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented May 19, 2019

Codecov Report

Merging #6990 into master will increase coverage by <.01%.
The diff coverage is 61.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6990      +/-   ##
==========================================
+ Coverage   41.24%   41.24%   +<.01%     
==========================================
  Files         464      464              
  Lines       62846    62867      +21     
==========================================
+ Hits        25922    25931       +9     
- Misses      33533    33544      +11     
- Partials     3391     3392       +1
Impacted Files Coverage Δ
routers/repo/branch.go 56.28% <43.75%> (-2.23%) ⬇️
models/pull.go 50.93% <90%> (+0.46%) ⬆️
models/unit.go 62.16% <0%> (-5.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c37ec66...940ae77. Read the comment docs.

@lunny
Copy link
Member

lunny commented May 21, 2019

Could we give a link to that PR?

@silverwind
Copy link
Member

silverwind commented May 22, 2019

Also something to check: Github disables the branch delete button on branches with open pull requests (probably because the PR would become invalid). Maybe this is something we should consider doing too.

…request status

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
@saitho
Copy link
Contributor Author

saitho commented May 23, 2019

Also something to check: Github disables the branch delete button on branches with open pull requests (probably because the PR would become invalid). Maybe this is something we should consider doing too.

Didn't to that for now, since the user has to confirm in the popup he REALLY wants to delete the branch. ;)

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 3, 2019
routers/repo/branch.go Outdated Show resolved Hide resolved
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
@saitho
Copy link
Contributor Author

saitho commented Jun 15, 2019

Needs one more approval. :)

routers/repo/branch.go Outdated Show resolved Hide resolved
@lunny
Copy link
Member

lunny commented Jun 15, 2019

Please see https://github.com/go-gitea/gitea/pull/6990/files#r294051752 and also CI pointed that. Otherwise LGTM.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 15, 2019
@saitho
Copy link
Contributor Author

saitho commented Jun 27, 2019

Can we still get this into 1.9.0? Would help us a lot cleaning merged or closed branches. :)

@lunny lunny added this to the 1.9.0 milestone Jun 27, 2019
@lunny
Copy link
Member

lunny commented Jun 27, 2019

I think we can move this to v1.9 since it finished before our freeze time but haven't assign milestone.

@lunny lunny merged commit 7c0f2b9 into go-gitea:master Jun 27, 2019
@lunny lunny mentioned this pull request Jul 13, 2019
14 tasks
jeffliu27 pushed a commit to jeffliu27/gitea that referenced this pull request Jul 18, 2019
…tea#6990)

* Show Pull Request button or status of latest PR in branch list

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Do not show pull request button on deleted branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Do not show commit divergence on deleted branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Use XORMs Get instead of limit

* Links pull request ID and use smaller labels for displaying the pull request status

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Handle error when getting latest pull request

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Indent template

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Check error when loading issue

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
@saitho saitho deleted the feature/4547-compare_buttons_in_branch_list branch December 18, 2019 18:53
@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
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: quick compare buttons at branch list
6 participants