Skip to content

Commit de715eb

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix button alignments (go-gitea#34276) Update token creation API swagger documentation (go-gitea#34288) [skip ci] Updated translations via Crowdin Explicitly not update indexes when sync database schemas (go-gitea#34281) Introduce `--page-space-bottom` at 64px (go-gitea#30692) # Conflicts: # templates/repo/wiki/revision.tmpl
2 parents c6cde9d + 533b8b2 commit de715eb

File tree

20 files changed

+97
-30
lines changed

20 files changed

+97
-30
lines changed

models/migrations/v1_23/v299.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ func AddContentVersionToIssueAndComment(x *xorm.Engine) error {
1414
ContentVersion int `xorm:"NOT NULL DEFAULT 0"`
1515
}
1616

17-
return x.Sync(new(Comment), new(Issue))
17+
_, err := x.SyncWithOptions(xorm.SyncOptions{
18+
IgnoreConstrains: true,
19+
IgnoreIndices: true,
20+
}, new(Comment), new(Issue))
21+
return err
1822
}

models/migrations/v1_23/v300.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ func AddForcePushBranchProtection(x *xorm.Engine) error {
1313
ForcePushAllowlistTeamIDs []int64 `xorm:"JSON TEXT"`
1414
ForcePushAllowlistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
1515
}
16-
return x.Sync(new(ProtectedBranch))
16+
_, err := x.SyncWithOptions(xorm.SyncOptions{
17+
IgnoreConstrains: true,
18+
IgnoreIndices: true,
19+
}, new(ProtectedBranch))
20+
return err
1721
}

models/migrations/v1_23/v301.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@ func AddSkipSecondaryAuthColumnToOAuth2ApplicationTable(x *xorm.Engine) error {
1010
type oauth2Application struct {
1111
SkipSecondaryAuthorization bool `xorm:"NOT NULL DEFAULT FALSE"`
1212
}
13-
return x.Sync(new(oauth2Application))
13+
_, err := x.SyncWithOptions(xorm.SyncOptions{
14+
IgnoreConstrains: true,
15+
IgnoreIndices: true,
16+
}, new(oauth2Application))
17+
return err
1418
}

models/migrations/v1_23/v303.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ func AddCommentMetaDataColumn(x *xorm.Engine) error {
1919
CommentMetaData *CommentMetaData `xorm:"JSON TEXT"` // put all non-index metadata in a single field
2020
}
2121

22-
return x.Sync(new(Comment))
22+
_, err := x.SyncWithOptions(xorm.SyncOptions{
23+
IgnoreConstrains: true,
24+
IgnoreIndices: true,
25+
}, new(Comment))
26+
return err
2327
}

models/migrations/v1_23/v306.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ func AddBlockAdminMergeOverrideBranchProtection(x *xorm.Engine) error {
99
type ProtectedBranch struct {
1010
BlockAdminMergeOverride bool `xorm:"NOT NULL DEFAULT false"`
1111
}
12-
return x.Sync(new(ProtectedBranch))
12+
_, err := x.SyncWithOptions(xorm.SyncOptions{
13+
IgnoreConstrains: true,
14+
IgnoreIndices: true,
15+
}, new(ProtectedBranch))
16+
return err
1317
}

models/migrations/v1_23/v310.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ func AddPriorityToProtectedBranch(x *xorm.Engine) error {
1212
Priority int64 `xorm:"NOT NULL DEFAULT 0"`
1313
}
1414

15-
return x.Sync(new(ProtectedBranch))
15+
_, err := x.SyncWithOptions(xorm.SyncOptions{
16+
IgnoreConstrains: true,
17+
IgnoreIndices: true,
18+
}, new(ProtectedBranch))
19+
return err
1620
}

models/migrations/v1_23/v311.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ func AddTimeEstimateColumnToIssueTable(x *xorm.Engine) error {
1111
type Issue struct {
1212
TimeEstimate int64 `xorm:"NOT NULL DEFAULT 0"`
1313
}
14-
15-
return x.Sync(new(Issue))
14+
_, err := x.SyncWithOptions(xorm.SyncOptions{
15+
IgnoreConstrains: true,
16+
IgnoreIndices: true,
17+
}, new(Issue))
18+
return err
1619
}

models/migrations/v1_24/v312.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,9 @@ func (pullAutoMerge) TableName() string {
1717
}
1818

1919
func AddDeleteBranchAfterMergeForAutoMerge(x *xorm.Engine) error {
20-
return x.Sync(new(pullAutoMerge))
20+
_, err := x.SyncWithOptions(xorm.SyncOptions{
21+
IgnoreConstrains: true,
22+
IgnoreIndices: true,
23+
}, new(pullAutoMerge))
24+
return err
2125
}

