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

Refresh the refernce of the closed PR when reopening #24231

Merged
merged 3 commits into from
May 8, 2023

Conversation

sillyguodong
Copy link
Contributor

@sillyguodong sillyguodong commented Apr 20, 2023

Close #24213
Replace #23830

Cause

  • Before, in order to making PR can get latest commit after reopening, the ref(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR will be updated when pushing commits to the head branch of the closed PR.

Changes

  • For closed PR , won't perform these behavior: insertcomment, push notification (UI and email), exectue pushToBaseRepo function and trigger action any more when pushing to the head branch of the closed PR.
  • Refresh the reference of the PR when reopening the closed PR (even if the head branch has been deleted before). Make the reference of PR consistent with the head branch.

@sillyguodong sillyguodong changed the title Force push from head branch to base repo when reopening PR Refresh the refernce of the closed PR when reopening Apr 20, 2023
@silverwind silverwind added type/bug outdated/backport/v1.19 This PR should be backported to Gitea 1.19 labels Apr 20, 2023
@silverwind silverwind added this to the 1.20.0 milestone Apr 20, 2023
routers/web/repo/issue.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 20, 2023
@silverwind
Copy link
Member

@sillyguodong please make sure to resolve resolved conversations.

@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 May 4, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 8, 2023
@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 May 8, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 8, 2023
@lunny lunny merged commit e962ade into go-gitea:main May 8, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 8, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request May 8, 2023
Close go-gitea#24213 
Replace go-gitea#23830

#### Cause

- Before, in order to making PR can get latest commit after reopening,
the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR
will be updated when pushing commits to the `head branch` of the closed
PR.

#### Changes

- For closed PR , won't perform these behavior: insert`comment`, push
`notification` (UI and email), exectue
[pushToBaseRepo](https://github.com/go-gitea/gitea/blob/74225033413dc0f2b308bbe069f6d185b551e364/services/pull/pull.go#L409)
function and trigger `action` any more when pushing to the `head branch`
of the closed PR.
- Refresh the reference of the PR when reopening the closed PR (**even
if the head branch has been deleted before**). Make the reference of PR
consistent with the `head branch`.
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label May 8, 2023
silverwind pushed a commit that referenced this pull request May 8, 2023
Backport #24231 by @sillyguodong

Close #24213 
Replace #23830

#### Cause

- Before, in order to making PR can get latest commit after reopening,
the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR
will be updated when pushing commits to the `head branch` of the closed
PR.

#### Changes

- For closed PR , won't perform these behavior: insert`comment`, push
`notification` (UI and email), exectue
[pushToBaseRepo](https://github.com/go-gitea/gitea/blob/74225033413dc0f2b308bbe069f6d185b551e364/services/pull/pull.go#L409)
function and trigger `action` any more when pushing to the `head branch`
of the closed PR.
- Refresh the reference of the PR when reopening the closed PR (**even
if the head branch has been deleted before**). Make the reference of PR
consistent with the `head branch`.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 9, 2023
* upstream/main:
  Add Gitea Profile Readmes (go-gitea#23260)
  Make diff view full width again (go-gitea#24598)
  Add permission check for moving issue action in project view page (go-gitea#24589)
  Update JS dependencies, add new eslint rules (go-gitea#24597)
  Filters for GetAllCommits (go-gitea#24568)
  [skip ci] Updated translations via Crowdin
  Attach a tooltip to the action control button (go-gitea#24595)
  Improve Gitea's web context, decouple "issue template" code into service package (go-gitea#24590)
  Support markdown editor for issue template (go-gitea#24400)
  Do not select line numbers when selecting text from the action run logs (go-gitea#24594)
  In TestViewRepo2, convert computed timezones to local time (go-gitea#24579)
  Fix close org projects (go-gitea#24588)
  Rewrite queue (go-gitea#24505)
  Split "modules/context.go" to separate files (go-gitea#24569)
  Pass 'not' to commit count (go-gitea#24473)
  Refresh the refernce of the closed PR when reopening (go-gitea#24231)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 6, 2023
@sillyguodong sillyguodong deleted the bugfix/issue_24213 branch February 29, 2024 03:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/backport/v1.19 This PR should be backported to Gitea 1.19 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closed PRs getting picked up by build servers monitoring Gitea repos with Gitea 1.19
6 participants