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

Auto merge pull requests when all checks succeeded via WebUI #19648

Merged
merged 42 commits into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
abfeefe
Revert "remove webUI part for another pull"
6543 May 7, 2022
daf146a
Revert "remove more WebUI only parts"
6543 May 7, 2022
f1037f3
ajust to #19649
6543 May 8, 2022
847919d
Merge branch 'main' into auto-merge_webUI
6543 May 8, 2022
efad877
Merge branch 'master' into auto-merge_webUI
6543 May 12, 2022
c810cc9
Merge branch 'main' into auto-merge_webUI
wxiaoguang May 18, 2022
1c11584
UI part for auto merge
wxiaoguang May 18, 2022
916e4bb
disable unnecessary eslint
wxiaoguang May 18, 2022
346c545
Merge branch 'main' into auto-merge_webUI
6543 May 18, 2022
2bc2215
refactor and add comments
wxiaoguang May 19, 2022
69b2ff7
make merge form work for writers
wxiaoguang May 19, 2022
05317de
Merge branch 'master' into auto-merge_webUI
6543 May 19, 2022
935ab7b
fine tune button colors
wxiaoguang May 19, 2022
0991637
hide the auto merge if this PR can be merged now
wxiaoguang May 19, 2022
5f6f1c9
Merge branch 'main' into auto-merge_webUI
6543 May 19, 2022
a078ba8
UX: hide delete_branch_after_merge for auto-merge
6543 May 20, 2022
53a8b04
UX: dont hide auto-merge schedule for admins
6543 May 20, 2022
3e204ee
UX: make scheduled auto-merges be overwritten from webUI
6543 May 20, 2022
4880009
Merge branch 'main' into auto-merge_webUI
6543 May 20, 2022
40f7796
Merge branch 'main' into auto-merge_webUI
wxiaoguang May 20, 2022
3fdc599
add comment for testing
wxiaoguang May 20, 2022
8dfe1eb
Merge branch 'main' into auto-merge_webUI
6543 May 20, 2022
c614ffa
add comment for testing
wxiaoguang May 20, 2022
837add8
fine tune css style
wxiaoguang May 20, 2022
6dfe7d6
Merge branch 'main' into auto-merge_webUI
6543 May 20, 2022
d9c36da
Merge branch 'main' into auto-merge_webUI
6543 May 20, 2022
ccd50c6
Merge branch 'main' into auto-merge_webUI
6543 May 20, 2022
fd93997
Merge branch 'main' into auto-merge_webUI
6543 May 20, 2022
402b6a0
Merge branch 'main' into auto-merge_webUI
6543 May 21, 2022
ba0173a
Merge branch 'main' into auto-merge_webUI
6543 May 23, 2022
78e1174
Merge branch 'main' into auto-merge_webUI
6543 May 24, 2022
6bef922
Merge branch 'main' into auto-merge_webUI
6543 Jun 2, 2022
6305f52
Merge branch 'main' into auto-merge_webUI
6543 Jun 3, 2022
8edb5c2
Update templates/repo/issue/view_content/pull.tmpl
wxiaoguang Jun 3, 2022
eb33a2f
Merge branch 'main' into auto-merge_webUI
6543 Jun 5, 2022
0502a21
Merge branch 'main' into auto-merge_webUI
wxiaoguang Jun 9, 2022
9bd5f97
UI adjuestment
wxiaoguang Jun 9, 2022
6303b2b
Merge branch 'main' into auto-merge_webUI
6543 Jun 10, 2022
0e2f19d
Merge branch 'main' into auto-merge_webUI
6543 Jun 10, 2022
81af3ba
Update web_src/js/components/PullRequestMergeForm.vue
wxiaoguang Jun 11, 2022
5dd9e56
Merge branch 'main' into auto-merge_webUI
6543 Jun 11, 2022
4f12809
Merge branch 'main' into auto-merge_webUI
lunny Jun 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ pulls.merge_instruction_hint = `You can also view <a class="show-instruction">co
pulls.merge_instruction_step1_desc = From your project repository, check out a new branch and test the changes.
pulls.merge_instruction_step2_desc = Merge the changes and update on Gitea.

pulls.auto_merge_button_title = When Checks Succeed
pulls.auto_merge_button_when_succeed = (When checks succeed)
pulls.auto_merge_when_succeed = Auto merge when all checks succeed
pulls.auto_merge_newly_scheduled = The pull request was scheduled to merge when all checks succeed.
pulls.auto_merge_has_pending_schedule = %[1]s scheduled this pull request to auto merge when all checks succeed %[2]s.
Expand Down
3 changes: 1 addition & 2 deletions templates/repo/issue/view_content/pull.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@
{{/* admin can merge without checks, writer can merge when checkes succeed */}}
{{$canMergeNow := and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}}
{{/* admin and writer both can make an auto merge schedule */}}
{{$canAutoMerge = true}}

{{if $canMergeNow}}
{{if $notAllOverridableChecksOk}}
Expand Down Expand Up @@ -343,7 +342,7 @@
'baseLink': {{.Link}},
'textCancel': {{$.i18n.Tr "cancel"}},
'textDeleteBranch': {{$.i18n.Tr "repo.branch.delete" .HeadTarget}},
'textAutoMergeButtonTitle': {{$.i18n.Tr "repo.pulls.auto_merge_button_title"}},
'textAutoMergeButtonWhenSucceed': {{$.i18n.Tr "repo.pulls.auto_merge_button_when_succeed"}},
'textAutoMergeWhenSucceed': {{$.i18n.Tr "repo.pulls.auto_merge_when_succeed"}},
'textAutoMergeCancelSchedule': {{$.i18n.Tr "repo.pulls.auto_merge_cancel_schedule"}},

Expand Down
20 changes: 4 additions & 16 deletions web_src/js/components/PullRequestMergeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<button class="ui button" :class="mergeButtonStyleClass" type="submit" name="do" :value="mergeStyle">
{{ mergeStyleDetail.textDoMerge }}
<template v-if="autoMergeWhenSucceed">
({{ mergeForm.textAutoMergeButtonTitle }})
({{ mergeForm.textAutoMergeButtonWhenSucceed }})
wxiaoguang marked this conversation as resolved.
Show resolved Hide resolved
</template>
</button>

Expand All @@ -54,7 +54,7 @@
<span class="button-text">
{{ mergeStyleDetail.textDoMerge }}
<template v-if="autoMergeWhenSucceed">
({{ mergeForm.textAutoMergeButtonTitle }})
{{ mergeForm.textAutoMergeButtonWhenSucceed }}
</template>
</span>
</button>
Expand All @@ -78,14 +78,9 @@
<!-- if can NOT merge now, only show one action "auto merge when succeed" -->
<div class="item" v-if="msd.allowed && !mergeForm.canMergeNow && !msd.hideAutoMerge" :key="msd.name" @click.stop="switchMergeStyle(msd.name, true)">
<div class="action-text">
{{ msd.textDoMerge }}
</div>
<div class="auto-merge-full">
<svg-icon name="octicon-clock" :size="14"/>
<span class="auto-merge-text">{{ mergeForm.textAutoMergeWhenSucceed }}</span>
{{ msd.textDoMerge }} {{ mergeForm.textAutoMergeButtonWhenSucceed }}
</div>
</div>

</template>
</div>
</div>
Expand Down Expand Up @@ -211,14 +206,7 @@ export default {
padding: 0.8rem;
flex: 1
}
.auto-merge-full {
display: flex;
align-items: center;
justify-content: center;
}
.auto-merge-full .auto-merge-text {
padding: 0 1rem 0 0.25rem;
}

.auto-merge-small {
width: 40px;
display: flex;
Expand Down
9 changes: 0 additions & 9 deletions web_src/less/_base.less
Original file line number Diff line number Diff line change
Expand Up @@ -2003,15 +2003,6 @@ table th[data-sortt-desc] {
margin-right: 0 !important;
}

.dropdown:not(.selection) > .menu.review-box > * {
@media (max-height: 700px) {
.CodeMirror,
.CodeMirror-scroll {
min-height: 100px;
}
}
}

.ui.dropdown .menu .item {
border-radius: 0;
}
Expand Down