models/migrations/v1_24/v315.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ func AddEphemeralToActionRunner(x *xorm.Engine) error {
1111
type ActionRunner struct {
1212
Ephemeral bool `xorm:"ephemeral NOT NULL DEFAULT false"`
1313
}
14-
15-
return x.Sync(new(ActionRunner))
14+
_, err := x.SyncWithOptions(xorm.SyncOptions{
15+
IgnoreConstrains: true,
16+
IgnoreIndices: true,
17+
}, new(ActionRunner))
18+
return err
1619
}

models/migrations/v1_24/v316.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ func AddDescriptionForSecretsAndVariables(x *xorm.Engine) error {
1616
Description string `xorm:"TEXT"`
1717
}
1818

19-
return x.Sync(new(Secret), new(ActionVariable))
19+
_, err := x.SyncWithOptions(xorm.SyncOptions{
20+
IgnoreConstrains: true,
21+
IgnoreIndices: true,
22+
}, new(Secret), new(ActionVariable))
23+
return err
2024
}

models/migrations/v1_24/v318.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ func AddRepoUnitAnonymousAccessMode(x *xorm.Engine) error {
1313
type RepoUnit struct { //revive:disable-line:exported
1414
AnonymousAccessMode perm.AccessMode `xorm:"NOT NULL DEFAULT 0"`
1515
}
16-
return x.Sync(&RepoUnit{})
16+
_, err := x.SyncWithOptions(xorm.SyncOptions{
17+
IgnoreConstrains: true,
18+
IgnoreIndices: true,
19+
}, new(RepoUnit))
20+
return err
1721
}

models/migrations/v1_24/v319.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ func AddExclusiveOrderColumnToLabelTable(x *xorm.Engine) error {
1111
type Label struct {
1212
ExclusiveOrder int `xorm:"DEFAULT 0"`
1313
}
14-
15-
return x.Sync(new(Label))
14+
_, err := x.SyncWithOptions(xorm.SyncOptions{
15+
IgnoreConstrains: true,
16+
IgnoreIndices: true,
17+
}, new(Label))
18+
return err
1619
}

modules/structs/user_app.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ type AccessToken struct {
2323
type AccessTokenList []*AccessToken
2424

2525
// CreateAccessTokenOption options when create access token
26+
// swagger:model CreateAccessTokenOption
2627
type CreateAccessTokenOption struct {
2728
// required: true
28-
Name string `json:"name" binding:"Required"`
29+
Name string `json:"name" binding:"Required"`
30+
// example: ["all", "read:activitypub","read:issue", "write:misc", "read:notification", "read:organization", "read:package", "read:repository", "read:user"]
2931
Scopes []string `json:"scopes"`
3032
}
3133

options/locale/locale_ga-IE.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,7 @@ pulls.add_prefix=Cuir réimír <strong>%s</strong> leis
18791879
pulls.remove_prefix=Bain an réimír <strong>%s</strong>
18801880
pulls.data_broken=Tá an t-iarratas tarraingthe seo briste mar gheall ar fhaisnéis forc a bheith in easnamh.
18811881
pulls.files_conflicted=Tá athruithe ag an iarratas tarraingthe seo atá contrártha leis an spriocbhrainse.
1882+
pulls.is_checking=Ag seiceáil le haghaidh coinbhleachtaí cumaisc ...
18821883
pulls.is_ancestor=Tá an brainse seo san áireamh cheana féin sa spriocbhrainse. Níl aon rud le cumasc.
18831884
pulls.is_empty=Tá na hathruithe ar an mbrainse seo ar an spriocbhrainse cheana féin. Is tiomantas folamh é seo.
18841885
pulls.required_status_check_failed=Níor éirigh le roinnt seiceálacha riachtanacha.
@@ -3842,6 +3843,8 @@ deleted.display_name=Tionscadal scriosta
38423843
type-1.display_name=Tionscadal Aonair
38433844
type-2.display_name=Tionscadal Stórais
38443845
type-3.display_name=Tionscadal Eagrúcháin
3846+
enter_fullscreen=Lánscáileán
3847+
exit_fullscreen=Scoir Lánscáileáin
38453848

38463849
[git.filemode]
38473850
changed_filemode=%[1]s → %[2]s

templates/repo/branch_dropdown.tmpl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,20 @@ Search "repo/branch_dropdown" in the template directory to find all occurrences.
4747
>
4848
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}}
4949
<div class="ui dropdown custom branch-selector-dropdown ellipsis-text-items">
50-
<div class="ui button branch-dropdown-button">
50+
<div class="ui compact button branch-dropdown-button">
5151
<span class="flex-text-block gt-ellipsis">
52-
{{if not .DropdownFixedText}}
53-
{{if .ShowTabTags}}
52+
{{if .DropdownFixedText}}
53+
{{.DropdownFixedText}}
54+
{{else}}
55+
{{if eq .CurrentRefType "tag"}}
5456
{{svg "octicon-tag"}}
55-
{{else if .ShowTabBranches}}
57+
{{else if eq .CurrentRefType "branch"}}
5658
{{svg "octicon-git-branch"}}
59+
{{else}}
60+
{{svg "octicon-git-commit"}}
5761
{{end}}
62+
<strong class="tw-inline-block gt-ellipsis">{{.CurrentRefShortName}}</strong>
5863
{{end}}
59-
<strong class="tw-ml-2 tw-inline-block gt-ellipsis">{{Iif .DropdownFixedText .SelectedRefShortName}}</strong>
6064
</span>
6165
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
6266
</div>

