diff options
-rw-r--r-- | models/migrations/v1_23/v299.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_23/v300.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_23/v301.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_23/v303.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_23/v306.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_23/v310.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_23/v311.go | 7 | ||||
-rw-r--r-- | models/migrations/v1_24/v312.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_24/v315.go | 7 | ||||
-rw-r--r-- | models/migrations/v1_24/v316.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_24/v318.go | 6 | ||||
-rw-r--r-- | models/migrations/v1_24/v319.go | 7 | ||||
-rw-r--r-- | modules/structs/user_app.go | 4 | ||||
-rw-r--r-- | options/locale/locale_ga-IE.ini | 3 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 13 | ||||
-rw-r--r-- | tests/integration/pull_status_test.go | 9 |
16 files changed, 82 insertions, 22 deletions
diff --git a/models/migrations/v1_23/v299.go b/models/migrations/v1_23/v299.go index f6db960c3b..e5fde3749b 100644 --- a/models/migrations/v1_23/v299.go +++ b/models/migrations/v1_23/v299.go @@ -14,5 +14,9 @@ func AddContentVersionToIssueAndComment(x *xorm.Engine) error { ContentVersion int `xorm:"NOT NULL DEFAULT 0"` } - return x.Sync(new(Comment), new(Issue)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(Comment), new(Issue)) + return err } diff --git a/models/migrations/v1_23/v300.go b/models/migrations/v1_23/v300.go index f1f1cccdbf..51de43da5e 100644 --- a/models/migrations/v1_23/v300.go +++ b/models/migrations/v1_23/v300.go @@ -13,5 +13,9 @@ func AddForcePushBranchProtection(x *xorm.Engine) error { ForcePushAllowlistTeamIDs []int64 `xorm:"JSON TEXT"` ForcePushAllowlistDeployKeys bool `xorm:"NOT NULL DEFAULT false"` } - return x.Sync(new(ProtectedBranch)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(ProtectedBranch)) + return err } diff --git a/models/migrations/v1_23/v301.go b/models/migrations/v1_23/v301.go index b7797f6c6b..99c8e3d8ea 100644 --- a/models/migrations/v1_23/v301.go +++ b/models/migrations/v1_23/v301.go @@ -10,5 +10,9 @@ func AddSkipSecondaryAuthColumnToOAuth2ApplicationTable(x *xorm.Engine) error { type oauth2Application struct { SkipSecondaryAuthorization bool `xorm:"NOT NULL DEFAULT FALSE"` } - return x.Sync(new(oauth2Application)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(oauth2Application)) + return err } diff --git a/models/migrations/v1_23/v303.go b/models/migrations/v1_23/v303.go index adfe917d3f..1e36388930 100644 --- a/models/migrations/v1_23/v303.go +++ b/models/migrations/v1_23/v303.go @@ -19,5 +19,9 @@ func AddCommentMetaDataColumn(x *xorm.Engine) error { CommentMetaData *CommentMetaData `xorm:"JSON TEXT"` // put all non-index metadata in a single field } - return x.Sync(new(Comment)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(Comment)) + return err } diff --git a/models/migrations/v1_23/v306.go b/models/migrations/v1_23/v306.go index 276b438e95..a1e698fe31 100644 --- a/models/migrations/v1_23/v306.go +++ b/models/migrations/v1_23/v306.go @@ -9,5 +9,9 @@ func AddBlockAdminMergeOverrideBranchProtection(x *xorm.Engine) error { type ProtectedBranch struct { BlockAdminMergeOverride bool `xorm:"NOT NULL DEFAULT false"` } - return x.Sync(new(ProtectedBranch)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(ProtectedBranch)) + return err } diff --git a/models/migrations/v1_23/v310.go b/models/migrations/v1_23/v310.go index 394417f5a0..c856a708f9 100644 --- a/models/migrations/v1_23/v310.go +++ b/models/migrations/v1_23/v310.go @@ -12,5 +12,9 @@ func AddPriorityToProtectedBranch(x *xorm.Engine) error { Priority int64 `xorm:"NOT NULL DEFAULT 0"` } - return x.Sync(new(ProtectedBranch)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(ProtectedBranch)) + return err } diff --git a/models/migrations/v1_23/v311.go b/models/migrations/v1_23/v311.go index 0fc1ac8c0e..21293d83be 100644 --- a/models/migrations/v1_23/v311.go +++ b/models/migrations/v1_23/v311.go @@ -11,6 +11,9 @@ func AddTimeEstimateColumnToIssueTable(x *xorm.Engine) error { type Issue struct { TimeEstimate int64 `xorm:"NOT NULL DEFAULT 0"` } - - return x.Sync(new(Issue)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(Issue)) + return err } diff --git a/models/migrations/v1_24/v312.go b/models/migrations/v1_24/v312.go index 9766dc1ccf..367a6c4947 100644 --- a/models/migrations/v1_24/v312.go +++ b/models/migrations/v1_24/v312.go @@ -17,5 +17,9 @@ func (pullAutoMerge) TableName() string { } func AddDeleteBranchAfterMergeForAutoMerge(x *xorm.Engine) error { - return x.Sync(new(pullAutoMerge)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(pullAutoMerge)) + return err } diff --git a/models/migrations/v1_24/v315.go b/models/migrations/v1_24/v315.go index aefb872d0f..22a72c31e9 100644 --- a/models/migrations/v1_24/v315.go +++ b/models/migrations/v1_24/v315.go @@ -11,6 +11,9 @@ func AddEphemeralToActionRunner(x *xorm.Engine) error { type ActionRunner struct { Ephemeral bool `xorm:"ephemeral NOT NULL DEFAULT false"` } - - return x.Sync(new(ActionRunner)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(ActionRunner)) + return err } diff --git a/models/migrations/v1_24/v316.go b/models/migrations/v1_24/v316.go index 0378133e53..e7f04333cc 100644 --- a/models/migrations/v1_24/v316.go +++ b/models/migrations/v1_24/v316.go @@ -16,5 +16,9 @@ func AddDescriptionForSecretsAndVariables(x *xorm.Engine) error { Description string `xorm:"TEXT"` } - return x.Sync(new(Secret), new(ActionVariable)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(Secret), new(ActionVariable)) + return err } diff --git a/models/migrations/v1_24/v318.go b/models/migrations/v1_24/v318.go index 83fb0061d3..3e08c3d504 100644 --- a/models/migrations/v1_24/v318.go +++ b/models/migrations/v1_24/v318.go @@ -13,5 +13,9 @@ func AddRepoUnitAnonymousAccessMode(x *xorm.Engine) error { type RepoUnit struct { //revive:disable-line:exported AnonymousAccessMode perm.AccessMode `xorm:"NOT NULL DEFAULT 0"` } - return x.Sync(&RepoUnit{}) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(RepoUnit)) + return err } diff --git a/models/migrations/v1_24/v319.go b/models/migrations/v1_24/v319.go index 6983c38605..6571ddf75b 100644 --- a/models/migrations/v1_24/v319.go +++ b/models/migrations/v1_24/v319.go @@ -11,6 +11,9 @@ func AddExclusiveOrderColumnToLabelTable(x *xorm.Engine) error { type Label struct { ExclusiveOrder int `xorm:"DEFAULT 0"` } - - return x.Sync(new(Label)) + _, err := x.SyncWithOptions(xorm.SyncOptions{ + IgnoreConstrains: true, + IgnoreIndices: true, + }, new(Label)) + return err } diff --git a/modules/structs/user_app.go b/modules/structs/user_app.go index a7d2e28b41..8401252bd6 100644 --- a/modules/structs/user_app.go +++ b/modules/structs/user_app.go @@ -23,9 +23,11 @@ type AccessToken struct { type AccessTokenList []*AccessToken // CreateAccessTokenOption options when create access token +// swagger:model CreateAccessTokenOption type CreateAccessTokenOption struct { // required: true - Name string `json:"name" binding:"Required"` + Name string `json:"name" binding:"Required"` + // example: ["all", "read:activitypub","read:issue", "write:misc", "read:notification", "read:organization", "read:package", "read:repository", "read:user"] Scopes []string `json:"scopes"` } diff --git a/options/locale/locale_ga-IE.ini b/options/locale/locale_ga-IE.ini index 8721dd1150..094f238869 100644 --- a/options/locale/locale_ga-IE.ini +++ b/options/locale/locale_ga-IE.ini @@ -1879,6 +1879,7 @@ pulls.add_prefix=Cuir réimír <strong>%s</strong> leis pulls.remove_prefix=Bain an réimír <strong>%s</strong> pulls.data_broken=Tá an t-iarratas tarraingthe seo briste mar gheall ar fhaisnéis forc a bheith in easnamh. pulls.files_conflicted=Tá athruithe ag an iarratas tarraingthe seo atá contrártha leis an spriocbhrainse. +pulls.is_checking=Ag seiceáil le haghaidh coinbhleachtaí cumaisc ... pulls.is_ancestor=Tá an brainse seo san áireamh cheana féin sa spriocbhrainse. Níl aon rud le cumasc. pulls.is_empty=Tá na hathruithe ar an mbrainse seo ar an spriocbhrainse cheana féin. Is tiomantas folamh é seo. pulls.required_status_check_failed=Níor éirigh le roinnt seiceálacha riachtanacha. @@ -3842,6 +3843,8 @@ deleted.display_name=Tionscadal scriosta type-1.display_name=Tionscadal Aonair type-2.display_name=Tionscadal Stórais type-3.display_name=Tionscadal Eagrúcháin +enter_fullscreen=Lánscáileán +exit_fullscreen=Scoir Lánscáileáin [git.filemode] changed_filemode=%[1]s → %[2]s diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 0a9432fc9d..8758b5c0a1 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -21350,7 +21350,18 @@ "items": { "type": "string" }, - "x-go-name": "Scopes" + "x-go-name": "Scopes", + "example": [ + "all", + "read:activitypub", + "read:issue", + "write:misc", + "read:notification", + "read:organization", + "read:package", + "read:repository", + "read:user" + ] } }, "x-go-package": "code.gitea.io/gitea/modules/structs" diff --git a/tests/integration/pull_status_test.go b/tests/integration/pull_status_test.go index 6d42d9f62f..4d43847f1b 100644 --- a/tests/integration/pull_status_test.go +++ b/tests/integration/pull_status_test.go @@ -172,7 +172,6 @@ func TestPullCreate_EmptyChangesWithSameCommits(t *testing.T) { func TestPullStatusDelayCheck(t *testing.T) { onGiteaRun(t, func(t *testing.T, u *url.URL) { - defer test.MockVariableValue(&setting.IsProd)() defer test.MockVariableValue(&setting.Repository.PullRequest.DelayCheckForInactiveDays, 1)() defer test.MockVariableValue(&pull.AddPullRequestToCheckQueue)() @@ -203,11 +202,11 @@ func TestPullStatusDelayCheck(t *testing.T) { issue3, checkedPrID := run(t, func(t *testing.T) {}) assert.Equal(t, issues.PullRequestStatusMergeable, issue3.PullRequest.Status) assert.Zero(t, checkedPrID) - setting.IsProd = true assertReloadingInterval(t, "") // the PR is mergeable, so no need to reload the merge box - setting.IsProd = false - assertReloadingInterval(t, "1") // make sure dev mode always do merge box reloading, to make sure the UI logic won't break - setting.IsProd = true + + // setting.IsProd = false // it would cause data-race because the queue handlers might be running and reading its value + // assertReloadingInterval(t, "1") // make sure dev mode always do merge box reloading, to make sure the UI logic won't break + // setting.IsProd = true // when base branch changes, PR status should be updated, but it is inactive for long time, so no real check issue3, checkedPrID = run(t, func(t *testing.T) { |