mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
Compare commits
16
Commits
ae176cd649
...
8731ea4bbb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8731ea4bbb | ||
|
|
7cfd421aa8 | ||
|
|
c0f4e5583e | ||
|
|
a4526d5a82 | ||
|
|
9dc04289aa | ||
|
|
b8977eeb47 | ||
|
|
17ce342dcb | ||
|
|
6525e6df15 | ||
|
|
2fec2affc4 | ||
|
|
f9819dbb74 | ||
|
|
173965f66b | ||
|
|
b3b9c4903e | ||
|
|
fff32e9469 | ||
|
|
775e3bdb34 | ||
|
|
730b6f2daf | ||
|
|
b06002f449 |
@@ -11,7 +11,7 @@ include_file = ["main.go"]
|
||||
include_dir = ["cmd", "models", "modules", "options", "routers", "services"]
|
||||
exclude_dir = [
|
||||
"models/fixtures",
|
||||
"models/migrations/fixtures",
|
||||
"modelmigration/fixtures",
|
||||
"modules/avatar/identicon/testdata",
|
||||
"modules/avatar/testdata",
|
||||
"modules/git/tests",
|
||||
|
||||
@@ -11,12 +11,12 @@ runs:
|
||||
steps:
|
||||
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
||||
- if: ${{ inputs.cache == 'true' }}
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
||||
with:
|
||||
node-version: 26
|
||||
cache: pnpm
|
||||
cache-dependency-path: pnpm-lock.yaml
|
||||
- if: ${{ inputs.cache != 'true' }}
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
||||
with:
|
||||
node-version: 26
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
||||
- uses: renovatebot/github-action@b50d2ba2bd928235abdcc14d06dfafc217f1c565 # v46.1.18
|
||||
- uses: renovatebot/github-action@22e0a16091fc706b04affe6ae53d5e3358ac4023 # v46.1.19
|
||||
with:
|
||||
renovate-version: ${{ env.RENOVATE_VERSION }}
|
||||
configurationFile: renovate.json5
|
||||
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
ports:
|
||||
- "9000:9000"
|
||||
devstoreaccount1.azurite.local: # https://github.com/Azure/Azurite/issues/1583
|
||||
image: mcr.microsoft.com/azure-storage/azurite:latest@sha256:dae2a5f96553962901304b94e72ef87e299d0825e4b679673bcc527a25076fe4
|
||||
image: mcr.microsoft.com/azure-storage/azurite:latest@sha256:7aee5546ecffb850634c5f67ed87f59dba02a0eb24b7c7e01f5bd9148bd5edd9
|
||||
ports:
|
||||
- 10000:10000
|
||||
steps:
|
||||
@@ -237,7 +237,7 @@ jobs:
|
||||
ports:
|
||||
- "1433:1433"
|
||||
devstoreaccount1.azurite.local: # https://github.com/Azure/Azurite/issues/1583
|
||||
image: mcr.microsoft.com/azure-storage/azurite:latest@sha256:dae2a5f96553962901304b94e72ef87e299d0825e4b679673bcc527a25076fe4
|
||||
image: mcr.microsoft.com/azure-storage/azurite:latest@sha256:7aee5546ecffb850634c5f67ed87f59dba02a0eb24b7c7e01f5bd9148bd5edd9
|
||||
ports:
|
||||
- 10000:10000
|
||||
steps:
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.base.sha }}
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
|
||||
with:
|
||||
node-version: 26
|
||||
# Labels are only synced after the title lints, so an invalid title never reaches the label diff.
|
||||
|
||||
+3
-4
@@ -53,9 +53,9 @@ linters:
|
||||
desc: use builtin errors package instead
|
||||
migrations:
|
||||
files:
|
||||
- '**/models/migrations/**/*.go'
|
||||
- '**/modelmigration/**/*.go'
|
||||
deny:
|
||||
- pkg: gitea.dev/models$
|
||||
- pkg: gitea.dev/models$ # FIXME: it should deny all sub packages like "gitea.dev/models/repo"
|
||||
desc: migrations must not depend on the models package
|
||||
- pkg: gitea.dev/modules/structs
|
||||
desc: migrations must not depend on modules/structs (API structures change over time)
|
||||
@@ -134,8 +134,7 @@ linters:
|
||||
path: _test\.go
|
||||
- linters:
|
||||
- dupl
|
||||
- errcheck
|
||||
path: models/migrations/v
|
||||
path: modelmigration/v
|
||||
- linters:
|
||||
- forbidigo
|
||||
path: cmd
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ If further discussion is needed, we encourage you to open a new issue instead an
|
||||
|
||||
## Building Gitea
|
||||
|
||||
See [docs/setup.md](docs/setup.md) for prerequisites and [docs/development.md](docs/development.md)
|
||||
See [docs/build-setup.md](docs/build-setup.md) for prerequisites and [docs/development.md](docs/development.md)
|
||||
for building Gitea and the development workflow.
|
||||
|
||||
## Styleguide
|
||||
|
||||
@@ -18,7 +18,7 @@ GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.15 # renovate: datasource=go
|
||||
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.8.0 # renovate: datasource=go
|
||||
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.35.0 # renovate: datasource=go
|
||||
XGO_PACKAGE ?= src.techknowlogick.com/xgo@v1.9.0 # renovate: datasource=go
|
||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.5.0 # renovate: datasource=go
|
||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.6.0 # renovate: datasource=go
|
||||
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 # renovate: datasource=go
|
||||
SHELLCHECK_IMAGE ?= docker.io/koalaman/shellcheck:v0.11.0@sha256:61862eba1fcf09a484ebcc6feea46f1782532571a34ed51fedf90dd25f925a8d # renovate: datasource=docker
|
||||
|
||||
@@ -113,8 +113,8 @@ LDFLAGS := $(LDFLAGS) -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
|
||||
|
||||
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/riscv64
|
||||
|
||||
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list gitea.dev/models/migrations/...) gitea.dev/tests/integration/migration-test gitea.dev/tests gitea.dev/tests/integration,$(shell $(GO) list ./... | grep -v /vendor/))
|
||||
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list gitea.dev/models/migrations/...)
|
||||
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list gitea.dev/modelmigration/...) gitea.dev/tests/integration/migration-test gitea.dev/tests gitea.dev/tests/integration,$(shell $(GO) list ./... | grep -v /vendor/))
|
||||
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list gitea.dev/modelmigration/...)
|
||||
|
||||
FRONTEND_SOURCES := $(shell find web_src/js web_src/css -type f)
|
||||
FRONTEND_CONFIGS := vite.config.ts tailwind.config.ts
|
||||
@@ -148,6 +148,7 @@ GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go")
|
||||
GO_SOURCES += $(GENERATED_GO_DEST)
|
||||
|
||||
ESLINT_CONCURRENCY ?= 2
|
||||
ESLINT_ARGS := --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY)
|
||||
|
||||
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
|
||||
SWAGGER_SPEC_INPUT := templates/swagger/v1_input.json
|
||||
@@ -298,12 +299,12 @@ lint-backend-fix: lint-go-fix lint-editorconfig ## lint backend files and fix is
|
||||
|
||||
.PHONY: lint-js
|
||||
lint-js: node_modules ## lint js and ts files
|
||||
pnpm exec eslint --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY) $(ESLINT_FILES)
|
||||
pnpm exec eslint $(ESLINT_ARGS) $(ESLINT_FILES)
|
||||
pnpm exec vue-tsc
|
||||
|
||||
.PHONY: lint-js-fix
|
||||
lint-js-fix: node_modules ## lint js and ts files and fix issues
|
||||
pnpm exec eslint --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY) $(ESLINT_FILES) --fix
|
||||
pnpm exec eslint $(ESLINT_ARGS) $(ESLINT_FILES) --fix
|
||||
pnpm exec vue-tsc
|
||||
|
||||
.PHONY: lint-css
|
||||
@@ -367,11 +368,11 @@ lint-yaml: .venv ## lint yaml files
|
||||
|
||||
.PHONY: lint-json
|
||||
lint-json: node_modules ## lint json files
|
||||
pnpm exec eslint -c eslint.json.config.ts --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY)
|
||||
pnpm exec eslint -c eslint.json.config.ts $(ESLINT_ARGS)
|
||||
|
||||
.PHONY: lint-json-fix
|
||||
lint-json-fix: node_modules ## lint and fix json files
|
||||
pnpm exec eslint -c eslint.json.config.ts --color --max-warnings=0 --concurrency $(ESLINT_CONCURRENCY) --fix
|
||||
pnpm exec eslint -c eslint.json.config.ts $(ESLINT_ARGS) --fix
|
||||
|
||||
.PHONY: watch
|
||||
watch: ## watch everything and continuously rebuild
|
||||
@@ -477,7 +478,7 @@ migrations.individual.test:
|
||||
|
||||
.PHONY: migrations.individual.test\#%
|
||||
migrations.individual.test\#%:
|
||||
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' gitea.dev/models/migrations/$*
|
||||
$(GO) test $(GOTEST_FLAGS) -tags '$(TAGS)' gitea.dev/modelmigration/$*
|
||||
|
||||
.PHONY: playwright
|
||||
playwright: deps-frontend
|
||||
|
||||
+1
-2
@@ -11,7 +11,6 @@ import (
|
||||
"gitea.dev/models/db"
|
||||
repo_model "gitea.dev/models/repo"
|
||||
"gitea.dev/modules/git"
|
||||
"gitea.dev/modules/gitrepo"
|
||||
"gitea.dev/modules/log"
|
||||
repo_module "gitea.dev/modules/repository"
|
||||
|
||||
@@ -129,7 +128,7 @@ func runRepoSyncReleases(ctx context.Context, _ *cli.Command) error {
|
||||
log.Trace("Processing next %d repos of %d", len(repos), count)
|
||||
for _, repo := range repos {
|
||||
log.Trace("Synchronizing repo %s", repo.FullName())
|
||||
gitRepo, err := gitrepo.OpenRepository(repo)
|
||||
gitRepo, err := git.OpenRepository(repo)
|
||||
if err != nil {
|
||||
log.Warn("OpenRepository: %v", err)
|
||||
continue
|
||||
|
||||
+4
-4
@@ -12,9 +12,9 @@ import (
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
|
||||
"gitea.dev/modelmigration"
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations"
|
||||
migrate_base "gitea.dev/models/migrations/base"
|
||||
"gitea.dev/modules/container"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/setting"
|
||||
@@ -129,10 +129,10 @@ func runRecreateTable(ctx context.Context, cmd *cli.Command) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
recreateTables := migrate_base.RecreateTables(beans...)
|
||||
recreateTables := base.RecreateTables(beans...)
|
||||
|
||||
return db.InitEngineWithMigration(context.Background(), func(ctx context.Context, x db.EngineMigration) error {
|
||||
if err := migrations.EnsureUpToDate(ctx, x); err != nil {
|
||||
if err := modelmigration.EnsureUpToDate(ctx, x); err != nil {
|
||||
return err
|
||||
}
|
||||
return recreateTables(x)
|
||||
|
||||
@@ -53,10 +53,10 @@ For packagers who need to use paths like `/etc/gitea/app.ini`,
|
||||
they should define these values at build time for `make build` by environment variable like
|
||||
`LDFLAGS='-X "module.Var1=Value1" -X "module.Var2=Value2"' TAGS="bindata" make build`.
|
||||
|
||||
- _`CustomConf`_: `-X "code.gitea.io/gitea/modules/setting.CustomConf=/etc/gitea/app.ini"`
|
||||
- _`AppWorkPath`_: `-X "code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/gitea"`
|
||||
- _`CustomPath`_: `-X "code.gitea.io/gitea/modules/setting.CustomPath=/var/lib/gitea/custom"`
|
||||
- Default PID file location: `-X "code.gitea.io/gitea/cmd.PIDFile=/run/gitea.pid"`
|
||||
- _`CustomConf`_: `-X "gitea.dev/modules/setting.CustomConf=/etc/gitea/app.ini"`
|
||||
- _`AppWorkPath`_: `-X "gitea.dev/modules/setting.AppWorkPath=/var/lib/gitea"`
|
||||
- _`CustomPath`_: `-X "gitea.dev/modules/setting.CustomPath=/var/lib/gitea/custom"`
|
||||
- Default PID file location: `-X "gitea.dev/cmd.PIDFile=/run/gitea.pid"`
|
||||
|
||||
Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build`
|
||||
with the appropriate `TAGS` as above.
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ which lives in the [documentation repository](https://gitea.com/gitea/docs).
|
||||
## Database migrations
|
||||
|
||||
If you make breaking changes to a database-persisted struct under `models/`, add a
|
||||
new migration in `models/migrations/`. See [testing.md](testing.md#migration-tests)
|
||||
new migration in `modelmigration/`. See [testing.md](testing.md#migration-tests)
|
||||
for running the migration tests.
|
||||
|
||||
## Testing
|
||||
|
||||
@@ -23,7 +23,7 @@ The backend is split into top-level packages, each with a focused responsibility
|
||||
dependencies to a minimum
|
||||
- `models/db`: core database operations
|
||||
- `models/fixtures`: sample data used by tests
|
||||
- `models/migrations`: schema migration scripts
|
||||
- `modelmigration`: schema migration scripts
|
||||
- `modules`: standalone functionality with few dependencies
|
||||
- `modules/setting`: configuration handling
|
||||
- `modules/git`: interaction with the Git command line
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ Useful environment variables:
|
||||
## Migration tests
|
||||
|
||||
If you change a database-persisted struct under `models/` you will usually need a
|
||||
new migration in `models/migrations/`. Run the migration tests with:
|
||||
new migration in `modelmigration`. Run the migration tests with:
|
||||
|
||||
```bash
|
||||
make test-migration
|
||||
|
||||
+10
-34
@@ -3,7 +3,6 @@ import globals from 'globals';
|
||||
import importPlugin from 'eslint-plugin-import-x';
|
||||
import playwright from 'eslint-plugin-playwright';
|
||||
import regexp from 'eslint-plugin-regexp';
|
||||
import sonarjs from 'eslint-plugin-sonarjs';
|
||||
import stylistic from '@stylistic/eslint-plugin';
|
||||
import typescriptParser from '@typescript-eslint/parser';
|
||||
import typescriptPlugin from 'typescript-eslint';
|
||||
@@ -64,7 +63,6 @@ export default defineConfig([
|
||||
'gitea': {rules: {'unescaped-html-literal': unescapedHtmlLiteral}},
|
||||
'import-x': importPlugin,
|
||||
regexp,
|
||||
sonarjs,
|
||||
unicorn,
|
||||
wc,
|
||||
},
|
||||
@@ -570,7 +568,7 @@ export default defineConfig([
|
||||
'no-useless-constructor': [2],
|
||||
'no-useless-escape': [2],
|
||||
'no-useless-rename': [2],
|
||||
'no-useless-return': [0], // handled by sonarjs/no-redundant-jump
|
||||
'no-useless-return': [2],
|
||||
'no-var': [2],
|
||||
'no-void': [2],
|
||||
'no-warning-comments': [0],
|
||||
@@ -676,37 +674,6 @@ export default defineConfig([
|
||||
'require-await': [0], // handled by @typescript-eslint/require-await
|
||||
'require-unicode-regexp': [0],
|
||||
'require-yield': [2],
|
||||
'sonarjs/cognitive-complexity': [0],
|
||||
'sonarjs/elseif-without-else': [0],
|
||||
'sonarjs/max-switch-cases': [0],
|
||||
'sonarjs/no-all-duplicated-branches': [2],
|
||||
'sonarjs/no-collapsible-if': [0],
|
||||
'sonarjs/no-collection-size-mischeck': [2],
|
||||
'sonarjs/no-duplicate-string': [0],
|
||||
'sonarjs/no-duplicated-branches': [0],
|
||||
'sonarjs/no-element-overwrite': [2],
|
||||
'sonarjs/no-empty-collection': [2],
|
||||
'sonarjs/no-extra-arguments': [2],
|
||||
'sonarjs/no-gratuitous-expressions': [2],
|
||||
'sonarjs/no-identical-conditions': [0], // handled by no-dupe-else-if
|
||||
'sonarjs/no-identical-expressions': [2],
|
||||
'sonarjs/no-identical-functions': [2, 5],
|
||||
'sonarjs/no-ignored-return': [2],
|
||||
'sonarjs/no-inverted-boolean-check': [2],
|
||||
'sonarjs/no-nested-switch': [0],
|
||||
'sonarjs/no-nested-template-literals': [0],
|
||||
'sonarjs/no-redundant-boolean': [2],
|
||||
'sonarjs/no-redundant-jump': [2],
|
||||
'sonarjs/no-same-line-conditional': [2],
|
||||
'sonarjs/no-small-switch': [0],
|
||||
'sonarjs/no-unused-collection': [2],
|
||||
'sonarjs/no-use-of-empty-return-value': [2],
|
||||
'sonarjs/no-useless-catch': [0], // handled by no-useless-catch
|
||||
'sonarjs/non-existent-operator': [2],
|
||||
'sonarjs/prefer-immediate-return': [0],
|
||||
'sonarjs/prefer-object-literal': [0],
|
||||
'sonarjs/prefer-single-boolean-return': [0],
|
||||
'sonarjs/prefer-while': [2],
|
||||
'sort-imports': [0],
|
||||
'sort-keys': [0],
|
||||
'sort-vars': [0],
|
||||
@@ -813,6 +780,8 @@ export default defineConfig([
|
||||
'unicorn/no-manually-wrapped-comments': [0], // too opinionated
|
||||
'unicorn/no-mismatched-map-key': [2],
|
||||
'unicorn/no-misrefactored-assignment': [2],
|
||||
'unicorn/no-missing-local-resource': [0], // only applies to html/css/markdown languages
|
||||
'unicorn/no-multiple-promise-resolver-calls': [2],
|
||||
'unicorn/no-named-default': [2],
|
||||
'unicorn/no-negated-array-predicate': [2],
|
||||
'unicorn/no-negated-comparison': [2],
|
||||
@@ -831,6 +800,7 @@ export default defineConfig([
|
||||
'unicorn/no-redundant-comparison': [2],
|
||||
'unicorn/no-return-array-push': [2],
|
||||
'unicorn/no-selector-as-dom-name': [2],
|
||||
'unicorn/no-shorthand-property-overrides': [0], // only applies to css language
|
||||
'unicorn/no-single-promise-in-promise-methods': [2],
|
||||
'unicorn/no-static-only-class': [2],
|
||||
'unicorn/no-subtraction-comparison': [2],
|
||||
@@ -839,6 +809,7 @@ export default defineConfig([
|
||||
'unicorn/no-this-outside-of-class': [0], // gitea uses `this` in non-class functions
|
||||
'unicorn/no-top-level-assignment-in-function': [0],
|
||||
'unicorn/no-top-level-side-effects': [0],
|
||||
'unicorn/no-transition-all': [2],
|
||||
'unicorn/no-typeof-undefined': [2],
|
||||
'unicorn/no-uncalled-method': [2],
|
||||
'unicorn/no-undeclared-class-members': [2],
|
||||
@@ -853,6 +824,7 @@ export default defineConfig([
|
||||
'unicorn/no-unnecessary-polyfills': [2],
|
||||
'unicorn/no-unnecessary-slice-end': [2],
|
||||
'unicorn/no-unnecessary-splice': [2],
|
||||
'unicorn/no-unnecessary-string-trim': [2],
|
||||
'unicorn/no-unreadable-array-destructuring': [0],
|
||||
'unicorn/no-unreadable-for-of-expression': [0],
|
||||
'unicorn/no-unreadable-iife': [0],
|
||||
@@ -880,6 +852,7 @@ export default defineConfig([
|
||||
'unicorn/no-useless-logical-operand': [2],
|
||||
'unicorn/no-useless-override': [2],
|
||||
'unicorn/no-useless-promise-resolve-reject': [2],
|
||||
'unicorn/no-useless-re-export': [2],
|
||||
'unicorn/no-useless-recursion': [0],
|
||||
'unicorn/no-useless-spread': [2],
|
||||
'unicorn/no-useless-switch-case': [2],
|
||||
@@ -929,6 +902,7 @@ export default defineConfig([
|
||||
'unicorn/prefer-else-if': [2],
|
||||
'unicorn/prefer-error-is-error': [0],
|
||||
'unicorn/prefer-event-target': [2],
|
||||
'unicorn/prefer-explicit-viewport-units': [0], // only applies to css language
|
||||
'unicorn/prefer-export-from': [0],
|
||||
'unicorn/prefer-flat-math-min-max': [2],
|
||||
'unicorn/prefer-get-or-insert-computed': [2],
|
||||
@@ -1009,6 +983,7 @@ export default defineConfig([
|
||||
'unicorn/prefer-switch': [0],
|
||||
'unicorn/prefer-temporal': [0],
|
||||
'unicorn/prefer-ternary': [0],
|
||||
'unicorn/prefer-then-catch': [2],
|
||||
'unicorn/prefer-toggle-attribute': [2],
|
||||
'unicorn/prefer-top-level-await': [0],
|
||||
'unicorn/prefer-type-error': [0],
|
||||
@@ -1025,6 +1000,7 @@ export default defineConfig([
|
||||
'unicorn/require-array-join-separator': [2],
|
||||
'unicorn/require-array-sort-compare': [0],
|
||||
'unicorn/require-css-escape': [2],
|
||||
'unicorn/require-frontmatter-fields': [0], // only applies to markdown language
|
||||
'unicorn/require-module-attributes': [2],
|
||||
'unicorn/require-module-specifiers': [0],
|
||||
'unicorn/require-number-to-fixed-digits-argument': [2],
|
||||
|
||||
@@ -3,9 +3,10 @@ import json from '@eslint/json';
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores([
|
||||
'**/.venv',
|
||||
'**/node_modules',
|
||||
'**/public',
|
||||
'public',
|
||||
'custom/public',
|
||||
'data',
|
||||
'.venv',
|
||||
]),
|
||||
{
|
||||
files: ['**/*.json'],
|
||||
|
||||
@@ -24,8 +24,8 @@ require (
|
||||
github.com/PuerkitoBio/goquery v1.12.0
|
||||
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.10.0
|
||||
github.com/alecthomas/chroma/v2 v2.27.0
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.28
|
||||
github.com/aws/aws-sdk-go-v2/service/codecommit v1.35.0
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.29
|
||||
github.com/aws/aws-sdk-go-v2/service/codecommit v1.35.1
|
||||
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
|
||||
github.com/blevesearch/bleve/v2 v2.6.0
|
||||
github.com/bohde/codel v0.2.0
|
||||
@@ -33,7 +33,7 @@ require (
|
||||
github.com/caddyserver/certmagic v0.25.4
|
||||
github.com/charmbracelet/git-lfs-transfer v0.1.1-0.20260309112543-12416315a635
|
||||
github.com/chi-middleware/proxy v1.1.1
|
||||
github.com/dlclark/regexp2/v2 v2.2.2
|
||||
github.com/dlclark/regexp2/v2 v2.5.0
|
||||
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/editorconfig/editorconfig-core-go/v2 v2.6.4
|
||||
@@ -42,11 +42,11 @@ require (
|
||||
github.com/ethantkoenig/rupture v1.0.1
|
||||
github.com/felixge/fgprof v0.9.5
|
||||
github.com/fsnotify/fsnotify v1.10.1
|
||||
github.com/getkin/kin-openapi v0.140.0
|
||||
github.com/getkin/kin-openapi v0.142.0
|
||||
github.com/gliderlabs/ssh v0.3.8
|
||||
github.com/go-chi/chi/v5 v5.3.1
|
||||
github.com/go-chi/cors v1.2.2
|
||||
github.com/go-co-op/gocron/v2 v2.21.2
|
||||
github.com/go-co-op/gocron/v2 v2.22.0
|
||||
github.com/go-enry/go-enry/v2 v2.9.6
|
||||
github.com/go-git/go-billy/v5 v5.9.0
|
||||
github.com/go-git/go-git/v5 v5.19.1
|
||||
@@ -59,7 +59,7 @@ require (
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/google/go-github/v89 v89.0.0
|
||||
github.com/google/licenseclassifier/v2 v2.0.0
|
||||
github.com/google/pprof v0.0.0-20260604005048-7023385849c0
|
||||
github.com/google/pprof v0.0.0-20260709232956-b9395ee17fa0
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/gorilla/feeds v1.2.0
|
||||
github.com/gorilla/sessions v1.4.0
|
||||
@@ -73,7 +73,7 @@ require (
|
||||
github.com/lib/pq v1.12.3
|
||||
github.com/markbates/goth v1.82.0
|
||||
github.com/mattn/go-isatty v0.0.22
|
||||
github.com/mattn/go-sqlite3 v1.14.47
|
||||
github.com/mattn/go-sqlite3 v1.14.48
|
||||
github.com/meilisearch/meilisearch-go v0.36.3
|
||||
github.com/mholt/archives v0.1.5
|
||||
github.com/microcosm-cc/bluemonday v1.0.27
|
||||
@@ -99,9 +99,9 @@ require (
|
||||
github.com/urfave/cli/v3 v3.10.1
|
||||
github.com/wneessen/go-mail v0.8.1
|
||||
github.com/yohcop/openid-go v1.0.1
|
||||
github.com/yuin/goldmark v1.8.2
|
||||
github.com/yuin/goldmark v1.8.4
|
||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
||||
gitlab.com/gitlab-org/api/client-go/v2 v2.46.0
|
||||
gitlab.com/gitlab-org/api/client-go/v2 v2.48.1
|
||||
go.yaml.in/yaml/v4 v4.0.0-rc.5
|
||||
golang.org/x/crypto v0.54.0
|
||||
golang.org/x/image v0.44.0
|
||||
@@ -226,8 +226,8 @@ require (
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||
github.com/nwaples/rardecode/v2 v2.2.3 // indirect
|
||||
github.com/oasdiff/yaml v0.1.0 // indirect
|
||||
github.com/oasdiff/yaml3 v0.0.13 // indirect
|
||||
github.com/oasdiff/yaml v0.1.1 // indirect
|
||||
github.com/oasdiff/yaml3 v0.0.14 // indirect
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
|
||||
github.com/olekukonko/errors v1.3.0 // indirect
|
||||
github.com/olekukonko/ll v0.1.8 // indirect
|
||||
|
||||
@@ -94,14 +94,14 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/aws/aws-sdk-go-v2 v1.42.1 h1:9eOTgu1z/dVtYpNZ3/8/XbbaX0x/BqE3HUzAzs6K0ek=
|
||||
github.com/aws/aws-sdk-go-v2 v1.42.1/go.mod h1:5pKeft2eJj+gElQ38Jqg4ibCqh+/AK33/0X3hip7IjM=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.28 h1:zTXJSsNcoO91/mTXsZoYf0AK8dvNPiA58/VtyGXR+wM=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.28/go.mod h1:Kd9E0JzDBW/q1xbsHFrev/GnbAf5J0Ng8xoyc7HZ91Q=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.29 h1:WHZGssHH887cO0ox07SIQZsFx3MKD4ps6w0xUEmnKYQ=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.29/go.mod h1:Mhl0xR6zjguiuj00XRx2wMx22sAltk7oya39sT7fdg8=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.30 h1:xM/Is9cKMHa8Jj8zkvWhvrFkZsXJV9E+BB4g0HW0duQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.30/go.mod h1:WueJeNDZvK1fMYEWJIkcivBfEzUkTpBhzlrUKKY8EuA=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.30 h1:jn46zC9LdsVR/ZpMIJqMqb8hHv31BlLx3ulVqNspUOk=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.30/go.mod h1:1hTMsAgbdS/AtUi4bw8+gUuh1pceo+eXRLfpSuSQj3M=
|
||||
github.com/aws/aws-sdk-go-v2/service/codecommit v1.35.0 h1:w/iPWj+VObIbyo1WYN5010Bi61OkkqOiFZpNDAP1Rfc=
|
||||
github.com/aws/aws-sdk-go-v2/service/codecommit v1.35.0/go.mod h1:uH156Pb0jnMXuCSD9irU0Qz6UNhYUF2qbowFqIwyLQ8=
|
||||
github.com/aws/aws-sdk-go-v2/service/codecommit v1.35.1 h1:mQBm+SScIS/K5OeGnBH8mGu4oAKneaa/nS9GpfQaIFM=
|
||||
github.com/aws/aws-sdk-go-v2/service/codecommit v1.35.1/go.mod h1:uH156Pb0jnMXuCSD9irU0Qz6UNhYUF2qbowFqIwyLQ8=
|
||||
github.com/aws/smithy-go v1.27.3 h1:F3Zb497UhhskkfpJmfkXswyo+t0sh9OTBnIHjogWbVY=
|
||||
github.com/aws/smithy-go v1.27.3/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
|
||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
||||
@@ -240,8 +240,8 @@ github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55k
|
||||
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8=
|
||||
github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/dlclark/regexp2/v2 v2.2.2 h1:MYWvNYw8okuqNhwTYO587EZMiDruVa2vhV6fsGpfya0=
|
||||
github.com/dlclark/regexp2/v2 v2.2.2/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU=
|
||||
github.com/dlclark/regexp2/v2 v2.5.0 h1:liNiWIPCvCh5HBcYfsjd+P16AG79fwd6T1Toy2gOtEA=
|
||||
github.com/dlclark/regexp2/v2 v2.5.0/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU=
|
||||
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4=
|
||||
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s=
|
||||
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
|
||||
@@ -274,8 +274,8 @@ github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx5
|
||||
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
|
||||
github.com/fxamacker/cbor/v2 v2.9.2 h1:X4Ksno9+x3cz0TZv69ec1hxP/+tymuR8PXQJyDwfh78=
|
||||
github.com/fxamacker/cbor/v2 v2.9.2/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||
github.com/getkin/kin-openapi v0.140.0 h1:JFn675aXRFjyiZKa/BFWploGldQlI0gobp4J5k0EZ2g=
|
||||
github.com/getkin/kin-openapi v0.140.0/go.mod h1:lISrB64F0CPcuDJ3LdtPTMJBY8VENjR9wJBdrcT6J3g=
|
||||
github.com/getkin/kin-openapi v0.142.0 h1:izj0vBdFprMhitfzaX8sTqztsEQyvwhssBoB6n8NO7w=
|
||||
github.com/getkin/kin-openapi v0.142.0/go.mod h1:3BH9M9XDe/y9M5DSvEocVYAYq1w0qrhJHjC/vZi0AaY=
|
||||
github.com/git-lfs/pktline v0.0.0-20230103162542-ca444d533ef1 h1:mtDjlmloH7ytdblogrMz1/8Hqua1y8B4ID+bh3rvod0=
|
||||
github.com/git-lfs/pktline v0.0.0-20230103162542-ca444d533ef1/go.mod h1:fenKRzpXDjNpsIBhuhUzvjCKlDjKam0boRAenTE0Q6A=
|
||||
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
|
||||
@@ -289,8 +289,8 @@ github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=
|
||||
github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
|
||||
github.com/go-chi/cors v1.2.2 h1:Jmey33TE+b+rB7fT8MUy1u0I4L+NARQlK6LhzKPSyQE=
|
||||
github.com/go-chi/cors v1.2.2/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
|
||||
github.com/go-co-op/gocron/v2 v2.21.2 h1:bD8/YwkojYHgXFr3iEulL148KBdTbKVxUZzFKpXcdbY=
|
||||
github.com/go-co-op/gocron/v2 v2.21.2/go.mod h1:5lEiCKk1oVJV39Zg7/YG10OnaVrDAV5GGR6O0663k6U=
|
||||
github.com/go-co-op/gocron/v2 v2.22.0 h1:uEuH2F7k7VoESb1BYSaffuuV+T0kkpzsC0aXk7/z79I=
|
||||
github.com/go-co-op/gocron/v2 v2.22.0/go.mod h1:hiH/U9RMhTi1BBZJmef9s3KC9QwhpBF6PFrvUKaXY9M=
|
||||
github.com/go-enry/go-enry/v2 v2.9.6 h1:np63eOtMV56zfYDHnFVgpEVOk8fr2kmylcMnAZUDbSs=
|
||||
github.com/go-enry/go-enry/v2 v2.9.6/go.mod h1:9yrj4ES1YrbNb1Wb7/PWYr2bpaCXUGRt0uafN0ISyG8=
|
||||
github.com/go-enry/go-oniguruma v1.2.1 h1:k8aAMuJfMrqm/56SG2lV9Cfti6tC4x8673aHCcBk+eo=
|
||||
@@ -390,8 +390,8 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
|
||||
github.com/google/licenseclassifier/v2 v2.0.0 h1:1Y57HHILNf4m0ABuMVb6xk4vAJYEUO0gDxNpog0pyeA=
|
||||
github.com/google/licenseclassifier/v2 v2.0.0/go.mod h1:cOjbdH0kyC9R22sdQbYsFkto4NGCAc+ZSwbeThazEtM=
|
||||
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
|
||||
github.com/google/pprof v0.0.0-20260604005048-7023385849c0 h1:h1QTMDl6q9wDvDCJVpKQSjgleGFYnd2fOxmg2K+6BGE=
|
||||
github.com/google/pprof v0.0.0-20260604005048-7023385849c0/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI=
|
||||
github.com/google/pprof v0.0.0-20260709232956-b9395ee17fa0 h1:du0WGc8xSKq/++e0cglxhS/mXVqsR7+c7jLEi5Vqduw=
|
||||
github.com/google/pprof v0.0.0-20260709232956-b9395ee17fa0/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
@@ -507,8 +507,8 @@ github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/a
|
||||
github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
|
||||
github.com/mattn/go-shellwords v1.0.13 h1:DC0OMEpGjm6LfNFU4ckYcvbQKyp2vE8atyFGXNtDcf4=
|
||||
github.com/mattn/go-shellwords v1.0.13/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.47 h1:jOBI62gS7nKeZv+as1oGEy0+1qISgXwH/QBlR6KbfIo=
|
||||
github.com/mattn/go-sqlite3 v1.14.47/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
|
||||
github.com/mattn/go-sqlite3 v1.14.48 h1:7XHIgl0a8HwOaiK4E47ozLkST78rR9+OtNGx27D/TFs=
|
||||
github.com/mattn/go-sqlite3 v1.14.48/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
|
||||
github.com/meilisearch/meilisearch-go v0.36.3 h1:Yx1aTY5jDgtbStPVkhJTDoLnZTy5sejQSPyjfNMy6e4=
|
||||
github.com/meilisearch/meilisearch-go v0.36.3/go.mod h1:hWcR0MuWLSzHfbz9GGzIr3s9rnXLm1jqkmHkJPbUSvM=
|
||||
github.com/mholt/acmez/v3 v3.1.6 h1:eGVQNObP0pBN4sxqrXeg7MYqTOWyoiYpQqITVWlrevk=
|
||||
@@ -556,10 +556,10 @@ github.com/nwaples/rardecode/v2 v2.2.3/go.mod h1:7uz379lSxPe6j9nvzxUZ+n7mnJNgjsR
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oasdiff/yaml v0.1.0 h1:0bqZjfKc/8S9urj4JuwepX41WX9EoA6ifhU3SV06cXg=
|
||||
github.com/oasdiff/yaml v0.1.0/go.mod h1:kOlRmMdL2X3vucLCEQO5u61SU22RysnfXvcttrZA1O0=
|
||||
github.com/oasdiff/yaml3 v0.0.13 h1:06svmvOHOVBqF81+sY2EUScvUI/iS/vl2VIeUUxZQwg=
|
||||
github.com/oasdiff/yaml3 v0.0.13/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o=
|
||||
github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY=
|
||||
github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU=
|
||||
github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw=
|
||||
github.com/oasdiff/yaml3 v0.0.14/go.mod h1:csto2xfDjYccdUn/yw/bPjj/cYTdp6HtFA0J4TWG+gg=
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 h1:zrbMGy9YXpIeTnGj4EljqMiZsIcE09mmF8XsD5AYOJc=
|
||||
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6/go.mod h1:rEKTHC9roVVicUIfZK7DYrdIoM0EOr8mK1Hj5s3JjH0=
|
||||
github.com/olekukonko/errors v1.3.0 h1:teJvgLGUEqMzBUms+Dj3/3szNqCG/Jdw9iDbum8fR6U=
|
||||
@@ -721,8 +721,8 @@ github.com/yohcop/openid-go v1.0.1/go.mod h1:b/AvD03P0KHj4yuihb+VtLD6bYYgsy0zqBz
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.4.15/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE=
|
||||
github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
|
||||
github.com/yuin/goldmark v1.8.4 h1:oat/nd3U6NeQqFEL3xpEJq7d7c86NI+DbSNGAs4xnjA=
|
||||
github.com/yuin/goldmark v1.8.4/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
|
||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc h1:+IAOyRda+RLrxa1WC7umKOZRsGq4QrFFMYApOeHzQwQ=
|
||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc/go.mod h1:ovIvrum6DQJA4QsJSovrkC4saKHQVs7TvcaeO8AIl5I=
|
||||
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
|
||||
@@ -733,8 +733,8 @@ github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo=
|
||||
github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
|
||||
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
||||
github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s=
|
||||
gitlab.com/gitlab-org/api/client-go/v2 v2.46.0 h1:t9QSeMck3kuHu9R6C7h8cYk4qBI4ZD4SQ0jspxKYs2E=
|
||||
gitlab.com/gitlab-org/api/client-go/v2 v2.46.0/go.mod h1:1LK5UOowqo9apkL+zn7sM8t/hCzBV6F1b2RUIHL9+Oo=
|
||||
gitlab.com/gitlab-org/api/client-go/v2 v2.48.1 h1:k5N2hjc67pMkq3h0K2HyVSb7PkMyUTlW5kHQLrK3aQY=
|
||||
gitlab.com/gitlab-org/api/client-go/v2 v2.48.1/go.mod h1:WEdEVDbr2ZtYfpw95r5XWZeGcr1mVsJZk57aeXWsSVU=
|
||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo=
|
||||
go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E=
|
||||
|
||||
@@ -18,10 +18,21 @@ import (
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
||||
// Migrations should never use model structs directly, because the model structs can be different in different releases.
|
||||
// e.g. if one migration uses "User" model, it works in the early releases, then one day,
|
||||
// when the User model changes, the migration breaks because it will use the new (incorrect) User model,
|
||||
// it should only use the old User model. The same to "modules/structs".
|
||||
// However, many the existing migrations already abuses "modules/structs" (search "gitea.dev/models/" in the migrations).
|
||||
// TODO: need to fully decouple the migration package and models & structs package
|
||||
type (
|
||||
EngineMigration = db.EngineMigration
|
||||
Session = db.Session
|
||||
)
|
||||
|
||||
// RecreateTables will recreate the tables for the provided beans using the newly provided bean definition and move all data to that new table
|
||||
// WARNING: YOU MUST PROVIDE THE FULL BEAN DEFINITION
|
||||
func RecreateTables(beans ...any) func(db.EngineMigration) error {
|
||||
return func(x db.EngineMigration) error {
|
||||
func RecreateTables(beans ...any) func(EngineMigration) error {
|
||||
return func(x EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err := sess.Begin(); err != nil {
|
||||
@@ -41,7 +52,7 @@ func RecreateTables(beans ...any) func(db.EngineMigration) error {
|
||||
// RecreateTable will recreate the table using the newly provided bean definition and move all data to that new table
|
||||
// WARNING: YOU MUST PROVIDE THE FULL BEAN DEFINITION
|
||||
// WARNING: YOU MUST COMMIT THE SESSION AT THE END
|
||||
func RecreateTable(sess db.Session, bean any) error {
|
||||
func RecreateTable(sess Session, bean any) error {
|
||||
// TODO: This will not work if there are foreign keys
|
||||
|
||||
tableName := sess.Engine().TableName(bean)
|
||||
@@ -304,7 +315,7 @@ func RecreateTable(sess db.Session, bean any) error {
|
||||
}
|
||||
|
||||
// WARNING: YOU MUST COMMIT THE SESSION AT THE END
|
||||
func DropTableColumns(sess db.Session, tableName string, columnNames ...string) (err error) {
|
||||
func DropTableColumns(sess Session, tableName string, columnNames ...string) (err error) {
|
||||
if tableName == "" || len(columnNames) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -474,7 +485,7 @@ func DropTableColumns(sess db.Session, tableName string, columnNames ...string)
|
||||
}
|
||||
|
||||
// ModifyColumn will modify column's type or other property. SQLITE is not supported
|
||||
func ModifyColumn(x db.EngineMigration, tableName string, col *schemas.Column) error {
|
||||
func ModifyColumn(x EngineMigration, tableName string, col *schemas.Column) error {
|
||||
var indexes map[string]*schemas.Index
|
||||
var err error
|
||||
// MSSQL have to remove index at first, otherwise alter column will fail
|
||||
@@ -1,12 +1,13 @@
|
||||
// Copyright 2022 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package base
|
||||
package base_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gitea.dev/models/migrations/migrationtest"
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/modelmigration/migrationtest"
|
||||
"gitea.dev/modules/timeutil"
|
||||
|
||||
"xorm.io/xorm/names"
|
||||
@@ -55,7 +56,7 @@ func Test_DropTableColumns(t *testing.T) {
|
||||
t.Errorf("unable to begin transaction: %v", err)
|
||||
return
|
||||
}
|
||||
if err := DropTableColumns(sess, "drop_test", columns[i:]...); err != nil {
|
||||
if err := base.DropTableColumns(sess, "drop_test", columns[i:]...); err != nil {
|
||||
sess.Close()
|
||||
t.Errorf("Unable to drop columns[%d:]: %s from drop_test: %v", i, columns[i:], err)
|
||||
return
|
||||
@@ -82,7 +83,7 @@ func Test_DropTableColumns(t *testing.T) {
|
||||
t.Errorf("unable to begin transaction: %v", err)
|
||||
return
|
||||
}
|
||||
if err := DropTableColumns(sess, "drop_test", dropcols...); err != nil {
|
||||
if err := base.DropTableColumns(sess, "drop_test", dropcols...); err != nil {
|
||||
sess.Close()
|
||||
t.Errorf("Unable to drop columns: %s from drop_test: %v", dropcols, err)
|
||||
return
|
||||
@@ -2,36 +2,36 @@
|
||||
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package migrations
|
||||
package modelmigration
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/v1_10"
|
||||
"gitea.dev/models/migrations/v1_11"
|
||||
"gitea.dev/models/migrations/v1_12"
|
||||
"gitea.dev/models/migrations/v1_13"
|
||||
"gitea.dev/models/migrations/v1_14"
|
||||
"gitea.dev/models/migrations/v1_15"
|
||||
"gitea.dev/models/migrations/v1_16"
|
||||
"gitea.dev/models/migrations/v1_17"
|
||||
"gitea.dev/models/migrations/v1_18"
|
||||
"gitea.dev/models/migrations/v1_19"
|
||||
"gitea.dev/models/migrations/v1_20"
|
||||
"gitea.dev/models/migrations/v1_21"
|
||||
"gitea.dev/models/migrations/v1_22"
|
||||
"gitea.dev/models/migrations/v1_23"
|
||||
"gitea.dev/models/migrations/v1_24"
|
||||
"gitea.dev/models/migrations/v1_25"
|
||||
"gitea.dev/models/migrations/v1_26"
|
||||
"gitea.dev/models/migrations/v1_27"
|
||||
"gitea.dev/models/migrations/v1_6"
|
||||
"gitea.dev/models/migrations/v1_7"
|
||||
"gitea.dev/models/migrations/v1_8"
|
||||
"gitea.dev/models/migrations/v1_9"
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/modelmigration/v1_10"
|
||||
"gitea.dev/modelmigration/v1_11"
|
||||
"gitea.dev/modelmigration/v1_12"
|
||||
"gitea.dev/modelmigration/v1_13"
|
||||
"gitea.dev/modelmigration/v1_14"
|
||||
"gitea.dev/modelmigration/v1_15"
|
||||
"gitea.dev/modelmigration/v1_16"
|
||||
"gitea.dev/modelmigration/v1_17"
|
||||
"gitea.dev/modelmigration/v1_18"
|
||||
"gitea.dev/modelmigration/v1_19"
|
||||
"gitea.dev/modelmigration/v1_20"
|
||||
"gitea.dev/modelmigration/v1_21"
|
||||
"gitea.dev/modelmigration/v1_22"
|
||||
"gitea.dev/modelmigration/v1_23"
|
||||
"gitea.dev/modelmigration/v1_24"
|
||||
"gitea.dev/modelmigration/v1_25"
|
||||
"gitea.dev/modelmigration/v1_26"
|
||||
"gitea.dev/modelmigration/v1_27"
|
||||
"gitea.dev/modelmigration/v1_6"
|
||||
"gitea.dev/modelmigration/v1_7"
|
||||
"gitea.dev/modelmigration/v1_8"
|
||||
"gitea.dev/modelmigration/v1_9"
|
||||
"gitea.dev/modules/git"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/setting"
|
||||
@@ -44,23 +44,23 @@ const minDBVersion = 70 // Gitea 1.5.3
|
||||
type migration struct {
|
||||
idNumber int64 // DB version is "the last migration's idNumber" + 1
|
||||
description string
|
||||
migrate func(context.Context, db.EngineMigration) error
|
||||
migrate func(context.Context, base.EngineMigration) error
|
||||
}
|
||||
|
||||
// newMigration creates a new migration
|
||||
func newMigration[T func(db.EngineMigration) error | func(context.Context, db.EngineMigration) error](idNumber int64, desc string, fn T) *migration {
|
||||
func newMigration[T func(base.EngineMigration) error | func(context.Context, base.EngineMigration) error](idNumber int64, desc string, fn T) *migration {
|
||||
m := &migration{idNumber: idNumber, description: desc}
|
||||
var ok bool
|
||||
if m.migrate, ok = any(fn).(func(context.Context, db.EngineMigration) error); !ok {
|
||||
m.migrate = func(ctx context.Context, x db.EngineMigration) error {
|
||||
return any(fn).(func(db.EngineMigration) error)(x)
|
||||
if m.migrate, ok = any(fn).(func(context.Context, base.EngineMigration) error); !ok {
|
||||
m.migrate = func(ctx context.Context, x base.EngineMigration) error {
|
||||
return any(fn).(func(base.EngineMigration) error)(x)
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
// Migrate executes the migration
|
||||
func (m *migration) Migrate(ctx context.Context, x db.EngineMigration) error {
|
||||
func (m *migration) Migrate(ctx context.Context, x base.EngineMigration) error {
|
||||
return m.migrate(ctx, x)
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ type Version struct {
|
||||
}
|
||||
|
||||
// Use noopMigration when there is a migration that has been no-oped
|
||||
var noopMigration = func(_ db.EngineMigration) error { return nil }
|
||||
var noopMigration = func(_ base.EngineMigration) error { return nil }
|
||||
|
||||
var preparedMigrations []*migration
|
||||
|
||||
@@ -420,12 +420,13 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(340, "Add ContinueOnError column to ActionRunJob", v1_27.AddContinueOnErrorToActionRunJob),
|
||||
newMigration(341, "Convert legacy MSSQL DATETIME columns to DATETIME2", v1_27.FixLegacyMSSQLDateTimeColumns),
|
||||
newMigration(342, "Add scoped workflows schema", v1_27.AddScopedWorkflowsSchema),
|
||||
// Gitea 1.27.0 ends at migration ID number 342 (database version 343)
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
||||
// GetCurrentDBVersion returns the current db version
|
||||
func GetCurrentDBVersion(x db.EngineMigration) (int64, error) {
|
||||
func GetCurrentDBVersion(x base.EngineMigration) (int64, error) {
|
||||
if err := x.Sync(new(Version)); err != nil {
|
||||
return -1, fmt.Errorf("sync: %w", err)
|
||||
}
|
||||
@@ -458,7 +459,7 @@ func ExpectedDBVersion() int64 {
|
||||
}
|
||||
|
||||
// EnsureUpToDate will check if the db is at the correct version
|
||||
func EnsureUpToDate(ctx context.Context, x db.EngineMigration) error {
|
||||
func EnsureUpToDate(ctx context.Context, x base.EngineMigration) error {
|
||||
currentDB, err := GetCurrentDBVersion(x)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -490,7 +491,7 @@ func migrationIDNumberToDBVersion(idNumber int64) int64 {
|
||||
}
|
||||
|
||||
// Migrate database to current version
|
||||
func Migrate(ctx context.Context, x db.EngineMigration) error {
|
||||
func Migrate(ctx context.Context, x base.EngineMigration) error {
|
||||
migrations := prepareMigrationTasks()
|
||||
maxDBVer := calcDBVersion(migrations)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package migrations
|
||||
package modelmigration
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/unittest"
|
||||
"gitea.dev/modules/git"
|
||||
@@ -22,8 +23,8 @@ import (
|
||||
// PrepareTestEnv prepares the test environment and reset the database. The skip parameter should usually be 0.
|
||||
// Provide models to be sync'd with the database - in particular any models you expect fixtures to be loaded from.
|
||||
//
|
||||
// fixtures in `models/migrations/fixtures/<TestName>` will be loaded automatically
|
||||
func PrepareTestEnv(t *testing.T, skip int, syncModels ...any) (db.EngineMigration, func()) {
|
||||
// fixtures in `modelmigration/fixtures/<TestName>` will be loaded automatically
|
||||
func PrepareTestEnv(t *testing.T, skip int, syncModels ...any) (base.EngineMigration, func()) {
|
||||
t.Helper()
|
||||
ourSkip := 2
|
||||
ourSkip += skip
|
||||
@@ -64,7 +65,7 @@ func PrepareTestEnv(t *testing.T, skip int, syncModels ...any) (db.EngineMigrati
|
||||
}
|
||||
}
|
||||
|
||||
fixturesDir := filepath.Join(giteaRoot, "models", "migrations", "fixtures", t.Name())
|
||||
fixturesDir := filepath.Join(giteaRoot, "modelmigration/fixtures", t.Name())
|
||||
|
||||
if _, err := os.Stat(fixturesDir); err == nil {
|
||||
t.Logf("initializing fixtures from: %s", fixturesDir)
|
||||
@@ -88,7 +89,7 @@ func PrepareTestEnv(t *testing.T, skip int, syncModels ...any) (db.EngineMigrati
|
||||
return x, deferFn
|
||||
}
|
||||
|
||||
func LoadTableSchemasMap(t *testing.T, x db.EngineMigration) map[string]*schemas.Table {
|
||||
func LoadTableSchemasMap(t *testing.T, x base.EngineMigration) map[string]*schemas.Table {
|
||||
tables, err := x.DBMetas()
|
||||
require.NoError(t, err)
|
||||
tableMap := make(map[string]*schemas.Table)
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func UpdateMigrationServiceTypes(x db.EngineMigration) error {
|
||||
func UpdateMigrationServiceTypes(x base.EngineMigration) error {
|
||||
type Repository struct {
|
||||
ID int64
|
||||
OriginalServiceType int `xorm:"index default(0)"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func ChangeSomeColumnsLengthOfExternalLoginUser(x db.EngineMigration) error {
|
||||
func ChangeSomeColumnsLengthOfExternalLoginUser(x base.EngineMigration) error {
|
||||
type ExternalLoginUser struct {
|
||||
AccessToken string `xorm:"TEXT"`
|
||||
AccessTokenSecret string `xorm:"TEXT"`
|
||||
@@ -7,14 +7,14 @@ import (
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func hashContext(context string) string {
|
||||
return fmt.Sprintf("%x", sha1.Sum([]byte(context)))
|
||||
}
|
||||
|
||||
func AddCommitStatusContext(x db.EngineMigration) error {
|
||||
func AddCommitStatusContext(x base.EngineMigration) error {
|
||||
type CommitStatus struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
ContextHash string `xorm:"char(40) index"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddOriginalMigrationInfo(x db.EngineMigration) error {
|
||||
func AddOriginalMigrationInfo(x base.EngineMigration) error {
|
||||
// Issue see models/issue.go
|
||||
type Issue struct {
|
||||
OriginalAuthor string
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func ChangeSomeColumnsLengthOfRepo(x db.EngineMigration) error {
|
||||
func ChangeSomeColumnsLengthOfRepo(x base.EngineMigration) error {
|
||||
type Repository struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Description string `xorm:"TEXT"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddIndexOnRepositoryAndComment(x db.EngineMigration) error {
|
||||
func AddIndexOnRepositoryAndComment(x base.EngineMigration) error {
|
||||
type Repository struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
OwnerID int64 `xorm:"index"`
|
||||
@@ -4,12 +4,12 @@
|
||||
package v1_10
|
||||
|
||||
import (
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
func RemoveLingeringIndexStatus(x db.EngineMigration) error {
|
||||
func RemoveLingeringIndexStatus(x base.EngineMigration) error {
|
||||
_, err := x.Exec(builder.Delete(builder.NotIn("`repo_id`", builder.Select("`id`").From("`repository`"))).From("`repo_indexer_status`"))
|
||||
return err
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddEmailNotificationEnabledToUser(x db.EngineMigration) error {
|
||||
func AddEmailNotificationEnabledToUser(x base.EngineMigration) error {
|
||||
// User see models/user.go
|
||||
type User struct {
|
||||
EmailNotificationsPreference string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'enabled'"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddStatusCheckColumnsForProtectedBranches(x db.EngineMigration) error {
|
||||
func AddStatusCheckColumnsForProtectedBranches(x base.EngineMigration) error {
|
||||
type ProtectedBranch struct {
|
||||
EnableStatusCheck bool `xorm:"NOT NULL DEFAULT false"`
|
||||
StatusCheckContexts []string `xorm:"JSON TEXT"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddCrossReferenceColumns(x db.EngineMigration) error {
|
||||
func AddCrossReferenceColumns(x base.EngineMigration) error {
|
||||
// Comment see models/comment.go
|
||||
type Comment struct {
|
||||
RefRepoID int64 `xorm:"index"`
|
||||
@@ -6,12 +6,12 @@ package v1_10
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/modules/setting"
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
func DeleteOrphanedAttachments(x db.EngineMigration) error {
|
||||
func DeleteOrphanedAttachments(x base.EngineMigration) error {
|
||||
type Attachment struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UUID string `xorm:"uuid UNIQUE"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddRepoAdminChangeTeamAccessColumnForUser(x db.EngineMigration) error {
|
||||
func AddRepoAdminChangeTeamAccessColumnForUser(x base.EngineMigration) error {
|
||||
type User struct {
|
||||
RepoAdminChangeTeamAccess bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_10
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddOriginalAuthorOnMigratedReleases(x db.EngineMigration) error {
|
||||
func AddOriginalAuthorOnMigratedReleases(x base.EngineMigration) error {
|
||||
type Release struct {
|
||||
ID int64
|
||||
OriginalAuthor string
|
||||
@@ -4,11 +4,11 @@
|
||||
package v1_10
|
||||
|
||||
import (
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/modules/timeutil"
|
||||
)
|
||||
|
||||
func AddTaskTable(x db.EngineMigration) error {
|
||||
func AddTaskTable(x base.EngineMigration) error {
|
||||
// TaskType defines task type
|
||||
type TaskType int
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func DropColumnHeadUserNameOnPullRequest(x db.EngineMigration) error {
|
||||
func DropColumnHeadUserNameOnPullRequest(x base.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err := sess.Begin(); err != nil {
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddWhitelistDeployKeysToBranches(x db.EngineMigration) error {
|
||||
func AddWhitelistDeployKeysToBranches(x base.EngineMigration) error {
|
||||
type ProtectedBranch struct {
|
||||
ID int64
|
||||
WhitelistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
|
||||
@@ -4,11 +4,10 @@
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/models/migrations/base"
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func RemoveLabelUneededCols(x db.EngineMigration) error {
|
||||
func RemoveLabelUneededCols(x base.EngineMigration) error {
|
||||
// Make sure the columns exist before dropping them
|
||||
type Label struct {
|
||||
QueryString string
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddTeamIncludesAllRepositories(x db.EngineMigration) error {
|
||||
func AddTeamIncludesAllRepositories(x base.EngineMigration) error {
|
||||
type Team struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
IncludesAllRepositories bool `xorm:"NOT NULL DEFAULT false"`
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
// RepoWatchMode specifies what kind of watch the user has on a repository
|
||||
type RepoWatchMode int8
|
||||
@@ -14,7 +14,7 @@ type Watch struct {
|
||||
Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"`
|
||||
}
|
||||
|
||||
func AddModeColumnToWatch(x db.EngineMigration) error {
|
||||
func AddModeColumnToWatch(x base.EngineMigration) error {
|
||||
if err := x.Sync(new(Watch)); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddTemplateToRepo(x db.EngineMigration) error {
|
||||
func AddTemplateToRepo(x base.EngineMigration) error {
|
||||
type Repository struct {
|
||||
IsTemplate bool `xorm:"INDEX NOT NULL DEFAULT false"`
|
||||
TemplateID int64 `xorm:"INDEX"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddCommentIDOnNotification(x db.EngineMigration) error {
|
||||
func AddCommentIDOnNotification(x base.EngineMigration) error {
|
||||
type Notification struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CommentID int64
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddCanCreateOrgRepoColumnForTeam(x db.EngineMigration) error {
|
||||
func AddCanCreateOrgRepoColumnForTeam(x base.EngineMigration) error {
|
||||
type Team struct {
|
||||
CanCreateOrgRepo bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
@@ -4,12 +4,12 @@
|
||||
package v1_11
|
||||
|
||||
import (
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
||||
func ChangeReviewContentToText(x db.EngineMigration) error {
|
||||
func ChangeReviewContentToText(x base.EngineMigration) error {
|
||||
switch x.Dialect().URI().DBType {
|
||||
case schemas.MYSQL:
|
||||
_, err := x.Exec("ALTER TABLE review MODIFY COLUMN content TEXT")
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"fmt"
|
||||
"slices"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func AddBranchProtectionCanPushAndEnableWhitelist(x db.EngineMigration) error {
|
||||
func AddBranchProtectionCanPushAndEnableWhitelist(x base.EngineMigration) error {
|
||||
type ProtectedBranch struct {
|
||||
CanPush bool `xorm:"NOT NULL DEFAULT false"`
|
||||
EnableApprovalsWhitelist bool `xorm:"NOT NULL DEFAULT false"`
|
||||
@@ -132,7 +132,7 @@ func AddBranchProtectionCanPushAndEnableWhitelist(x db.EngineMigration) error {
|
||||
}
|
||||
|
||||
// getUserRepoPermission static function based on issues_model.IsOfficialReviewer at 5d78792385
|
||||
getUserRepoPermission := func(sess db.Session, repo *Repository, user *User) (Permission, error) {
|
||||
getUserRepoPermission := func(sess base.Session, repo *Repository, user *User) (Permission, error) {
|
||||
var perm Permission
|
||||
|
||||
repoOwner := new(User)
|
||||
@@ -305,7 +305,7 @@ func AddBranchProtectionCanPushAndEnableWhitelist(x db.EngineMigration) error {
|
||||
}
|
||||
|
||||
// isOfficialReviewer static function based on 5d78792385
|
||||
isOfficialReviewer := func(sess db.Session, issueID int64, reviewer *User) (bool, error) {
|
||||
isOfficialReviewer := func(sess base.Session, issueID int64, reviewer *User) (bool, error) {
|
||||
pr := new(PullRequest)
|
||||
has, err := sess.ID(issueID).Get(pr)
|
||||
if err != nil {
|
||||
@@ -6,7 +6,7 @@ package v1_11
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/setting"
|
||||
"gitea.dev/modules/util"
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
func RemoveAttachmentMissedRepo(x db.EngineMigration) error {
|
||||
func RemoveAttachmentMissedRepo(x base.EngineMigration) error {
|
||||
type Attachment struct {
|
||||
UUID string `xorm:"uuid"`
|
||||
}
|
||||
@@ -6,10 +6,10 @@ package v1_11
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func FeatureChangeTargetBranch(x db.EngineMigration) error {
|
||||
func FeatureChangeTargetBranch(x base.EngineMigration) error {
|
||||
type Comment struct {
|
||||
OldRef string
|
||||
NewRef string
|
||||
@@ -6,10 +6,10 @@ package v1_11
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func SanitizeOriginalURL(x db.EngineMigration) error {
|
||||
func SanitizeOriginalURL(x base.EngineMigration) error {
|
||||
type Repository struct {
|
||||
ID int64
|
||||
OriginalURL string `xorm:"VARCHAR(2048)"`
|
||||
@@ -12,14 +12,14 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"gitea.dev/models/db"
|
||||
"gitea.dev/modelmigration/base"
|
||||
"gitea.dev/modules/container"
|
||||
"gitea.dev/modules/log"
|
||||
"gitea.dev/modules/setting"
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
func RenameExistingUserAvatarName(x db.EngineMigration) error {
|
||||
func RenameExistingUserAvatarName(x base.EngineMigration) error {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_11
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func ExtendTrackedTimes(x db.EngineMigration) error {
|
||||
func ExtendTrackedTimes(x base.EngineMigration) error {
|
||||
type TrackedTime struct {
|
||||
Time int64 `xorm:"NOT NULL"`
|
||||
Deleted bool `xorm:"NOT NULL DEFAULT false"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_12
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddBlockOnRejectedReviews(x db.EngineMigration) error {
|
||||
func AddBlockOnRejectedReviews(x base.EngineMigration) error {
|
||||
type ProtectedBranch struct {
|
||||
BlockOnRejectedReviews bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_12
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddReviewCommitAndStale(x db.EngineMigration) error {
|
||||
func AddReviewCommitAndStale(x base.EngineMigration) error {
|
||||
type Review struct {
|
||||
CommitID string `xorm:"VARCHAR(40)"`
|
||||
Stale bool `xorm:"NOT NULL DEFAULT false"`
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_12
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func FixMigratedRepositoryServiceType(x db.EngineMigration) error {
|
||||
func FixMigratedRepositoryServiceType(x base.EngineMigration) error {
|
||||
// structs.GithubService:
|
||||
// GithubService = 2
|
||||
_, err := x.Exec("UPDATE repository SET original_service_type = ? WHERE original_url LIKE 'https://github.com/%'", 2)
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_12
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddOwnerNameOnRepository(x db.EngineMigration) error {
|
||||
func AddOwnerNameOnRepository(x base.EngineMigration) error {
|
||||
type Repository struct {
|
||||
OwnerName string
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
package v1_12
|
||||
|
||||
import "gitea.dev/models/db"
|
||||
import "gitea.dev/modelmigration/base"
|
||||
|
||||
func AddIsRestricted(x db.EngineMigration) error {
|
||||
func AddIsRestricted(x base.EngineMigration) error {
|
||||
// User see models/user.go
|
||||
type User struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user