templates/swagger/v1_json.tmpl

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/pull_status_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ func TestPullCreate_EmptyChangesWithSameCommits(t *testing.T) {
172172

173173
func TestPullStatusDelayCheck(t *testing.T) {
174174
onGiteaRun(t, func(t *testing.T, u *url.URL) {
175-
defer test.MockVariableValue(&setting.IsProd)()
176175
defer test.MockVariableValue(&setting.Repository.PullRequest.DelayCheckForInactiveDays, 1)()
177176
defer test.MockVariableValue(&pull.AddPullRequestToCheckQueue)()
178177

@@ -203,11 +202,11 @@ func TestPullStatusDelayCheck(t *testing.T) {
203202
issue3, checkedPrID := run(t, func(t *testing.T) {})
204203
assert.Equal(t, issues.PullRequestStatusMergeable, issue3.PullRequest.Status)
205204
assert.Zero(t, checkedPrID)
206-
setting.IsProd = true
207205
assertReloadingInterval(t, "") // the PR is mergeable, so no need to reload the merge box
208-
setting.IsProd = false
209-
assertReloadingInterval(t, "1") // make sure dev mode always do merge box reloading, to make sure the UI logic won't break
210-
setting.IsProd = true
206+
207+
// setting.IsProd = false // it would cause data-race because the queue handlers might be running and reading its value
208+
// assertReloadingInterval(t, "1") // make sure dev mode always do merge box reloading, to make sure the UI logic won't break
209+
// setting.IsProd = true
211210

212211
// when base branch changes, PR status should be updated, but it is inactive for long time, so no real check
213212
issue3, checkedPrID = run(t, func(t *testing.T) {

web_src/css/base.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
--checkbox-size: 15px; /* height and width of checkbox and radio inputs */
3030
--page-spacing: 16px; /* space between page elements */
3131
--page-margin-x: 32px; /* minimum space on left and right side of page */
32+
--page-space-bottom: 64px; /* space between last page element and footer */
3233
}
3334

3435
@media (min-width: 768px) and (max-width: 1200px) {
@@ -479,7 +480,7 @@ img.ui.avatar,
479480

480481
.full.height {
481482
flex-grow: 1;
482-
padding-bottom: 80px;
483+
padding-bottom: var(--page-space-bottom);
483484
}
484485

485486
.status-page-error {
@@ -1149,6 +1150,7 @@ table th[data-sortt-desc] .svg {
11491150
min-width: 0;
11501151
}
11511152

1153+
.ui.dropdown > .ui.button,
11521154
.flex-text-block > .ui.button,
11531155
.flex-text-inline > .ui.button {
11541156
margin: 0; /* fomantic buttons have default margin, when we use them in a flex container with gap, we do not need these margins */

web_src/js/components/RepoBranchTagSelector.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ export default defineComponent({
222222
<template v-if="dropdownFixedText">{{ dropdownFixedText }}</template>
223223
<template v-else>
224224
<svg-icon v-if="currentRefType === 'tag'" name="octicon-tag"/>
225-
<svg-icon v-else name="octicon-git-branch"/>
225+
<svg-icon v-else-if="currentRefType === 'branch'" name="octicon-git-branch"/>
226+
<svg-icon v-else name="octicon-git-commit"/>
226227
<strong ref="dropdownRefName" class="tw-inline-block gt-ellipsis">{{ currentRefShortName }}</strong>
227228
</template>
228229
</span>

web_src/js/components/RepoContributors.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ export default defineComponent({
354354
<div>
355355
<!-- Contribution type -->
356356
<div class="ui floating dropdown jump" id="repo-contributors">
357-
<div class="ui basic compact button tw-mr-0">
357+
<div class="ui basic compact button">
358358
<span class="not-mobile">{{ locale.filterLabel }}</span> <strong>{{ locale.contributionType[type] }}</strong>
359359
<svg-icon name="octicon-triangle-down" :size="14"/>
360360
</div>

0 commit comments

Comments
 (0)