Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sillyguodong
3dc2724d36
Fix cannot reopen after pushing commits to a closed PR (#23189) (#23322)
Backport: #23189
Close: #22784
1. On GH, we can reopen a PR which was closed before after pushing
commits. After reopening PR, we can see the commits that were pushed
after closing PR in the time line. So the case of
[issue](https://github.com/go-gitea/gitea/issues/22784) is a bug which
needs to be fixed.
2. After closing a PR and pushing commits, `headBranchSha` is not equal
to `sha`(which is the last commit ID string of reference). If the
judgement exists, the button of reopen will not display. So, skip the
judgement if the status of PR is closed.

3. Even if PR is already close, we should still insert comment record
into DB when we push commits.
So we should still call function `CreatePushPullComment()`.
067b0c2664/services/pull/pull.go (L260-L282)
So, I add a switch(`includeClosed`) to the
`GetUnmergedPullRequestsByHeadInfo` func to control whether the status
of PR must be open. In this case, by setting `includeClosed` to `true`,
we can query the closed PR.

4. In the loop of comments, I use the`latestCloseCommentID` variable to
record the last occurrence of the close comment.
In the go template, if the status of PR is closed, the comments whose
type is `CommentTypePullRequestPush(29)` after `latestCloseCommentID`
won't be rendered.

e.g.
1). The initial status of the PR is opened.

2). Then I click the button of `Close`. PR is closed now.

3). I try to push a commit to this PR, even though its current status is
closed.

But in comments list, this commit do not display.This is as expected :)

4). Click the `Reopen` button, the commit which is pushed after closing
PR display now.

|
2 years ago |
.. |
admin
|
Fix sorting admin user list by last login (#22081) (#22107)
|
2 years ago |
api/packages/pypi
|
Add Package Registry (#16510)
|
3 years ago |
base
|
Don't display stop watch top bar icon when disabled and hidden when click other place (#22374) (#22387)
|
2 years ago |
code
|
Run `make fmt` (#21437)
|
2 years ago |
custom
|
…
|
|
explore
|
Fix flex layout for repo list icons (#21896) (#21920)
|
2 years ago |
mail
|
Add team member invite by email (#20307)
|
2 years ago |
org
|
Hide 2FA status from other members in organization members list (#22999) (#23023)
|
2 years ago |
package
|
Use `--index-url` in PyPi description (#22620) (#22636)
|
2 years ago |
repo
|
Fix cannot reopen after pushing commits to a closed PR (#23189) (#23322)
|
2 years ago |
shared
|
Color and Style enhancements (#21784, #21799) (#21868)
|
2 years ago |
status
|
Remove fomantic image module (#21145)
|
2 years ago |
swagger
|
Add `sync_on_commit` option for push mirrors api (#22271) (#22292)
|
2 years ago |
user
|
Fix leaving organization bug on user settings -> orgs (#21983) (#22438)
|
2 years ago |
home.tmpl
|
Refactor `i18n` to `locale` (#20153)
|
3 years ago |
install.tmpl
|
Rework mailer settings (#18982)
|
3 years ago |
post-install.tmpl
|
Rename StaticUrlPrefix to AssetUrlPrefix (#15779)
|
4 years ago |