mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Option to delay conflict checking of old pull requests until page view (#27779)
`[repository.pull-request] DELAY_CHECK_FOR_INACTIVE_DAYS` is a new setting to delay the mergeable check for pull requests that have been inactive for the specified number of days. This avoids potentially long delays for big repositories with many pull requests. and reduces system load overall when there are many repositories or pull requests. When viewing the PR, checking will start immediately and the PR merge box will automatically reload when complete. Accessing the PR through the API will also start checking immediately. The default value of `7` provides a balance between system load, and keeping behavior similar to what it was before both for users and API access. With `0` all conflict checking will be delayed, while `-1` always checks immediately to restore the previous behavior. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d1ad8e1e80
commit
a9343896f4
@@ -1,7 +1,13 @@
|
||||
{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}}
|
||||
{{/* Then the merge box will not be displayed because this page already contains enough information */}}
|
||||
{{else}}
|
||||
<div class="timeline-item comment merge box">
|
||||
<div class="timeline-item comment pull-merge-box"
|
||||
data-global-init="initRepoPullMergeBox"
|
||||
{{if .PullMergeBoxReloadingInterval}}
|
||||
data-pull-merge-box-reloading-interval="{{.PullMergeBoxReloadingInterval}}"
|
||||
data-pull-link="{{.Issue.Link}}"
|
||||
{{end}}
|
||||
>
|
||||
<div class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
|
||||
{{- else if .Issue.IsClosed}}grey
|
||||
{{- else if .IsPullWorkInProgress}}grey
|
||||
@@ -97,7 +103,7 @@
|
||||
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
||||
{{else if .Issue.PullRequest.IsChecking}}
|
||||
<div class="item">
|
||||
{{svg "octicon-sync"}}
|
||||
{{svg "octicon-sync" 16 "circular-spin"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.is_checking"}}
|
||||
</div>
|
||||
{{else if .Issue.PullRequest.IsAncestor}}
|
||||
@@ -191,10 +197,11 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{template "repo/issue/view_content/update_branch_by_merge" $}}
|
||||
|
||||
{{if .Issue.PullRequest.IsEmpty}}
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="item">
|
||||
{{svg "octicon-alert"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.is_empty"}}
|
||||
@@ -216,7 +223,7 @@
|
||||
const defaultMergeMessage = {{.DefaultMergeBody}};
|
||||
const defaultSquashMergeMessage = {{.DefaultSquashMergeBody}};
|
||||
const mergeForm = {
|
||||
'baseLink': {{.Link}},
|
||||
'baseLink': {{.Issue.Link}},
|
||||
'textCancel': {{ctx.Locale.Tr "cancel"}},
|
||||
'textDeleteBranch': {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}},
|
||||
'textAutoMergeButtonWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
|
||||
@@ -318,7 +325,7 @@
|
||||
{{if .IsBlockedByApprovals}}
|
||||
<div class="item text red">
|
||||
{{svg "octicon-x"}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
||||
{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
|
||||
</div>
|
||||
{{else if .IsBlockedByRejection}}
|
||||
<div class="item text red">
|
||||
@@ -377,7 +384,7 @@
|
||||
*/}}
|
||||
{{if and $.StillCanManualMerge (not $showGeneralMergeForm)}}
|
||||
<div class="divider"></div>
|
||||
<form class="ui form form-fetch-action" action="{{.Link}}/merge" method="post">{{/* another similar form is in PullRequestMergeForm.vue*/}}
|
||||
<form class="ui form form-fetch-action" action="{{.Issue.Link}}/merge" method="post">{{/* another similar form is in PullRequestMergeForm.vue*/}}
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field">
|
||||
<input type="text" name="merge_commit_id" placeholder="{{ctx.Locale.Tr "repo.pulls.merge_commit_id"}}">
|
@@ -9,7 +9,7 @@
|
||||
{{if and $.UpdateAllowed $.UpdateByRebaseAllowed}}
|
||||
<div class="tw-inline-block">
|
||||
<div id="update-pr-branch-with-base" class="ui buttons">
|
||||
<button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}">
|
||||
<button class="ui button" data-do="{{$.Issue.Link}}/update" data-redirect="{{$.Issue.Link}}">
|
||||
<span class="button-text">
|
||||
{{ctx.Locale.Tr "repo.pulls.update_branch"}}
|
||||
</span>
|
||||
@@ -17,15 +17,15 @@
|
||||
<div class="ui dropdown icon button">
|
||||
{{svg "octicon-triangle-down"}}
|
||||
<div class="menu">
|
||||
<a class="item active selected" data-do="{{$.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a>
|
||||
<a class="item" data-do="{{$.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a>
|
||||
<a class="item active selected" data-do="{{$.Issue.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a>
|
||||
<a class="item" data-do="{{$.Issue.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}}
|
||||
<form action="{{$.Link}}/update" method="post" class="ui update-branch-form">
|
||||
<form action="{{$.Issue.Link}}/update" method="post" class="ui update-branch-form">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<button class="ui compact button">
|
||||
<span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span>
|
||||
|
Reference in New Issue
Block a user