diff --git a/.air.toml b/.air.toml index de97bd8b29..af182697fb 100644 --- a/.air.toml +++ b/.air.toml @@ -2,9 +2,10 @@ root = "." tmp_dir = ".air" [build] +pre_cmd = ["killall -9 gitea 2>/dev/null || true"] # kill off potential zombie processes from previous runs cmd = "make --no-print-directory backend" bin = "gitea" -delay = 1000 +delay = 2000 include_ext = ["go", "tmpl"] include_file = ["main.go"] include_dir = ["cmd", "models", "modules", "options", "routers", "services"] @@ -15,8 +16,14 @@ exclude_dir = [ "modules/avatar/testdata", "modules/git/tests", "modules/migration/file_format_testdata", + "modules/markup/tests/repo/repo1_filepreview", "routers/private/tests", "services/gitdiff/testdata", + "services/migrations/testdata", + "services/webhook/sourcehut/testdata", ] exclude_regex = ["_test.go$", "_gen.go$"] stop_on_error = true + +[log] +main_only = true diff --git a/.changelog.yml b/.changelog.yml deleted file mode 100644 index bfdee0c0ca..0000000000 --- a/.changelog.yml +++ /dev/null @@ -1,57 +0,0 @@ -# The full repository name -repo: go-gitea/gitea - -# Service type (gitea or github) -service: github - -# Base URL for Gitea instance if using gitea service type (optional) -# Default: https://gitea.com -base-url: - -# Changelog groups and which labeled PRs to add to each group -groups: - - - name: BREAKING - labels: - - pr/breaking - - - name: SECURITY - labels: - - topic/security - - - name: FEATURES - labels: - - type/feature - - - name: API - labels: - - modifies/api - - - name: ENHANCEMENTS - labels: - - type/enhancement - - type/refactoring - - topic/ui - - - name: BUGFIXES - labels: - - type/bug - - - name: TESTING - labels: - - type/testing - - - name: BUILD - labels: - - topic/build - - topic/code-linting - - - name: DOCS - labels: - - type/docs - - - name: MISC - default: true - -# regex indicating which labels to skip for the changelog -skip-labels: skip-changelog|backport\/.+ diff --git a/.deadcode-out b/.deadcode-out index c63fd9e0af..f9bee43043 100644 --- a/.deadcode-out +++ b/.deadcode-out @@ -1,345 +1,262 @@ -package "code.gitea.io/gitea/cmd" - func NoMainListener +forgejo.org/cmd + NoMainListener -package "code.gitea.io/gitea/cmd/forgejo" - func ContextSetNoInit - func ContextSetNoExit - func ContextSetStderr - func ContextGetStderr - func ContextSetStdout - func ContextSetStdin +forgejo.org/cmd/forgejo + ContextSetNoInit + ContextSetNoExit + ContextSetStderr + ContextGetStderr + ContextSetStdout + ContextSetStdin -package "code.gitea.io/gitea/models" - func IsErrUpdateTaskNotExist - func (ErrUpdateTaskNotExist).Error - func (ErrUpdateTaskNotExist).Unwrap - func IsErrSHANotFound - func IsErrMergeDivergingFastForwardOnly - func GetYamlFixturesAccess +forgejo.org/models + IsErrSHANotFound + IsErrMergeDivergingFastForwardOnly -package "code.gitea.io/gitea/models/actions" - func (ScheduleList).GetUserIDs - func (ScheduleList).GetRepoIDs - func (ScheduleList).LoadTriggerUser - func (ScheduleList).LoadRepos - func GetVariableByID +forgejo.org/models/activities + GetActivityByID + NewFederatedUserActivity + CreateUserActivity + GetFollowingFeeds + FederatedUserActivity.loadActor -package "code.gitea.io/gitea/models/asymkey" - func (ErrGPGKeyAccessDenied).Error - func (ErrGPGKeyAccessDenied).Unwrap - func HasDeployKey +forgejo.org/models/auth + WebAuthnCredentials -package "code.gitea.io/gitea/models/auth" - func GetSourceByName - func GetWebAuthnCredentialByID - func WebAuthnCredentials +forgejo.org/models/db + TruncateBeans + InTransaction + DumpTables + GetTableNames -package "code.gitea.io/gitea/models/db" - func TruncateBeans - func InTransaction - func DumpTables +forgejo.org/models/dbfs + file.renameTo + Create + Rename -package "code.gitea.io/gitea/models/dbfs" - func (*file).renameTo - func Create - func Rename +forgejo.org/models/forgejo/semver + GetVersion + SetVersionString + SetVersion -package "code.gitea.io/gitea/models/forgejo/semver" - func GetVersion - func SetVersionString - func SetVersion +forgejo.org/models/git + RemoveDeletedBranchByID -package "code.gitea.io/gitea/models/git" - func RemoveDeletedBranchByID +forgejo.org/models/issues + IsErrUnknownDependencyType + IsErrIssueWasClosed -package "code.gitea.io/gitea/models/issues" - func IsErrUnknownDependencyType - func (ErrNewIssueInsert).Error - func IsErrIssueWasClosed - func ChangeMilestoneStatus +forgejo.org/models/organization + SearchMembersOptions.ToConds -package "code.gitea.io/gitea/models/migrations/base" - func removeAllWithRetry - func newXORMEngine - func deleteDB - func PrepareTestEnv - func MainTest +forgejo.org/models/perm/access + GetRepoWriters -package "code.gitea.io/gitea/models/organization" - func UpdateTeamUnits - func (SearchMembersOptions).ToConds - func UsersInTeamsCount +forgejo.org/models/repo + WatchRepoMode -package "code.gitea.io/gitea/models/perm/access" - func GetRepoWriters +forgejo.org/models/user + IsErrExternalLoginUserAlreadyExist + IsErrExternalLoginUserNotExist + NewFederatedUser + NewFederatedUserFollower + IsErrUserSettingIsNotExist + GetUserAllSettings + DeleteUserSetting + GetFederatedUser + GetFederatedUserByUserID + GetFollowersForUser + AddFollower + RemoveFollower + IsFollowingAp -package "code.gitea.io/gitea/models/project" - func UpdateBoardSorting - func ChangeProjectStatus +forgejo.org/modules/activitypub + NewContext + Context.APClientFactory -package "code.gitea.io/gitea/models/repo" - func DeleteAttachmentsByIssue - func (*releaseSorter).Len - func (*releaseSorter).Less - func (*releaseSorter).Swap - func SortReleases - func FindReposMapByIDs - func (SearchOrderBy).String - func IsErrTopicNotExist - func (ErrTopicNotExist).Error - func (ErrTopicNotExist).Unwrap - func GetTopicByName - func WatchRepoMode +forgejo.org/modules/assetfs + Bindata -package "code.gitea.io/gitea/models/unittest" - func CheckConsistencyFor - func checkForConsistency - func GetXORMEngine - func OverrideFixtures - func InitFixtures - func LoadFixtures - func Copy - func CopyDir - func NewMockWebServer - func NormalizedFullPath - func FixturesDir - func fatalTestError - func InitSettings - func MainTest - func CreateTestEngine - func PrepareTestDatabase - func PrepareTestEnv - func Cond - func OrderBy - func LoadBeanIfExists - func BeanExists - func AssertExistsAndLoadBean - func GetCount - func AssertNotExistsBean - func AssertExistsIf - func AssertSuccessfulInsert - func AssertCount - func AssertInt64InRange +forgejo.org/modules/auth/password/hash + DummyHasher.HashWithSaltBytes + NewDummyHasher -package "code.gitea.io/gitea/models/user" - func IsErrPrimaryEmailCannotDelete - func (ErrUserInactive).Error - func (ErrUserInactive).Unwrap - func IsErrExternalLoginUserAlreadyExist - func IsErrExternalLoginUserNotExist - func IsErrUserSettingIsNotExist - func GetUserAllSettings - func DeleteUserSetting - func GetUserEmailsByNames +forgejo.org/modules/auth/password/pwn + WithHTTP -package "code.gitea.io/gitea/modules/activitypub" - func CurrentTime - func containsRequiredHTTPHeaders - func NewClient - func (*Client).NewRequest - func (*Client).Post - func GetPrivateKey +forgejo.org/modules/base + SetupGiteaRoot -package "code.gitea.io/gitea/modules/assetfs" - func Bindata +forgejo.org/modules/cache + GetInt + WithNoCacheContext + RemoveContextData -package "code.gitea.io/gitea/modules/auth/password/hash" - func (*DummyHasher).HashWithSaltBytes - func NewDummyHasher +forgejo.org/modules/emoji + ReplaceCodes -package "code.gitea.io/gitea/modules/auth/password/pwn" - func WithHTTP +forgejo.org/modules/eventsource + Event.String -package "code.gitea.io/gitea/modules/base" - func SetupGiteaRoot +forgejo.org/modules/forgefed + NewForgeFollowFromAp + NewForgeFollow + ForgeFollow.MarshalJSON + ForgeFollow.UnmarshalJSON + ForgeFollow.Validate + NewForgeUndoLike + ForgeUndoLike.UnmarshalJSON + ForgeUndoLike.Validate + NewForgeUserActivityFromAp + NewForgeUserActivity + ForgeUserActivity.Validate + NewPersonIDFromModel + GetItemByType + JSONUnmarshalerFn + NotEmpty + NewForgeUserActivityNoteFromAp + newNote + ForgeUserActivityNote.Validate + ToRepository + OnRepository -package "code.gitea.io/gitea/modules/cache" - func GetInt - func WithNoCacheContext - func RemoveContextData +forgejo.org/modules/git + AllowLFSFiltersArgs + AddChanges + AddChangesWithArgs + CommitChanges + CommitChangesWithArgs + SetUpdateHook + openRepositoryWithDefaultContext + ToEntryMode -package "code.gitea.io/gitea/modules/charset" - func (*BreakWriter).Write +forgejo.org/modules/gitrepo + GetBranchCommitID + GetWikiDefaultBranch -package "code.gitea.io/gitea/modules/emoji" - func ReplaceCodes +forgejo.org/modules/graceful + Manager.TerminateContext + Manager.Err + Manager.Value + Manager.Deadline -package "code.gitea.io/gitea/modules/eventsource" - func (*Event).String +forgejo.org/modules/hcaptcha + WithHTTP -package "code.gitea.io/gitea/modules/git" - func AllowLFSFiltersArgs - func AddChanges - func AddChangesWithArgs - func CommitChanges - func CommitChangesWithArgs - func IsErrExecTimeout - func (ErrExecTimeout).Error - func (ErrUnsupportedVersion).Error - func SetUpdateHook - func GetObjectFormatOfRepo - func openRepositoryWithDefaultContext - func IsTagExist - func ToEntryMode - func (*LimitedReaderCloser).Read - func (*LimitedReaderCloser).Close +forgejo.org/modules/hostmatcher + HostMatchList.AppendPattern -package "code.gitea.io/gitea/modules/gitgraph" - func (*Parser).Reset +forgejo.org/modules/json + StdJSON.Marshal + StdJSON.Unmarshal + StdJSON.NewEncoder + StdJSON.NewDecoder + StdJSON.Indent -package "code.gitea.io/gitea/modules/gitrepo" - func GetBranchCommitID - func GetWikiDefaultBranch +forgejo.org/modules/log + NewEventWriterBuffer -package "code.gitea.io/gitea/modules/graceful" - func (*Manager).TerminateContext - func (*Manager).Err - func (*Manager).Value - func (*Manager).Deadline +forgejo.org/modules/markup + GetRendererByType + RenderString + IsMarkupFile -package "code.gitea.io/gitea/modules/hcaptcha" - func WithHTTP +forgejo.org/modules/markup/console + Render + RenderString -package "code.gitea.io/gitea/modules/json" - func (StdJSON).Marshal - func (StdJSON).Unmarshal - func (StdJSON).NewEncoder - func (StdJSON).NewDecoder - func (StdJSON).Indent +forgejo.org/modules/markup/markdown + RenderRawString -package "code.gitea.io/gitea/modules/markup" - func IsSameDomain - func GetRendererByType - func RenderString - func IsMarkupFile +forgejo.org/modules/markup/mdstripper + stripRenderer.AddOptions + StripMarkdown -package "code.gitea.io/gitea/modules/markup/console" - func Render - func RenderString +forgejo.org/modules/markup/orgmode + RenderString -package "code.gitea.io/gitea/modules/markup/markdown" - func IsDetails - func IsSummary - func IsTaskCheckBoxListItem - func IsIcon - func RenderRawString +forgejo.org/modules/process + Manager.ExecTimeout -package "code.gitea.io/gitea/modules/markup/markdown/math" - func WithInlineDollarParser - func WithBlockDollarParser +forgejo.org/modules/queue + newBaseChannelSimple + newBaseChannelUnique + newBaseRedisSimple + newBaseRedisUnique + testStateRecorder.Records + testStateRecorder.Reset + newWorkerPoolQueueForTest -package "code.gitea.io/gitea/modules/markup/mdstripper" - func StripMarkdown +forgejo.org/modules/queue/lqinternal + QueueItemIDBytes + QueueItemKeyBytes + ListLevelQueueKeys -package "code.gitea.io/gitea/modules/markup/orgmode" - func RenderString +forgejo.org/modules/setting + NewConfigProviderFromData + GitConfigType.GetOption + InitLoggersForTest -package "code.gitea.io/gitea/modules/private" - func ActionsRunnerRegister +forgejo.org/modules/sync + StatusTable.Start + StatusTable.IsRunning -package "code.gitea.io/gitea/modules/process" - func (*Manager).ExecTimeout +forgejo.org/modules/timeutil + GetExecutableModTime + MockSet + MockUnset -package "code.gitea.io/gitea/modules/queue" - func newBaseChannelSimple - func newBaseChannelUnique - func newBaseRedisSimple - func newBaseRedisUnique - func newWorkerPoolQueueForTest +forgejo.org/modules/translation + MockLocale.Language + MockLocale.TrString + MockLocale.Tr + MockLocale.TrN + MockLocale.TrPluralString + MockLocale.TrPluralStringAllForms + MockLocale.TrSize + MockLocale.HasKey + MockLocale.PrettyNumber -package "code.gitea.io/gitea/modules/queue/lqinternal" - func QueueItemIDBytes - func QueueItemKeyBytes - func ListLevelQueueKeys +forgejo.org/modules/translation/localeiter + IterateMessagesContent -package "code.gitea.io/gitea/modules/setting" - func NewConfigProviderFromData - func (*GitConfigType).GetOption - func InitLoggersForTest +forgejo.org/modules/util + OptionalArg -package "code.gitea.io/gitea/modules/storage" - func (ErrInvalidConfiguration).Error - func IsErrInvalidConfiguration +forgejo.org/modules/util/filebuffer + CreateFromReader -package "code.gitea.io/gitea/modules/structs" - func ParseCreateHook - func ParsePushHook +forgejo.org/modules/validation + IsErrNotValid + ValidateIDExists -package "code.gitea.io/gitea/modules/sync" - func (*StatusTable).Start - func (*StatusTable).IsRunning +forgejo.org/modules/web + RouteMock + RouteMockReset -package "code.gitea.io/gitea/modules/testlogger" - func (*testLoggerWriterCloser).pushT - func (*testLoggerWriterCloser).Log - func (*testLoggerWriterCloser).recordError - func (*testLoggerWriterCloser).printMsg - func (*testLoggerWriterCloser).popT - func (*testLoggerWriterCloser).Reset - func PrintCurrentTest - func Printf - func NewTestLoggerWriter - func (*TestLogEventWriter).Base - func (*TestLogEventWriter).GetLevel - func (*TestLogEventWriter).GetWriterName - func (*TestLogEventWriter).GetWriterType - func (*TestLogEventWriter).Run +forgejo.org/modules/zstd + NewWriter + Writer.Write + Writer.Close -package "code.gitea.io/gitea/modules/timeutil" - func GetExecutableModTime - func MockSet - func MockUnset +forgejo.org/routers/web/org + MustEnableProjects -package "code.gitea.io/gitea/modules/translation" - func (MockLocale).Language - func (MockLocale).TrString - func (MockLocale).Tr - func (MockLocale).TrN - func (MockLocale).PrettyNumber +forgejo.org/services/context + GetPrivateContext -package "code.gitea.io/gitea/modules/util/filebuffer" - func CreateFromReader +forgejo.org/services/federation + Init -package "code.gitea.io/gitea/modules/web" - func RouteMock - func RouteMockReset +forgejo.org/services/repository + IsErrForkAlreadyExist -package "code.gitea.io/gitea/modules/web/middleware" - func DeleteLocaleCookie +forgejo.org/services/repository/files + ContentType.String -package "code.gitea.io/gitea/routers/web" - func NotFound +forgejo.org/services/repository/gitgraph + Parser.Reset -package "code.gitea.io/gitea/routers/web/org" - func MustEnableProjects - func getActionIssues - func UpdateIssueProject - -package "code.gitea.io/gitea/services/context" - func GetPrivateContext - -package "code.gitea.io/gitea/services/convert" - func ToSecret - -package "code.gitea.io/gitea/services/forms" - func (*DeadlineForm).Validate - -package "code.gitea.io/gitea/services/pull" - func IsCommitStatusContextSuccess - -package "code.gitea.io/gitea/services/repository" - func IsErrForkAlreadyExist - -package "code.gitea.io/gitea/services/repository/archiver" - func ArchiveRepository - -package "code.gitea.io/gitea/services/repository/files" - func (*ContentType).String - func GetFileResponseFromCommit - func (*TemporaryUploadRepository).GetLastCommit - func (*TemporaryUploadRepository).GetLastCommitByRef - -package "code.gitea.io/gitea/services/webhook" - func NewNotifier - func List +forgejo.org/services/webhook + NewNotifier diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1b1b66c7dd..3f250e5682 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,16 +1,13 @@ { "name": "Gitea DevContainer", - "image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye", + "image": "mcr.microsoft.com/devcontainers/go:1.24-bullseye", "features": { // installs nodejs into container "ghcr.io/devcontainers/features/node:1": { - "version": "20" + "version": "22" }, - "ghcr.io/devcontainers/features/git-lfs:1.1.0": {}, - "ghcr.io/devcontainers-contrib/features/poetry:2": {}, - "ghcr.io/devcontainers/features/python:1": { - "version": "3.12" - } + "ghcr.io/devcontainers/features/git-lfs:1.2.5": {}, + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} }, "customizations": { "vscode": { @@ -25,8 +22,9 @@ "Vue.volar", "ms-azuretools.vscode-docker", "vitest.explorer", - "qwtel.sqlite-viewer", - "GitHub.vscode-pull-request-github" + "cweijan.vscode-database-client2", + "GitHub.vscode-pull-request-github", + "Azurite.azurite" ] } }, diff --git a/.dockerignore b/.dockerignore index 4c14a94620..807c70b000 100644 --- a/.dockerignore +++ b/.dockerignore @@ -34,15 +34,12 @@ _testmain.go *coverage.out coverage.all +coverage/ cpu.out -/modules/migration/bindata.go /modules/migration/bindata.go.hash -/modules/options/bindata.go /modules/options/bindata.go.hash -/modules/public/bindata.go /modules/public/bindata.go.hash -/modules/templates/bindata.go /modules/templates/bindata.go.hash *.db @@ -77,7 +74,6 @@ cpu.out /public/assets/css /public/assets/fonts /public/assets/img/avatar -/public/assets/img/webpack /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* @@ -95,6 +91,9 @@ cpu.out /.air /.go-licenses +# Files and folders that were previously generated +/public/assets/img/webpack + # Snapcraft snap/.snapcraft/ parts/ diff --git a/.editorconfig b/.editorconfig index c0946ac997..5476eb02fb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,10 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.{go,tmpl,html}] +[{*.{go,tmpl,html},Makefile,go.mod}] +indent_style = tab + +[go.*] indent_style = tab [templates/custom/*.tmpl] @@ -21,8 +24,13 @@ indent_style = space [templates/user/auth/oidc_wellknown.tmpl] indent_style = space -[Makefile] -indent_style = tab - [*.svg] insert_final_newline = false + +[options/locale/locale_*.ini] +insert_final_newline = false + +# Weblate JSON output defaults to four spaces +[options/locale_next/locale_*.json] +indent_style = space +indent_size = 4 diff --git a/.envrc.example b/.envrc.example new file mode 100644 index 0000000000..3550a30f2d --- /dev/null +++ b/.envrc.example @@ -0,0 +1 @@ +use flake diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index 99ce2e97d6..0000000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,841 +0,0 @@ -root: true -reportUnusedDisableDirectives: true - -ignorePatterns: - - /web_src/js/vendor - -parserOptions: - sourceType: module - ecmaVersion: latest - -plugins: - - "@eslint-community/eslint-plugin-eslint-comments" - - "@stylistic/eslint-plugin-js" - - eslint-plugin-array-func - - eslint-plugin-github - - eslint-plugin-i - - eslint-plugin-jquery - - eslint-plugin-no-jquery - - eslint-plugin-no-use-extend-native - - eslint-plugin-regexp - - eslint-plugin-sonarjs - - eslint-plugin-unicorn - - eslint-plugin-vitest - - eslint-plugin-vitest-globals - - eslint-plugin-wc - -env: - es2024: true - node: true - -overrides: - - files: ["web_src/**/*"] - globals: - __webpack_public_path__: true - process: false # https://github.com/webpack/webpack/issues/15833 - - files: ["web_src/**/*", "docs/**/*"] - env: - browser: true - node: false - - files: ["web_src/**/*worker.*"] - env: - worker: true - rules: - no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top] - - files: ["*.config.*"] - rules: - i/no-unused-modules: [0] - - files: ["**/*.test.*", "web_src/js/test/setup.js"] - env: - vitest-globals/env: true - rules: - vitest/consistent-test-filename: [0] - vitest/consistent-test-it: [0] - vitest/expect-expect: [0] - vitest/max-expects: [0] - vitest/max-nested-describe: [0] - vitest/no-alias-methods: [0] - vitest/no-commented-out-tests: [0] - vitest/no-conditional-expect: [0] - vitest/no-conditional-in-test: [0] - vitest/no-conditional-tests: [0] - vitest/no-disabled-tests: [0] - vitest/no-done-callback: [0] - vitest/no-duplicate-hooks: [0] - vitest/no-focused-tests: [0] - vitest/no-hooks: [0] - vitest/no-identical-title: [2] - vitest/no-interpolation-in-snapshots: [0] - vitest/no-large-snapshots: [0] - vitest/no-mocks-import: [0] - vitest/no-restricted-matchers: [0] - vitest/no-restricted-vi-methods: [0] - vitest/no-standalone-expect: [0] - vitest/no-test-prefixes: [0] - vitest/no-test-return-statement: [0] - vitest/prefer-called-with: [0] - vitest/prefer-comparison-matcher: [0] - vitest/prefer-each: [0] - vitest/prefer-equality-matcher: [0] - vitest/prefer-expect-resolves: [0] - vitest/prefer-hooks-in-order: [0] - vitest/prefer-hooks-on-top: [2] - vitest/prefer-lowercase-title: [0] - vitest/prefer-mock-promise-shorthand: [0] - vitest/prefer-snapshot-hint: [0] - vitest/prefer-spy-on: [0] - vitest/prefer-strict-equal: [0] - vitest/prefer-to-be: [0] - vitest/prefer-to-be-falsy: [0] - vitest/prefer-to-be-object: [0] - vitest/prefer-to-be-truthy: [0] - vitest/prefer-to-contain: [0] - vitest/prefer-to-have-length: [0] - vitest/prefer-todo: [0] - vitest/require-hook: [0] - vitest/require-to-throw-message: [0] - vitest/require-top-level-describe: [0] - vitest/valid-describe-callback: [2] - vitest/valid-expect: [2] - vitest/valid-title: [2] - - files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"] - rules: - no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression] - -rules: - "@eslint-community/eslint-comments/disable-enable-pair": [2] - "@eslint-community/eslint-comments/no-aggregating-enable": [2] - "@eslint-community/eslint-comments/no-duplicate-disable": [2] - "@eslint-community/eslint-comments/no-restricted-disable": [0] - "@eslint-community/eslint-comments/no-unlimited-disable": [2] - "@eslint-community/eslint-comments/no-unused-disable": [2] - "@eslint-community/eslint-comments/no-unused-enable": [2] - "@eslint-community/eslint-comments/no-use": [0] - "@eslint-community/eslint-comments/require-description": [0] - "@stylistic/js/array-bracket-newline": [0] - "@stylistic/js/array-bracket-spacing": [2, never] - "@stylistic/js/array-element-newline": [0] - "@stylistic/js/arrow-parens": [2, always] - "@stylistic/js/arrow-spacing": [2, {before: true, after: true}] - "@stylistic/js/block-spacing": [0] - "@stylistic/js/brace-style": [2, 1tbs, {allowSingleLine: true}] - "@stylistic/js/comma-dangle": [2, always-multiline] - "@stylistic/js/comma-spacing": [2, {before: false, after: true}] - "@stylistic/js/comma-style": [2, last] - "@stylistic/js/computed-property-spacing": [2, never] - "@stylistic/js/dot-location": [2, property] - "@stylistic/js/eol-last": [2] - "@stylistic/js/function-call-spacing": [2, never] - "@stylistic/js/function-call-argument-newline": [0] - "@stylistic/js/function-paren-newline": [0] - "@stylistic/js/generator-star-spacing": [0] - "@stylistic/js/implicit-arrow-linebreak": [0] - "@stylistic/js/indent": [2, 2, {ignoreComments: true, SwitchCase: 1}] - "@stylistic/js/key-spacing": [2] - "@stylistic/js/keyword-spacing": [2] - "@stylistic/js/linebreak-style": [2, unix] - "@stylistic/js/lines-around-comment": [0] - "@stylistic/js/lines-between-class-members": [0] - "@stylistic/js/max-len": [0] - "@stylistic/js/max-statements-per-line": [0] - "@stylistic/js/multiline-ternary": [0] - "@stylistic/js/new-parens": [2] - "@stylistic/js/newline-per-chained-call": [0] - "@stylistic/js/no-confusing-arrow": [0] - "@stylistic/js/no-extra-parens": [0] - "@stylistic/js/no-extra-semi": [2] - "@stylistic/js/no-floating-decimal": [0] - "@stylistic/js/no-mixed-operators": [0] - "@stylistic/js/no-mixed-spaces-and-tabs": [2] - "@stylistic/js/no-multi-spaces": [2, {ignoreEOLComments: true, exceptions: {Property: true}}] - "@stylistic/js/no-multiple-empty-lines": [2, {max: 1, maxEOF: 0, maxBOF: 0}] - "@stylistic/js/no-tabs": [2] - "@stylistic/js/no-trailing-spaces": [2] - "@stylistic/js/no-whitespace-before-property": [2] - "@stylistic/js/nonblock-statement-body-position": [2] - "@stylistic/js/object-curly-newline": [0] - "@stylistic/js/object-curly-spacing": [2, never] - "@stylistic/js/object-property-newline": [0] - "@stylistic/js/one-var-declaration-per-line": [0] - "@stylistic/js/operator-linebreak": [2, after] - "@stylistic/js/padded-blocks": [2, never] - "@stylistic/js/padding-line-between-statements": [0] - "@stylistic/js/quote-props": [0] - "@stylistic/js/quotes": [2, single, {avoidEscape: true, allowTemplateLiterals: true}] - "@stylistic/js/rest-spread-spacing": [2, never] - "@stylistic/js/semi": [2, always, {omitLastInOneLineBlock: true}] - "@stylistic/js/semi-spacing": [2, {before: false, after: true}] - "@stylistic/js/semi-style": [2, last] - "@stylistic/js/space-before-blocks": [2, always] - "@stylistic/js/space-before-function-paren": [2, {anonymous: ignore, named: never, asyncArrow: always}] - "@stylistic/js/space-in-parens": [2, never] - "@stylistic/js/space-infix-ops": [2] - "@stylistic/js/space-unary-ops": [2] - "@stylistic/js/spaced-comment": [2, always] - "@stylistic/js/switch-colon-spacing": [2] - "@stylistic/js/template-curly-spacing": [2, never] - "@stylistic/js/template-tag-spacing": [2, never] - "@stylistic/js/wrap-iife": [2, inside] - "@stylistic/js/wrap-regex": [0] - "@stylistic/js/yield-star-spacing": [2, after] - accessor-pairs: [2] - array-callback-return: [2, {checkForEach: true}] - array-func/avoid-reverse: [2] - array-func/from-map: [2] - array-func/no-unnecessary-this-arg: [2] - array-func/prefer-array-from: [2] - array-func/prefer-flat-map: [0] # handled by unicorn/prefer-array-flat-map - array-func/prefer-flat: [0] # handled by unicorn/prefer-array-flat - arrow-body-style: [0] - block-scoped-var: [2] - camelcase: [0] - capitalized-comments: [0] - class-methods-use-this: [0] - complexity: [0] - consistent-return: [0] - consistent-this: [0] - constructor-super: [2] - curly: [0] - default-case-last: [2] - default-case: [0] - default-param-last: [0] - dot-notation: [0] - eqeqeq: [2] - for-direction: [2] - func-name-matching: [2] - func-names: [0] - func-style: [0] - getter-return: [2] - github/a11y-aria-label-is-well-formatted: [0] - github/a11y-no-title-attribute: [0] - github/a11y-no-visually-hidden-interactive-element: [0] - github/a11y-role-supports-aria-props: [0] - github/a11y-svg-has-accessible-name: [0] - github/array-foreach: [0] - github/async-currenttarget: [2] - github/async-preventdefault: [2] - github/authenticity-token: [0] - github/get-attribute: [0] - github/js-class-name: [0] - github/no-blur: [0] - github/no-d-none: [0] - github/no-dataset: [2] - github/no-dynamic-script-tag: [2] - github/no-implicit-buggy-globals: [2] - github/no-inner-html: [0] - github/no-innerText: [2] - github/no-then: [2] - github/no-useless-passive: [2] - github/prefer-observers: [2] - github/require-passive-events: [2] - github/unescaped-html-literal: [0] - grouped-accessor-pairs: [2] - guard-for-in: [0] - id-blacklist: [0] - id-length: [0] - id-match: [0] - i/consistent-type-specifier-style: [0] - i/default: [0] - i/dynamic-import-chunkname: [0] - i/export: [2] - i/exports-last: [0] - i/extensions: [2, always, {ignorePackages: true}] - i/first: [2] - i/group-exports: [0] - i/max-dependencies: [0] - i/named: [2] - i/namespace: [0] - i/newline-after-import: [0] - i/no-absolute-path: [0] - i/no-amd: [2] - i/no-anonymous-default-export: [0] - i/no-commonjs: [2] - i/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}] - i/no-default-export: [0] - i/no-deprecated: [0] - i/no-dynamic-require: [0] - i/no-empty-named-blocks: [2] - i/no-extraneous-dependencies: [2] - i/no-import-module-exports: [0] - i/no-internal-modules: [0] - i/no-mutable-exports: [0] - i/no-named-as-default-member: [0] - i/no-named-as-default: [2] - i/no-named-default: [0] - i/no-named-export: [0] - i/no-namespace: [0] - i/no-nodejs-modules: [0] - i/no-relative-packages: [0] - i/no-relative-parent-imports: [0] - i/no-restricted-paths: [0] - i/no-self-import: [2] - i/no-unassigned-import: [0] - i/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}] - i/no-unused-modules: [2, {unusedExports: true}] - i/no-useless-path-segments: [2, {commonjs: true}] - i/no-webpack-loader-syntax: [2] - i/order: [0] - i/prefer-default-export: [0] - i/unambiguous: [0] - init-declarations: [0] - jquery/no-ajax-events: [2] - jquery/no-ajax: [2] - jquery/no-animate: [2] - jquery/no-attr: [2] - jquery/no-bind: [2] - jquery/no-class: [0] - jquery/no-clone: [2] - jquery/no-closest: [0] - jquery/no-css: [2] - jquery/no-data: [0] - jquery/no-deferred: [2] - jquery/no-delegate: [2] - jquery/no-each: [0] - jquery/no-extend: [2] - jquery/no-fade: [2] - jquery/no-filter: [0] - jquery/no-find: [0] - jquery/no-global-eval: [2] - jquery/no-grep: [2] - jquery/no-has: [2] - jquery/no-hide: [2] - jquery/no-html: [0] - jquery/no-in-array: [2] - jquery/no-is-array: [2] - jquery/no-is-function: [2] - jquery/no-is: [2] - jquery/no-load: [2] - jquery/no-map: [2] - jquery/no-merge: [2] - jquery/no-param: [2] - jquery/no-parent: [0] - jquery/no-parents: [0] - jquery/no-parse-html: [2] - jquery/no-prop: [2] - jquery/no-proxy: [2] - jquery/no-ready: [2] - jquery/no-serialize: [2] - jquery/no-show: [2] - jquery/no-size: [2] - jquery/no-sizzle: [0] - jquery/no-slide: [0] - jquery/no-submit: [0] - jquery/no-text: [0] - jquery/no-toggle: [2] - jquery/no-trigger: [0] - jquery/no-trim: [2] - jquery/no-val: [0] - jquery/no-when: [2] - jquery/no-wrap: [2] - line-comment-position: [0] - logical-assignment-operators: [0] - max-classes-per-file: [0] - max-depth: [0] - max-lines-per-function: [0] - max-lines: [0] - max-nested-callbacks: [0] - max-params: [0] - max-statements: [0] - multiline-comment-style: [2, separate-lines] - new-cap: [0] - no-alert: [0] - no-array-constructor: [2] - no-async-promise-executor: [0] - no-await-in-loop: [0] - no-bitwise: [0] - no-buffer-constructor: [0] - no-caller: [2] - no-case-declarations: [2] - no-class-assign: [2] - no-compare-neg-zero: [2] - no-cond-assign: [2, except-parens] - no-console: [1, {allow: [debug, info, warn, error]}] - no-const-assign: [2] - no-constant-binary-expression: [2] - no-constant-condition: [0] - no-constructor-return: [2] - no-continue: [0] - no-control-regex: [0] - no-debugger: [1] - no-delete-var: [2] - no-div-regex: [0] - no-dupe-args: [2] - no-dupe-class-members: [2] - no-dupe-else-if: [2] - no-dupe-keys: [2] - no-duplicate-case: [2] - no-duplicate-imports: [2] - no-else-return: [2] - no-empty-character-class: [2] - no-empty-function: [0] - no-empty-pattern: [2] - no-empty-static-block: [2] - no-empty: [2, {allowEmptyCatch: true}] - no-eq-null: [2] - no-eval: [2] - no-ex-assign: [2] - no-extend-native: [2] - no-extra-bind: [2] - no-extra-boolean-cast: [2] - no-extra-label: [0] - no-fallthrough: [2] - no-func-assign: [2] - no-global-assign: [2] - no-implicit-coercion: [2] - no-implicit-globals: [0] - no-implied-eval: [2] - no-import-assign: [2] - no-inline-comments: [0] - no-inner-declarations: [2] - no-invalid-regexp: [2] - no-invalid-this: [0] - no-irregular-whitespace: [2] - no-iterator: [2] - no-jquery/no-ajax-events: [2] - no-jquery/no-ajax: [2] - no-jquery/no-and-self: [2] - no-jquery/no-animate-toggle: [2] - no-jquery/no-animate: [2] - no-jquery/no-append-html: [2] - no-jquery/no-attr: [2] - no-jquery/no-bind: [2] - no-jquery/no-box-model: [2] - no-jquery/no-browser: [2] - no-jquery/no-camel-case: [2] - no-jquery/no-class-state: [0] - no-jquery/no-class: [0] - no-jquery/no-clone: [2] - no-jquery/no-closest: [0] - no-jquery/no-constructor-attributes: [2] - no-jquery/no-contains: [2] - no-jquery/no-context-prop: [2] - no-jquery/no-css: [2] - no-jquery/no-data: [0] - no-jquery/no-deferred: [2] - no-jquery/no-delegate: [2] - no-jquery/no-each-collection: [0] - no-jquery/no-each-util: [0] - no-jquery/no-each: [0] - no-jquery/no-error-shorthand: [2] - no-jquery/no-error: [2] - no-jquery/no-escape-selector: [2] - no-jquery/no-event-shorthand: [2] - no-jquery/no-extend: [2] - no-jquery/no-fade: [2] - no-jquery/no-filter: [0] - no-jquery/no-find-collection: [0] - no-jquery/no-find-util: [2] - no-jquery/no-find: [0] - no-jquery/no-fx-interval: [2] - no-jquery/no-global-eval: [2] - no-jquery/no-global-selector: [0] - no-jquery/no-grep: [2] - no-jquery/no-has: [2] - no-jquery/no-hold-ready: [2] - no-jquery/no-html: [0] - no-jquery/no-in-array: [2] - no-jquery/no-is-array: [2] - no-jquery/no-is-empty-object: [2] - no-jquery/no-is-function: [2] - no-jquery/no-is-numeric: [2] - no-jquery/no-is-plain-object: [2] - no-jquery/no-is-window: [2] - no-jquery/no-is: [2] - no-jquery/no-jquery-constructor: [0] - no-jquery/no-live: [2] - no-jquery/no-load-shorthand: [2] - no-jquery/no-load: [2] - no-jquery/no-map-collection: [0] - no-jquery/no-map-util: [2] - no-jquery/no-map: [2] - no-jquery/no-merge: [2] - no-jquery/no-node-name: [2] - no-jquery/no-noop: [2] - no-jquery/no-now: [2] - no-jquery/no-on-ready: [2] - no-jquery/no-other-methods: [0] - no-jquery/no-other-utils: [2] - no-jquery/no-param: [2] - no-jquery/no-parent: [0] - no-jquery/no-parents: [0] - no-jquery/no-parse-html-literal: [0] - no-jquery/no-parse-html: [2] - no-jquery/no-parse-json: [2] - no-jquery/no-parse-xml: [2] - no-jquery/no-prop: [2] - no-jquery/no-proxy: [2] - no-jquery/no-ready-shorthand: [2] - no-jquery/no-ready: [2] - no-jquery/no-selector-prop: [2] - no-jquery/no-serialize: [2] - no-jquery/no-size: [2] - no-jquery/no-sizzle: [0] - no-jquery/no-slide: [2] - no-jquery/no-sub: [2] - no-jquery/no-support: [2] - no-jquery/no-text: [0] - no-jquery/no-trigger: [0] - no-jquery/no-trim: [2] - no-jquery/no-type: [2] - no-jquery/no-unique: [2] - no-jquery/no-unload-shorthand: [2] - no-jquery/no-val: [0] - no-jquery/no-visibility: [2] - no-jquery/no-when: [2] - no-jquery/no-wrap: [2] - no-jquery/variable-pattern: [2] - no-label-var: [2] - no-labels: [0] # handled by no-restricted-syntax - no-lone-blocks: [2] - no-lonely-if: [0] - no-loop-func: [0] - no-loss-of-precision: [2] - no-magic-numbers: [0] - no-misleading-character-class: [2] - no-multi-assign: [0] - no-multi-str: [2] - no-negated-condition: [0] - no-nested-ternary: [0] - no-new-func: [2] - no-new-native-nonconstructor: [2] - no-new-object: [2] - no-new-symbol: [2] - no-new-wrappers: [2] - no-new: [0] - no-nonoctal-decimal-escape: [2] - no-obj-calls: [2] - no-octal-escape: [2] - no-octal: [2] - no-param-reassign: [0] - no-plusplus: [0] - no-promise-executor-return: [0] - no-proto: [2] - no-prototype-builtins: [2] - no-redeclare: [2] - no-regex-spaces: [2] - no-restricted-exports: [0] - no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename] - no-restricted-imports: [0] - no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}] - no-return-assign: [0] - no-script-url: [2] - no-self-assign: [2, {props: true}] - no-self-compare: [2] - no-sequences: [2] - no-setter-return: [2] - no-shadow-restricted-names: [2] - no-shadow: [0] - no-sparse-arrays: [2] - no-template-curly-in-string: [2] - no-ternary: [0] - no-this-before-super: [2] - no-throw-literal: [2] - no-undef-init: [2] - no-undef: [2, {typeof: true}] - no-undefined: [0] - no-underscore-dangle: [0] - no-unexpected-multiline: [2] - no-unmodified-loop-condition: [2] - no-unneeded-ternary: [0] - no-unreachable-loop: [2] - no-unreachable: [2] - no-unsafe-finally: [2] - no-unsafe-negation: [2] - no-unused-expressions: [2] - no-unused-labels: [2] - no-unused-private-class-members: [2] - no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_, ignoreRestSiblings: false}] - no-use-before-define: [2, {functions: false, classes: true, variables: true, allowNamedExports: true}] - no-use-extend-native/no-use-extend-native: [2] - no-useless-backreference: [2] - no-useless-call: [2] - no-useless-catch: [2] - no-useless-computed-key: [2] - no-useless-concat: [2] - no-useless-constructor: [2] - no-useless-escape: [2] - no-useless-rename: [2] - no-useless-return: [2] - no-var: [2] - no-void: [2] - no-warning-comments: [0] - no-with: [0] # handled by no-restricted-syntax - object-shorthand: [2, always] - one-var-declaration-per-line: [0] - one-var: [0] - operator-assignment: [2, always] - operator-linebreak: [2, after] - prefer-arrow-callback: [2, {allowNamedFunctions: true, allowUnboundThis: true}] - prefer-const: [2, {destructuring: all, ignoreReadBeforeAssign: true}] - prefer-destructuring: [0] - prefer-exponentiation-operator: [2] - prefer-named-capture-group: [0] - prefer-numeric-literals: [2] - prefer-object-has-own: [2] - prefer-object-spread: [2] - prefer-promise-reject-errors: [2, {allowEmptyReject: false}] - prefer-regex-literals: [2] - prefer-rest-params: [2] - prefer-spread: [2] - prefer-template: [2] - radix: [2, as-needed] - regexp/confusing-quantifier: [2] - regexp/control-character-escape: [2] - regexp/hexadecimal-escape: [0] - regexp/letter-case: [0] - regexp/match-any: [2] - regexp/negation: [2] - regexp/no-contradiction-with-assertion: [0] - regexp/no-control-character: [0] - regexp/no-dupe-characters-character-class: [2] - regexp/no-dupe-disjunctions: [2] - regexp/no-empty-alternative: [2] - regexp/no-empty-capturing-group: [2] - regexp/no-empty-character-class: [0] - regexp/no-empty-group: [2] - regexp/no-empty-lookarounds-assertion: [2] - regexp/no-empty-string-literal: [2] - regexp/no-escape-backspace: [2] - regexp/no-extra-lookaround-assertions: [0] - regexp/no-invalid-regexp: [2] - regexp/no-invisible-character: [2] - regexp/no-lazy-ends: [2] - regexp/no-legacy-features: [2] - regexp/no-misleading-capturing-group: [0] - regexp/no-misleading-unicode-character: [0] - regexp/no-missing-g-flag: [2] - regexp/no-non-standard-flag: [2] - regexp/no-obscure-range: [2] - regexp/no-octal: [2] - regexp/no-optional-assertion: [2] - regexp/no-potentially-useless-backreference: [2] - regexp/no-standalone-backslash: [2] - regexp/no-super-linear-backtracking: [0] - regexp/no-super-linear-move: [0] - regexp/no-trivially-nested-assertion: [2] - regexp/no-trivially-nested-quantifier: [2] - regexp/no-unused-capturing-group: [0] - regexp/no-useless-assertions: [2] - regexp/no-useless-backreference: [2] - regexp/no-useless-character-class: [2] - regexp/no-useless-dollar-replacements: [2] - regexp/no-useless-escape: [2] - regexp/no-useless-flag: [2] - regexp/no-useless-lazy: [2] - regexp/no-useless-non-capturing-group: [2] - regexp/no-useless-quantifier: [2] - regexp/no-useless-range: [2] - regexp/no-useless-set-operand: [2] - regexp/no-useless-string-literal: [2] - regexp/no-useless-two-nums-quantifier: [2] - regexp/no-zero-quantifier: [2] - regexp/optimal-lookaround-quantifier: [2] - regexp/optimal-quantifier-concatenation: [0] - regexp/prefer-character-class: [0] - regexp/prefer-d: [0] - regexp/prefer-escape-replacement-dollar-char: [0] - regexp/prefer-lookaround: [0] - regexp/prefer-named-backreference: [0] - regexp/prefer-named-capture-group: [0] - regexp/prefer-named-replacement: [0] - regexp/prefer-plus-quantifier: [2] - regexp/prefer-predefined-assertion: [2] - regexp/prefer-quantifier: [0] - regexp/prefer-question-quantifier: [2] - regexp/prefer-range: [2] - regexp/prefer-regexp-exec: [2] - regexp/prefer-regexp-test: [2] - regexp/prefer-result-array-groups: [0] - regexp/prefer-set-operation: [2] - regexp/prefer-star-quantifier: [2] - regexp/prefer-unicode-codepoint-escapes: [2] - regexp/prefer-w: [0] - regexp/require-unicode-regexp: [0] - regexp/simplify-set-operations: [2] - regexp/sort-alternatives: [0] - regexp/sort-character-class-elements: [0] - regexp/sort-flags: [0] - regexp/strict: [2] - regexp/unicode-escape: [0] - regexp/use-ignore-case: [0] - require-atomic-updates: [0] - require-await: [0] - 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: [2] - 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-one-iteration-loop: [2] - 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: [2] - 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] - strict: [0] - symbol-description: [2] - unicode-bom: [2, never] - unicorn/better-regex: [0] - unicorn/catch-error-name: [0] - unicorn/consistent-destructuring: [2] - unicorn/consistent-function-scoping: [2] - unicorn/custom-error-definition: [0] - unicorn/empty-brace-spaces: [2] - unicorn/error-message: [0] - unicorn/escape-case: [0] - unicorn/expiring-todo-comments: [0] - unicorn/explicit-length-check: [0] - unicorn/filename-case: [0] - unicorn/import-index: [0] - unicorn/import-style: [0] - unicorn/new-for-builtins: [2] - unicorn/no-abusive-eslint-disable: [0] - unicorn/no-array-callback-reference: [0] - unicorn/no-array-for-each: [2] - unicorn/no-array-method-this-argument: [2] - unicorn/no-array-push-push: [2] - unicorn/no-array-reduce: [2] - unicorn/no-await-expression-member: [0] - unicorn/no-console-spaces: [0] - unicorn/no-document-cookie: [2] - unicorn/no-empty-file: [2] - unicorn/no-for-loop: [0] - unicorn/no-hex-escape: [0] - unicorn/no-instanceof-array: [0] - unicorn/no-invalid-remove-event-listener: [2] - unicorn/no-keyword-prefix: [0] - unicorn/no-lonely-if: [2] - unicorn/no-negated-condition: [0] - unicorn/no-nested-ternary: [0] - unicorn/no-new-array: [0] - unicorn/no-new-buffer: [0] - unicorn/no-null: [0] - unicorn/no-object-as-default-parameter: [0] - unicorn/no-process-exit: [0] - unicorn/no-static-only-class: [2] - unicorn/no-thenable: [2] - unicorn/no-this-assignment: [2] - unicorn/no-typeof-undefined: [2] - unicorn/no-unnecessary-await: [2] - unicorn/no-unnecessary-polyfills: [2] - unicorn/no-unreadable-array-destructuring: [0] - unicorn/no-unreadable-iife: [2] - unicorn/no-unused-properties: [2] - unicorn/no-useless-fallback-in-spread: [2] - unicorn/no-useless-length-check: [2] - unicorn/no-useless-promise-resolve-reject: [2] - unicorn/no-useless-spread: [2] - unicorn/no-useless-switch-case: [2] - unicorn/no-useless-undefined: [0] - unicorn/no-zero-fractions: [2] - unicorn/number-literal-case: [0] - unicorn/numeric-separators-style: [0] - unicorn/prefer-add-event-listener: [2] - unicorn/prefer-array-find: [2] - unicorn/prefer-array-flat-map: [2] - unicorn/prefer-array-flat: [2] - unicorn/prefer-array-index-of: [2] - unicorn/prefer-array-some: [2] - unicorn/prefer-at: [0] - unicorn/prefer-blob-reading-methods: [2] - unicorn/prefer-code-point: [0] - unicorn/prefer-date-now: [2] - unicorn/prefer-default-parameters: [0] - unicorn/prefer-dom-node-append: [2] - unicorn/prefer-dom-node-dataset: [0] - unicorn/prefer-dom-node-remove: [2] - unicorn/prefer-dom-node-text-content: [2] - unicorn/prefer-event-target: [2] - unicorn/prefer-export-from: [0] - unicorn/prefer-includes: [2] - unicorn/prefer-json-parse-buffer: [0] - unicorn/prefer-keyboard-event-key: [2] - unicorn/prefer-logical-operator-over-ternary: [2] - unicorn/prefer-math-trunc: [2] - unicorn/prefer-modern-dom-apis: [0] - unicorn/prefer-modern-math-apis: [2] - unicorn/prefer-module: [2] - unicorn/prefer-native-coercion-functions: [2] - unicorn/prefer-negative-index: [2] - unicorn/prefer-node-protocol: [2] - unicorn/prefer-number-properties: [0] - unicorn/prefer-object-from-entries: [2] - unicorn/prefer-object-has-own: [0] - unicorn/prefer-optional-catch-binding: [2] - unicorn/prefer-prototype-methods: [0] - unicorn/prefer-query-selector: [0] - unicorn/prefer-reflect-apply: [0] - unicorn/prefer-regexp-test: [2] - unicorn/prefer-set-has: [0] - unicorn/prefer-set-size: [2] - unicorn/prefer-spread: [0] - unicorn/prefer-string-replace-all: [0] - unicorn/prefer-string-slice: [0] - unicorn/prefer-string-starts-ends-with: [2] - unicorn/prefer-string-trim-start-end: [2] - unicorn/prefer-switch: [0] - unicorn/prefer-ternary: [0] - unicorn/prefer-text-content: [2] - unicorn/prefer-top-level-await: [0] - unicorn/prefer-type-error: [0] - unicorn/prevent-abbreviations: [0] - unicorn/relative-url-style: [2] - unicorn/require-array-join-separator: [2] - unicorn/require-number-to-fixed-digits-argument: [2] - unicorn/require-post-message-target-origin: [0] - unicorn/string-content: [0] - unicorn/switch-case-braces: [0] - unicorn/template-indent: [2] - unicorn/text-encoding-identifier-case: [0] - unicorn/throw-new-error: [2] - use-isnan: [2] - valid-typeof: [2, {requireStringLiterals: true}] - vars-on-top: [0] - wc/attach-shadow-constructor: [2] - wc/define-tag-after-class-definition: [0] - wc/expose-class-on-global: [0] - wc/file-name-matches-element: [2] - wc/guard-define-call: [0] - wc/guard-super-call: [2] - wc/max-elements-per-file: [0] - wc/no-child-traversal-in-attributechangedcallback: [2] - wc/no-child-traversal-in-connectedcallback: [2] - wc/no-closed-shadow-root: [2] - wc/no-constructor-attributes: [2] - wc/no-constructor-params: [2] - wc/no-constructor: [2] - wc/no-customized-built-in-elements: [2] - wc/no-exports-with-element: [0] - wc/no-invalid-element-name: [2] - wc/no-invalid-extends: [2] - wc/no-method-prefixed-with-on: [2] - wc/no-self-class: [2] - wc/no-typos: [2] - wc/require-listener-teardown: [2] - wc/tag-name-matches-class: [2] - yoda: [2, never] diff --git a/.forgejo/cascading-pr-end-to-end b/.forgejo/cascading-pr-end-to-end index d7a6b46b48..8013fde06a 100755 --- a/.forgejo/cascading-pr-end-to-end +++ b/.forgejo/cascading-pr-end-to-end @@ -13,21 +13,22 @@ minor_version=$(make show-version-minor) cd $end_to_end -if ! test -f forgejo/sources/$minor_version ; then - echo "FAIL: forgejo/sources/$minor_version does not exist in the end-to-end repository" - false +if ! test -f forgejo/sources/$minor_version; then + echo "FAIL: forgejo/sources/$minor_version does not exist in the end-to-end repository" + false fi -date > last-upgrade +echo -n $minor_version >forgejo/build-from-sources +date >last-upgrade -if test -f "$forgejo_pr_or_ref" ; then - forgejo_pr=$forgejo_pr_or_ref - head_url=$(jq --raw-output .head.repo.html_url < $forgejo_pr) - test "$head_url" != null - branch=$(jq --raw-output .head.ref < $forgejo_pr) - test "$branch" != null - echo $head_url $branch $full_version > forgejo/sources/$minor_version +if test -f "$forgejo_pr_or_ref"; then + forgejo_pr=$forgejo_pr_or_ref + head_url=$(jq --raw-output .head.repo.html_url <$forgejo_pr) + test "$head_url" != null + branch=$(jq --raw-output .head.ref <$forgejo_pr) + test "$branch" != null + echo $head_url $branch $full_version >forgejo/sources/$minor_version else - forgejo_ref=$forgejo_pr_or_ref - echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY ${forgejo_ref#refs/heads/} $full_version > forgejo/sources/$minor_version + forgejo_ref=$forgejo_pr_or_ref + echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY ${forgejo_ref#refs/heads/} $full_version >forgejo/sources/$minor_version fi diff --git a/.forgejo/cascading-release-end-to-end b/.forgejo/cascading-release-end-to-end index 08ad8a4431..9be0737b0f 100755 --- a/.forgejo/cascading-release-end-to-end +++ b/.forgejo/cascading-release-end-to-end @@ -8,15 +8,15 @@ forgejo=$3 forgejo_ref=$4 cd $end_to_end -date > last-upgrade +date >last-upgrade organizations=lib/ORGANIZATIONS -if ! test -f $organizations ; then - echo "$organizations file not found" - false +if ! test -f $organizations; then + echo "$organizations file not found" + false fi # -# do not include forgejo-experimental so that 7.0-test is found -# in forgejo-integration where it was just built instead of -# forgejo-experimental which was published by the previous build +# Inverse the order of lookup because the goal in the release built +# pipeline is to test the latest build, if available, instead of the +# stable version by the same version. # -echo forgejo forgejo-integration > $organizations +echo forgejo-integration forgejo-experimental forgejo >$organizations diff --git a/.gitea/issue_template/bug-report-ui.yaml b/.forgejo/issue_template/bug-report-ui.yaml similarity index 57% rename from .gitea/issue_template/bug-report-ui.yaml rename to .forgejo/issue_template/bug-report-ui.yaml index 09513d08e7..8bb7bf1d49 100644 --- a/.gitea/issue_template/bug-report-ui.yaml +++ b/.forgejo/issue_template/bug-report-ui.yaml @@ -1,28 +1,41 @@ name: ๐Ÿฆ‹ Bug Report (web interface / frontend) description: Something doesn't look quite as it should? Report it here! -title: "[BUG] " +title: "bug: " labels: ["bug/new-report", "forgejo/ui"] body: - type: markdown attributes: value: | - **NOTE: If your issue is a security concern, please email (GPG: `A4676E79`) instead of opening a public issue.** + **NOTE: If your issue is a security concern, please email ([security.txt](https://forgejo.org/.well-known/security.txt)) instead of opening a public issue.** - type: markdown attributes: value: | - Please speak English, as this is the language all maintainers can speak and write. - Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way. - Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct). - - Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). - - Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered. + - Take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). +- type: dropdown + id: can-reproduce + attributes: + label: Can you reproduce the bug on the Forgejo test instance? + description: | + Please try reproducing your issue at https://dev.next.forgejo.org. + It is running the latest development branch and will confirm the problem is not already fixed. + If you can reproduce it, provide a URL in the description. + options: + - "Yes" + - "No" + validations: + required: true - type: textarea id: description attributes: label: Description description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below). - If you think this is a JavaScript error, show us the JavaScript console. - If the error appears to relate to Forgejo the server, please also give us `DEBUG` level logs. (See https://forgejo.org/docs/latest/admin/logging-documentation/) + Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see above). + If you think this is a JavaScript error, include a copy of the JavaScript console. + validations: + required: true - type: textarea id: screenshots attributes: @@ -35,20 +48,6 @@ body: attributes: label: Forgejo Version description: Forgejo version (or commit reference) your instance is running - validations: - required: true -- type: dropdown - id: can-reproduce - attributes: - label: Can you reproduce the bug on Forgejo Next? - description: | - Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org). - If you can reproduce it, please provide a URL in the Description field. - options: - - "Yes" - - "No" - validations: - required: true - type: input id: browser-ver attributes: @@ -56,8 +55,3 @@ body: description: The browser and version that you are using to access Forgejo validations: required: true -- type: input - id: os-ver - attributes: - label: Operating System - description: The operating system you are using to access Forgejo diff --git a/.gitea/issue_template/bug-report.yaml b/.forgejo/issue_template/bug-report.yaml similarity index 64% rename from .gitea/issue_template/bug-report.yaml rename to .forgejo/issue_template/bug-report.yaml index 6edbca886f..a2b50dbca2 100644 --- a/.gitea/issue_template/bug-report.yaml +++ b/.forgejo/issue_template/bug-report.yaml @@ -1,26 +1,38 @@ name: ๐Ÿ› Bug Report (server / backend) description: Found something you weren't expecting? Report it here! -title: "[BUG] " +title: "bug: " labels: bug/new-report body: - type: markdown attributes: value: | - **NOTE: If your issue is a security concern, please email (GPG: `A4676E79`) instead of opening a public issue.** + **NOTE: If your issue is a security concern, please email ([security.txt](https://forgejo.org/.well-known/security.txt)) instead of opening a public issue.** - type: markdown attributes: value: | - Please speak English, as this is the language all maintainers can speak and write. - Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way. - Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct). - - Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). - - Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered. + - Take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137). +- type: dropdown + id: can-reproduce + attributes: + label: Can you reproduce the bug on the Forgejo test instance? + description: | + Please try reproducing your issue at https://dev.next.forgejo.org. + It is running the latest development branch and will confirm the problem is not already fixed. + If you can reproduce it, provide a URL in the description. + options: + - "Yes" + - "No" + validations: + required: true - type: textarea id: description attributes: label: Description description: | - Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below). + Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see above). validations: required: true - type: input @@ -28,18 +40,14 @@ body: attributes: label: Forgejo Version description: Forgejo version (or commit reference) of your instance - validations: - required: true -- type: dropdown - id: can-reproduce +- type: textarea + id: run-info attributes: - label: Can you reproduce the bug on Forgejo Next? + label: How are you running Forgejo? description: | - Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org). - If you can reproduce it, please provide a URL in the Description field. - options: - - "Yes" - - "No" + Please include information on whether you built Forgejo yourself, used one of our downloads, or are using some other package. + Please also tell us how you are running Forgejo, e.g. if it is being run from a container, a command-line, systemd etc. + If you are using a package or systemd tell us what distribution you are using. validations: required: true - type: textarea @@ -53,31 +61,6 @@ body: Please copy and paste your logs here, with any sensitive information (e.g. API keys) removed/hidden. You can wrap your logs in `
...
` tags so it doesn't take up too much space in the issue. -- type: textarea - id: screenshots - attributes: - label: Screenshots - description: If this issue involves the Web Interface, please provide one or more screenshots -- type: input - id: git-ver - attributes: - label: Git Version - description: The version of git running on the server -- type: input - id: os-ver - attributes: - label: Operating System - description: The operating system you are using to run Forgejo -- type: textarea - id: run-info - attributes: - label: How are you running Forgejo? - description: | - Please include information on whether you built Forgejo yourself, used one of our downloads, or are using some other package. - Please also tell us how you are running Forgejo, e.g. if it is being run from docker, a command-line, systemd etc. - If you are using a package or systemd tell us what distribution you are using. - validations: - required: true - type: dropdown id: database attributes: @@ -87,4 +70,3 @@ body: - SQLite - PostgreSQL - MySQL - - MSSQL diff --git a/.gitea/issue_template/config.yml b/.forgejo/issue_template/config.yml similarity index 86% rename from .gitea/issue_template/config.yml rename to .forgejo/issue_template/config.yml index 0e3caf9280..f2ea8d945a 100644 --- a/.gitea/issue_template/config.yml +++ b/.forgejo/issue_template/config.yml @@ -1,7 +1,7 @@ contact_links: - name: ๐Ÿ”“ Security Reports url: mailto:security@forgejo.org - about: "Please email (GPG: `A4676E79`) instead of opening a public issue." + about: "Please email (See https://forgejo.org/.well-known/security.txt)." - name: ๐Ÿ’ฌ Matrix Chat Room url: https://matrix.to/#/#forgejo-chat:matrix.org about: Please ask questions and discuss configuration or deployment problems here. diff --git a/.gitea/issue_template/feature-request.yaml b/.forgejo/issue_template/feature-request.yaml similarity index 98% rename from .gitea/issue_template/feature-request.yaml rename to .forgejo/issue_template/feature-request.yaml index 4b10bea145..0996680cb4 100644 --- a/.gitea/issue_template/feature-request.yaml +++ b/.forgejo/issue_template/feature-request.yaml @@ -1,6 +1,6 @@ name: ๐Ÿ’ก Feature Request description: Got an idea for a feature that Forgejo doesn't have yet? Suggest it here! -title: "[FEAT] " +title: "feat: " labels: ["enhancement/feature"] body: - type: markdown diff --git a/.forgejo/pull_request_template.md b/.forgejo/pull_request_template.md new file mode 100644 index 0000000000..d30af48446 --- /dev/null +++ b/.forgejo/pull_request_template.md @@ -0,0 +1,33 @@ +--- + +name: "Pull Request Template" +about: "Template for all Pull Requests" +labels: + +- test/needed + +--- + +## Checklist + +The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). + +### Tests + +- I added test coverage for Go changes... + - [ ] in their respective `*_test.go` for unit tests. + - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. +- I added test coverage for JavaScript changes... + - [ ] in `web_src/js/*.test.js` if it can be unit tested. + - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). + +### Documentation + +- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. +- [ ] I did not document these changes and I do not expect someone else to do it. + +### Release notes + +- [ ] I do not want this change to show in the release notes. +- [ ] I want the title to show in the release notes with a link to this pull request. +- [ ] I want the content of the `release-notes/.md` to be be used for the release notes instead of the title. diff --git a/.forgejo/testdata/build-release/Dockerfile b/.forgejo/testdata/build-release/Dockerfile index 8dccad281c..09cce06c47 100644 --- a/.forgejo/testdata/build-release/Dockerfile +++ b/.forgejo/testdata/build-release/Dockerfile @@ -1,4 +1,6 @@ -FROM code.forgejo.org/oci/alpine:3.19 +FROM data.forgejo.org/oci/alpine:3.22 ARG RELEASE_VERSION=unkown +LABEL maintainer="contact@forgejo.org" \ + org.opencontainers.image.version="${RELEASE_VERSION}" RUN mkdir -p /app/gitea RUN ( echo '#!/bin/sh' ; echo "echo forgejo v$RELEASE_VERSION" ) > /app/gitea/gitea ; chmod +x /app/gitea/gitea diff --git a/.forgejo/testdata/build-release/go.mod b/.forgejo/testdata/build-release/go.mod new file mode 100644 index 0000000000..585dcc4f3d --- /dev/null +++ b/.forgejo/testdata/build-release/go.mod @@ -0,0 +1,3 @@ +module forgejo.org + +go 1.23.3 diff --git a/.forgejo/workflows-composite/apt-install-from/action.yaml b/.forgejo/workflows-composite/apt-install-from/action.yaml new file mode 100644 index 0000000000..c1c8c950e3 --- /dev/null +++ b/.forgejo/workflows-composite/apt-install-from/action.yaml @@ -0,0 +1,29 @@ +inputs: + packages: + description: 'Packages to install' + required: true + release: + description: 'Release to install from' + default: testing + +runs: + using: "composite" + steps: + - name: setup apt package source + run: | + export DEBIAN_FRONTEND=noninteractive + echo "deb http://deb.debian.org/debian/ ${RELEASE} main" > "/etc/apt/sources.list.d/${RELEASE}.list" + env: + RELEASE: ${{inputs.release}} + - name: install packages + run: | + apt-get update -qq + apt-get -q install --allow-downgrades -qq -y ${PACKAGES} + env: + PACKAGES: ${{inputs.packages}} + - name: remove temporary package list to prevent using it in other steps + run: | + rm "/etc/apt/sources.list.d/${RELEASE}.list" + apt-get update -qq + env: + RELEASE: ${{inputs.release}} diff --git a/.forgejo/workflows-composite/build-backend/action.yaml b/.forgejo/workflows-composite/build-backend/action.yaml new file mode 100644 index 0000000000..68a99ffaf9 --- /dev/null +++ b/.forgejo/workflows-composite/build-backend/action.yaml @@ -0,0 +1,15 @@ +runs: + using: "composite" + steps: + - run: | + su forgejo -c 'make deps-backend' + - uses: https://data.forgejo.org/actions/cache@v4 + id: cache-backend + with: + path: ${{github.workspace}}/gitea + key: backend-build-${{ github.sha }} + - if: steps.cache-backend.outputs.cache-hit != 'true' + run: | + su forgejo -c 'make backend' + env: + TAGS: bindata diff --git a/.forgejo/workflows-composite/install-minimum-git-version/action.yaml b/.forgejo/workflows-composite/install-minimum-git-version/action.yaml new file mode 100644 index 0000000000..d4e6e3f2a7 --- /dev/null +++ b/.forgejo/workflows-composite/install-minimum-git-version/action.yaml @@ -0,0 +1,22 @@ +# +# Install the minimal version of Git supported by Forgejo +# +runs: + using: "composite" + steps: + - name: install git and git-lfs + run: | + set -x + + export DEBIAN_FRONTEND=noninteractive + + apt-get update -qq + apt-get -q install -y -qq curl ca-certificates + + curl -sS -o /tmp/git-man.deb http://archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_2.34.1-1ubuntu1_all.deb + curl -sS -o /tmp/git.deb https://archive.ubuntu.com/ubuntu/pool/main/g/git/git_2.34.1-1ubuntu1_amd64.deb + curl -sS -o /tmp/git-lfs.deb https://archive.ubuntu.com/ubuntu/pool/universe/g/git-lfs/git-lfs_3.0.2-1_amd64.deb + + apt-get -q install --allow-downgrades -y -qq /tmp/git-man.deb + apt-get -q install --allow-downgrades -y -qq /tmp/git.deb + apt-get -q install --allow-downgrades -y -qq /tmp/git-lfs.deb diff --git a/.forgejo/workflows-composite/setup-cache-go/action.yaml b/.forgejo/workflows-composite/setup-cache-go/action.yaml new file mode 100644 index 0000000000..f2818a7635 --- /dev/null +++ b/.forgejo/workflows-composite/setup-cache-go/action.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: MIT +name: 'Forgejo Actions to setup Go and cache dependencies' +author: 'Forgejo authors' +description: | + Wrap the setup-go with improved dependency caching. +inputs: + username: + description: 'User for which to manage the dependency cache' + default: root + +runs: + using: "composite" + steps: + - name: "Install zstd for faster caching" + run: | + apt-get update -qq + apt-get -q install -qq -y zstd + + - name: "Set up Go using setup-go" + uses: https://data.forgejo.org/actions/setup-go@v5 + id: go-version + with: + go-version-file: "go.mod" + # do not cache dependencies, we do this manually + cache: false + + - name: "Get go environment information" + id: go-environment + run: | + chmod 755 $HOME # ensure ${RUN_AS_USER} has permission when go is located in $HOME + export GOROOT="$(go env GOROOT)" + echo "modcache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT" + echo "cache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT" + env: + RUN_AS_USER: ${{ inputs.username }} + GO_VERSION: ${{ steps.go-version.outputs.go-version }} + + - name: "Create cache folders with correct permissions (for non-root users)" + if: inputs.username != 'root' + # when the cache is restored, only the permissions of the last part are restored + # so assuming that /home/user exists and we are restoring /home/user/go/pkg/mod, + # both folders will have the correct permissions, but + # /home/user/go and /home/user/go/pkg might be owned by root + run: | + su ${RUN_AS_USER} -c 'mkdir -p "${MODCACHE_DIR}" "${CACHE_DIR}"' + env: + RUN_AS_USER: ${{ inputs.username }} + MODCACHE_DIR: ${{ steps.go-environment.outputs.modcache }} + CACHE_DIR: ${{ steps.go-environment.outputs.cache }} + + - name: "Restore Go dependencies from cache or mark for later caching" + id: cache-deps + uses: https://data.forgejo.org/actions/cache@v4 + with: + key: setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}-${{ hashFiles('go.sum', 'go.mod') }} + restore-keys: | + setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}- + setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}- + path: | + ${{ steps.go-environment.outputs.modcache }} + ${{ steps.go-environment.outputs.cache }} diff --git a/.forgejo/workflows-composite/setup-env/action.yaml b/.forgejo/workflows-composite/setup-env/action.yaml new file mode 100644 index 0000000000..f19569a137 --- /dev/null +++ b/.forgejo/workflows-composite/setup-env/action.yaml @@ -0,0 +1,25 @@ +# TODO: +# - [ ] prepare a forgejo ci image with the necessary tools and forgejo user +runs: + using: "composite" + steps: + - name: setup user and permissions + run: | + git config --add safe.directory '*' + # ignore if the user already exists (like with the playwright image) + adduser --quiet --comment forgejo --disabled-password forgejo || true + chown -R forgejo:forgejo . + + - uses: ./.forgejo/workflows-composite/setup-cache-go + with: + username: forgejo + + - name: validate go version + run: | + set -ex + toolchain=$(grep -oP '(?<=toolchain ).+' go.mod) + version=$(go version | cut -d' ' -f3) + if dpkg --compare-versions ${version#go} lt ${toolchain#go}; then + echo "go version too low: $toolchain >= $version" + exit 1 + fi diff --git a/.forgejo/workflows/backport.yml b/.forgejo/workflows/backport.yml index 50e8785c12..573c33f93b 100644 --- a/.forgejo/workflows/backport.yml +++ b/.forgejo/workflows/backport.yml @@ -22,6 +22,8 @@ # `backport/v1.21` label on a merged pull request that can be backported # without conflict. # +name: issue-labels + on: pull_request_target: types: @@ -31,57 +33,29 @@ on: jobs: backporting: if: > - !startsWith(vars.ROLE, 'forgejo-') && ( + ( vars.ROLE == 'forgejo-coding' ) && ( github.event.pull_request.merged - && ( - ( - github.event.action == 'closed' && - contains(toJSON(github.event.pull_request.labels), 'backport/v') - ) - || - ( - github.event.action == 'labeled' && - contains(github.event.label.name, 'backport/v') - ) - ) + && + contains(toJSON(github.event.pull_request.labels), 'backport/v') ) runs-on: docker container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/node:22-bookworm' steps: - - name: Fetch labels - id: fetch-labels - shell: bash + - name: event info run: | - set -x - echo "Labels retrieved below" - export DEBIAN_FRONTEND=noninteractive - apt-get update -qq - apt-get -q install -qq -y jq - filtered_labels=$(echo "$LABELS" | jq -c 'map(select(.name | startswith("backport/v")))') - echo "FILTERED_LABELS=${filtered_labels}" >> $GITHUB_ENV - env: - LABELS: ${{ toJSON(github.event.pull_request.labels) }} - - name: Extract targets - id: extract-targets - shell: bash - run: | - set -x - targets="$(echo $FILTERED_LABELS | jq -c '[.[] | .name | sub("backport/"; "")]')" - echo "targets=$(echo $targets)" >> $GITHUB_OUTPUT - - - name: Printing info - shell: bash - run: | - echo "targets: ${{ steps.extract-targets.outputs.targets }}" - echo "target-branch: ${{ fromJSON(steps.extract-targets.outputs.targets)[0] }}" - echo "pull-request: ${{ github.event.pull_request.url }}" - - - uses: https://code.forgejo.org/actions/git-backporting@v4.6.0 + cat <<'EOF' + ${{ toJSON(github) }} + EOF + - uses: https://data.forgejo.org/actions/git-backporting@v4.8.5 with: - target-branch: ${{ fromJSON(steps.extract-targets.outputs.targets)[0] }}/forgejo + target-branch-pattern: "^backport/(?(v.*))$" strategy: ort strategy-option: find-renames - no-squash: true + cherry-pick-options: -x auth: ${{ secrets.BACKPORT_TOKEN }} pull-request: ${{ github.event.pull_request.url }} + auto-no-squash: true + enable-err-notification: true + git-user: forgejo-backport-action + git-email: forgejo-backport-action@noreply.codeberg.org diff --git a/.forgejo/workflows/build-release-integration.yml b/.forgejo/workflows/build-release-integration.yml index 610b8f0520..1af6d567dd 100644 --- a/.forgejo/workflows/build-release-integration.yml +++ b/.forgejo/workflows/build-release-integration.yml @@ -22,13 +22,13 @@ on: jobs: release-simulation: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} - runs-on: self-hosted + if: vars.ROLE == 'forgejo-coding' + runs-on: lxc-bookworm steps: - - uses: actions/checkout@v3 + - uses: https://data.forgejo.org/actions/checkout@v4 - id: forgejo - uses: https://code.forgejo.org/actions/setup-forgejo@v1 + uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.4 with: user: root password: admin1234 diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index f8cd69850c..3ab63b0589 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -1,5 +1,5 @@ # -# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process +# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process # # https://codeberg.org/forgejo-integration/forgejo # @@ -14,6 +14,12 @@ # secrets.CASCADE_DESTINATION_TOKEN: scope read:user, write:repository, write:issue # vars.CASCADE_DESTINATION_DOER: forgejo-ci # +# vars.SKIP_END_TO_END: `true` or `false` +# It must be `false` (or absent) so https://code.forgejo.org/forgejo/end-to-end is run +# with the newly built release. +# It must be set to `true` when a release is missing, for instance because it was +# removed and failed to upload. +# on: push: tags: 'v[0-9]+.[0-9]+.*' @@ -23,11 +29,11 @@ on: jobs: release: - runs-on: self-hosted + runs-on: lxc-bookworm # root is used for testing, allow it if: vars.ROLE == 'forgejo-integration' || github.repository_owner == 'root' steps: - - uses: actions/checkout@v3 + - uses: https://data.forgejo.org/actions/checkout@v4 with: fetch-depth: 0 @@ -37,14 +43,13 @@ jobs: repository="${{ github.repository }}" echo "value=${repository##*/}" >> "$GITHUB_OUTPUT" - - uses: https://code.forgejo.org/actions/setup-node@v3 + - uses: https://data.forgejo.org/actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - - uses: https://code.forgejo.org/actions/setup-go@v4 + - uses: https://data.forgejo.org/actions/setup-go@v5 with: - go-version: "1.22" - check-latest: true + go-version-file: "go.mod" - name: version from ref id: release-info @@ -88,7 +93,7 @@ jobs: - name: cache node_modules id: node - uses: https://code.forgejo.org/actions/cache@v3 + uses: https://data.forgejo.org/actions/cache@v4 with: path: | node_modules @@ -159,7 +164,7 @@ jobs: - name: build container & release if: ${{ secrets.TOKEN != '' }} - uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v3 + uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.5 with: forgejo: "${{ env.GITHUB_SERVER_URL }}" owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" @@ -173,11 +178,12 @@ jobs: binary-name: forgejo binary-path: /app/gitea/gitea override: "${{ steps.release-info.outputs.override }}" + verify-labels: "maintainer=contact@forgejo.org,org.opencontainers.image.version=${{ steps.release-info.outputs.version }}" verbose: ${{ vars.VERBOSE || secrets.VERBOSE || 'false' }} - name: build rootless container if: ${{ secrets.TOKEN != '' }} - uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v3 + uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.5 with: forgejo: "${{ env.GITHUB_SERVER_URL }}" owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" @@ -190,11 +196,12 @@ jobs: suffix: -rootless dockerfile: Dockerfile.rootless override: "${{ steps.release-info.outputs.override }}" + verify-labels: "maintainer=contact@forgejo.org,org.opencontainers.image.version=${{ steps.release-info.outputs.version }}" verbose: ${{ vars.VERBOSE || secrets.VERBOSE || 'false' }} - name: end-to-end tests - if: ${{ secrets.TOKEN != '' && vars.ROLE == 'forgejo-integration' }} - uses: https://code.forgejo.org/actions/cascading-pr@v2 + if: ${{ secrets.TOKEN != '' && vars.ROLE == 'forgejo-integration' && vars.SKIP_END_TO_END != 'true' }} + uses: https://data.forgejo.org/actions/cascading-pr@v2.2.0 with: origin-url: ${{ env.GITHUB_SERVER_URL }} origin-repo: ${{ github.repository }} diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml index dcca2404d9..7c8c56de13 100644 --- a/.forgejo/workflows/cascade-setup-end-to-end.yml +++ b/.forgejo/workflows/cascade-setup-end-to-end.yml @@ -12,8 +12,10 @@ # whatever is in the default branch instead # # - after it is merged, double check it works by setting the -# run-end-to-end-test on a pull request (any pull request will doe +# run-end-to-end-test on a pull request (any pull request will do) # +name: issue-labels + on: push: branches: @@ -23,42 +25,23 @@ on: - labeled jobs: - info: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} - runs-on: docker - container: - image: node:20-bookworm - steps: - - name: event - run: | - echo github.event.pull_request.head.repo.fork = ${{ github.event.pull_request.head.repo.fork }} - echo github.event.action = ${{ github.event.action }} - echo github.event.pull_request.merged = ${{ github.event.pull_request.merged }} - echo github.event.pull_request.labels.*.name - cat <<'EOF' - ${{ toJSON(github.event.pull_request.labels.*.name) }} - EOF - cat <<'EOF' - ${{ toJSON(github.event) }} - EOF - cascade: if: > - !startsWith(vars.ROLE, 'forgejo-') && ( + vars.ROLE == 'forgejo-coding' && ( github.event_name == 'push' || ( - github.event.action == 'label_updated' && contains(github.event.pull_request.labels.*.name, 'run-end-to-end-tests') + github.event.action == 'label_updated' && github.event.label.name == 'run-end-to-end-tests' ) ) runs-on: docker container: - image: node:20-bookworm + image: data.forgejo.org/oci/node:22-bookworm steps: - - uses: actions/checkout@v4 + - uses: https://data.forgejo.org/actions/checkout@v4 with: fetch-depth: '0' show-progress: 'false' - - uses: actions/cascading-pr@v2 + - uses: https://data.forgejo.org/actions/cascading-pr@v2.2.0 with: origin-url: ${{ env.GITHUB_SERVER_URL }} origin-repo: ${{ github.repository }} diff --git a/.forgejo/workflows/e2e.yml b/.forgejo/workflows/e2e.yml deleted file mode 100644 index c1321b0a8e..0000000000 --- a/.forgejo/workflows/e2e.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: e2e - -on: - pull_request: - paths: - - Makefile - - .forgejo/workflows/e2e.yml - - tests/e2e/** - -jobs: - test-e2e: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} - runs-on: docker - container: - image: 'docker.io/node:20-bookworm' - steps: - - uses: https://code.forgejo.org/actions/checkout@v4 - - uses: https://code.forgejo.org/actions/setup-go@v4 - with: - go-version: "1.22" - check-latest: true - - run: | - apt-get -qq update - apt-get -qq install -q sudo - sed -i -e 's/%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers - git config --add safe.directory '*' - adduser --quiet --comment forgejo --disabled-password forgejo - adduser forgejo sudo - chown -R forgejo:forgejo . - - run: | - su forgejo -c 'make deps-frontend frontend deps-backend' - - run: | - su forgejo -c 'make generate test-e2e-sqlite' - timeout-minutes: 40 - env: - DEPS_PLAYWRIGHT: 1 - USE_REPO_TEST_DIR: 1 diff --git a/.forgejo/workflows/forgejo-integration-cleanup.yml b/.forgejo/workflows/forgejo-integration-cleanup.yml new file mode 100644 index 0000000000..d490e3b2f2 --- /dev/null +++ b/.forgejo/workflows/forgejo-integration-cleanup.yml @@ -0,0 +1,39 @@ +on: + workflow_dispatch: + + schedule: + - cron: '@daily' + +jobs: + integration-cleanup: + if: vars.ROLE == 'forgejo-integration' + runs-on: docker + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + steps: + + - name: apt install curl jq + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get -q install -qq -y curl jq + + - name: remove old releases and tags + run: | + url=https://any:${{ secrets.TOKEN }}@codeberg.org + curl -sS "$url/api/v1/repos/forgejo-integration/forgejo/releases" | jq -r '.[] | "\(.published_at) \(.tag_name)"' | sort | while read published_at version ; do + if echo $version | grep -e '-test$' >/dev/null; then + old="18 months" + else + old="1 day" + fi + too_old=$(env -i date --date="- $old" +%F) + too_old_seconds=$(env -i date --date="- $old" +%s) + published_at_seconds=$(env -i date --date="$published_at" +%s) + if test $published_at_seconds -le $too_old_seconds ; then + echo "$version was published more than $old ago ($published_at <= $too_old) and will be removed" + curl -X DELETE -sS "$url/api/v1/repos/forgejo-integration/forgejo/releases/tags/$version" + else + echo "$version was published less than $old ago" + fi + done diff --git a/.forgejo/workflows/merge-requirements.yml b/.forgejo/workflows/merge-requirements.yml new file mode 100644 index 0000000000..9aaf2af68d --- /dev/null +++ b/.forgejo/workflows/merge-requirements.yml @@ -0,0 +1,45 @@ +# Copyright 2024 The Forgejo Authors +# SPDX-License-Identifier: MIT + +name: requirements + +on: + pull_request: + types: + - labeled + - edited + - opened + - synchronize + +jobs: + merge-conditions: + if: vars.ROLE == 'forgejo-coding' + runs-on: docker + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + steps: + - name: Debug output + run: | + cat <<'EOF' + ${{ toJSON(github) }} + EOF + - name: Missing test label + if: > + !( + contains(toJSON(github.event.pull_request.labels), 'test/present') + || contains(toJSON(github.event.pull_request.labels), 'test/not-needed') + || contains(toJSON(github.event.pull_request.labels), 'test/manual') + ) + run: | + echo "A team member must set the label to either 'present', 'not-needed' or 'manual'." + exit 1 + - name: Missing manual test instructions + if: > + ( + contains(toJSON(github.event.pull_request.labels), 'test/manual') + && !contains(toJSON(github.event.pull_request.body), '# Test') + ) + run: | + echo "Manual test label is set. The PR description needs to contain test steps introduced by a heading like:" + echo "# Testing" + exit 1 diff --git a/.forgejo/workflows/milestone.yml b/.forgejo/workflows/milestone.yml new file mode 100644 index 0000000000..9a51c515d0 --- /dev/null +++ b/.forgejo/workflows/milestone.yml @@ -0,0 +1,24 @@ +# Copyright 2024 The Forgejo Authors +# SPDX-License-Identifier: MIT +# +name: milestone + +on: + pull_request_target: + types: + - closed + +jobs: + set: + if: vars.ROLE == 'forgejo-coding' && github.event.pull_request.merged + runs-on: docker + container: + image: 'data.forgejo.org/oci/ci:1' + steps: + - uses: https://data.forgejo.org/forgejo/set-milestone@v1.0.0 + with: + forgejo: https://codeberg.org + repository: forgejo/forgejo + token: ${{ secrets.SET_MILESTONE_TOKEN }} + pr-number: ${{ github.event.pull_request.number }} + verbose: ${{ vars.SET_MILESTONE_VERBOSE }} diff --git a/.forgejo/workflows/mirror.yml b/.forgejo/workflows/mirror.yml index 599c8c01ff..d45a2f6f77 100644 --- a/.forgejo/workflows/mirror.yml +++ b/.forgejo/workflows/mirror.yml @@ -1,6 +1,8 @@ name: mirror on: + workflow_dispatch: + schedule: - cron: '@daily' @@ -9,7 +11,7 @@ jobs: if: ${{ secrets.MIRROR_TOKEN != '' }} runs-on: docker container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/node:22-bookworm' steps: - name: git push {v*/,}forgejo run: | diff --git a/.forgejo/workflows/publish-release.yml b/.forgejo/workflows/publish-release.yml index 674c1c2704..3aec46fb03 100644 --- a/.forgejo/workflows/publish-release.yml +++ b/.forgejo/workflows/publish-release.yml @@ -1,6 +1,8 @@ # SPDX-License-Identifier: MIT # -# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process +# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process +# +# TOKEN_NEXT_DIGEST is a token with write repository access to https://invisible.forgejo.org/infrastructure/next-digest issued by https://invisible.forgejo.org/forgejo-next-digest # # https://codeberg.org/forgejo-experimental/forgejo # @@ -14,7 +16,7 @@ # vars.DOER: forgejo-experimental-ci # secrets.TOKEN: # -# http://private.forgejo.org/forgejo/forgejo +# http://invisible.forgejo.org/forgejo/forgejo # # Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo # @@ -36,20 +38,20 @@ on: jobs: publish: - runs-on: self-hosted + runs-on: lxc-bookworm if: vars.DOER != '' && vars.FORGEJO != '' && vars.TO_OWNER != '' && vars.FROM_OWNER != '' && secrets.TOKEN != '' steps: - - uses: actions/checkout@v3 + - uses: https://data.forgejo.org/actions/checkout@v4 - name: copy & sign - uses: https://code.forgejo.org/forgejo/forgejo-build-publish/publish@v4 + uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.3.5 with: from-forgejo: ${{ vars.FORGEJO }} to-forgejo: ${{ vars.FORGEJO }} from-owner: ${{ vars.FROM_OWNER }} to-owner: ${{ vars.TO_OWNER }} repo: ${{ vars.REPO }} - release-notes: "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#{ANCHOR}" + release-notes: "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/release-notes-published/{VERSION}.md" ref-name: ${{ github.ref_name }} sha: ${{ github.sha }} from-token: ${{ secrets.TOKEN }} @@ -59,21 +61,28 @@ jobs: gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} verbose: ${{ vars.VERBOSE }} + - name: get trigger mirror issue + id: mirror + uses: https://data.forgejo.org/infrastructure/issue-action/get@v1.3.0 + with: + forgejo: https://code.forgejo.org + repository: forgejo/forgejo + labels: mirror-trigger - - name: set up go for the DNS update below - if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' - uses: https://code.forgejo.org/actions/setup-go@v4 + - name: trigger the mirror + uses: https://data.forgejo.org/infrastructure/issue-action/set@v1.3.0 with: - go-version: "1.22" - check-latest: true - - name: update the _release.experimental DNS record - if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != '' - uses: https://code.forgejo.org/actions/ovh-dns-update@v1 + forgejo: https://code.forgejo.org + repository: forgejo/forgejo + token: ${{ secrets.LABEL_ISSUE_FORGEJO_MIRROR_TOKEN }} + numbers: ${{ steps.mirror.outputs.numbers }} + label-wait-if-exists: 3600 + label: trigger + + - name: upgrade v*.next.forgejo.org + uses: https://data.forgejo.org/infrastructure/next-digest@v1.1.0 with: - subdomain: _release.experimental - domain: forgejo.com # there is a CNAME from .org to .com (for security reasons) - record-id: 5283602601 - value: v=${{ github.ref_name }} - ovh-app-key: ${{ secrets.OVH_APP_KEY }} - ovh-app-secret: ${{ secrets.OVH_APP_SECRET }} - ovh-consumer-key: ${{ secrets.OVH_CON_KEY }} + url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@invisible.forgejo.org/infrastructure/next-digest + ref_name: '${{ github.ref_name }}' + image: 'codeberg.org/forgejo-experimental/forgejo' + tag_suffix: '-rootless' diff --git a/.forgejo/workflows/release-notes-assistant-milestones.yml b/.forgejo/workflows/release-notes-assistant-milestones.yml new file mode 100644 index 0000000000..7f77098357 --- /dev/null +++ b/.forgejo/workflows/release-notes-assistant-milestones.yml @@ -0,0 +1,36 @@ +on: + workflow_dispatch: + + schedule: + - cron: '@daily' + +env: + RNA_VERSION: v1.2.5 # renovate: datasource=gitea-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org + +jobs: + release-notes: + if: vars.ROLE == 'forgejo-coding' + runs-on: docker + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + + - uses: https://data.forgejo.org/actions/setup-go@v5 + with: + go-version-file: "go.mod" + cache: false + + - name: apt install jq + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get -q install -y -qq jq + + - name: update open milestones + run: | + set -x + curl -sS $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/milestones?state=open | jq -r '.[] | .title' | while read forgejo version ; do + milestone="$forgejo $version" + go run code.forgejo.org/forgejo/release-notes-assistant@$RNA_VERSION --config .release-notes-assistant.yaml --storage milestone --storage-location "$milestone" --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} release $version + done diff --git a/.forgejo/workflows/release-notes-assistant.yml b/.forgejo/workflows/release-notes-assistant.yml new file mode 100644 index 0000000000..cdcd2e6fe4 --- /dev/null +++ b/.forgejo/workflows/release-notes-assistant.yml @@ -0,0 +1,44 @@ +name: issue-labels + +on: + pull_request_target: + types: + - edited + - synchronize + - labeled + +env: + RNA_VERSION: v1.2.5 # renovate: datasource=gitea-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org + +jobs: + release-notes: + if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note') + runs-on: docker + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + + - name: event + run: | + cat <<'EOF' + ${{ toJSON(github.event.pull_request.labels.*.name) }} + EOF + cat <<'EOF' + ${{ toJSON(github.event) }} + EOF + + - uses: https://data.forgejo.org/actions/setup-go@v5 + with: + go-version-file: "go.mod" + cache: false + + - name: apt install jq + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update -qq + apt-get -q install -y -qq jq + + - name: release-notes-assistant preview + run: | + go run code.forgejo.org/forgejo/release-notes-assistant@$RNA_VERSION --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }} diff --git a/.forgejo/workflows/renovate.yml b/.forgejo/workflows/renovate.yml index 1a5cc15188..729cba3723 100644 --- a/.forgejo/workflows/renovate.yml +++ b/.forgejo/workflows/renovate.yml @@ -1,34 +1,49 @@ +# +# Runs every 2 hours, but Renovate is limited to create new PR before 4am. +# See renovate.json for more settings. +# Automerge is enabled for Renovate PR's but need to be approved before. +# name: renovate on: push: branches: - - 'renovate/**' # self-test updates + - renovate/** # self-test updates + paths: + - .forgejo/workflows/renovate.yml schedule: - - cron: '*/30 * * * *' + - cron: '0 0/2 * * *' + workflow_dispatch: env: RENOVATE_DRY_RUN: ${{ (github.event_name != 'schedule' && github.ref_name != github.event.repository.default_branch) && 'full' || '' }} RENOVATE_REPOSITORIES: ${{ github.repository }} + # fix because 10.0.0-58-7e1df53+gitea-1.22.0 < 10.0.0 for semver + # and codeberg api returns such versions from `git describe --tags` + # RENOVATE_X_PLATFORM_VERSION: 10.0.0+gitea-1.22.0 currently not needed jobs: renovate: - if: ${{ secrets.RENOVATE_TOKEN != '' }} + if: vars.ROLE == 'forgejo-coding' && secrets.RENOVATE_TOKEN != '' runs-on: docker container: - image: ghcr.io/visualon/renovate:37.272.0 + image: data.forgejo.org/renovate/renovate:41.17.2 steps: - - uses: https://code.forgejo.org/actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + - name: Load renovate repo cache + uses: https://data.forgejo.org/actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: | .tmp/cache/renovate/repository + .tmp/cache/renovate/renovate-cache-sqlite + .tmp/osv key: repo-cache-${{ github.run_id }} restore-keys: | repo-cache- - - run: renovate + - name: Run renovate + run: renovate env: GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_COM_TOKEN }} LOG_LEVEL: debug @@ -39,15 +54,21 @@ jobs: RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} RENOVATE_GIT_AUTHOR: 'Renovate Bot ' + RENOVATE_X_SQLITE_PACKAGE_CACHE: true + GIT_AUTHOR_NAME: 'Renovate Bot' GIT_AUTHOR_EMAIL: 'forgejo-renovate-action@forgejo.org' GIT_COMMITTER_NAME: 'Renovate Bot' GIT_COMMITTER_EMAIL: 'forgejo-renovate-action@forgejo.org' + OSV_OFFLINE_ROOT_DIR: ${{ github.workspace }}/.tmp/osv + - name: Save renovate repo cache - if: always() && env.RENOVATE_DRY_RUN == 'true' - uses: https://code.forgejo.org/actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + if: always() && env.RENOVATE_DRY_RUN != 'full' + uses: https://data.forgejo.org/actions/cache/save@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 with: path: | .tmp/cache/renovate/repository + .tmp/cache/renovate/renovate-cache-sqlite + .tmp/osv key: repo-cache-${{ github.run_id }} diff --git a/.forgejo/workflows/testing-integration.yml b/.forgejo/workflows/testing-integration.yml new file mode 100644 index 0000000000..102a2d9774 --- /dev/null +++ b/.forgejo/workflows/testing-integration.yml @@ -0,0 +1,65 @@ +# +# Additional integration tests designed to run once a day when +# `mirror.yml` pushes to https://codeberg.org/forgejo-integration/forgejo +# and send a notification via email should they fail. +# +# For debug purposes: +# +# - uncomment [on].pull_request +# - swap 'forgejo-integration' and 'forgejo-coding' +# - open a pull request at https://codeberg.org/forgejo/forgejo and fix things +# - swap 'forgejo-integration' and 'forgejo-coding' +# - comment [on].pull_request +# + +name: testing-integration + +on: +# pull_request: + push: + tags: 'v[0-9]+.[0-9]+.*' + branches: + - 'forgejo' + - 'v*/forgejo' + +jobs: + test-unit: +# if: vars.ROLE == 'forgejo-coding' + if: vars.ROLE == 'forgejo-integration' + runs-on: docker + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env + - name: install git 2.34.1 and git-lfs 3.0.2 + uses: ./.forgejo/workflows-composite/install-minimum-git-version + - uses: ./.forgejo/workflows-composite/build-backend + - run: | + su forgejo -c 'make test-backend test-check' + timeout-minutes: 120 + env: + RACE_ENABLED: 'true' + TAGS: bindata + test-sqlite: +# if: vars.ROLE == 'forgejo-coding' + if: vars.ROLE == 'forgejo-integration' + runs-on: docker + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env + - name: install git 2.34.1 and git-lfs 3.0.2 + uses: ./.forgejo/workflows-composite/install-minimum-git-version + - uses: ./.forgejo/workflows-composite/build-backend + - run: | + su forgejo -c 'make test-sqlite-migration test-sqlite' + timeout-minutes: 120 + env: + TAGS: sqlite sqlite_unlock_notify + RACE_ENABLED: true + TEST_TAGS: sqlite sqlite_unlock_notify + USE_REPO_TEST_DIR: 1 diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index f40cf1ed83..7a93bb66a8 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -6,206 +6,289 @@ on: branches: - 'forgejo*' - 'v*/forgejo*' + workflow_dispatch: jobs: backend-checks: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime steps: - - uses: https://code.forgejo.org/actions/checkout@v3 - - uses: https://code.forgejo.org/actions/setup-go@v4 - with: - go-version: "1.22" - check-latest: true - - run: make deps-backend deps-tools - - run: make --always-make -j$(nproc) lint-backend checks-backend # ensure the "go-licenses" make target runs + - name: event info + run: | + cat <<'EOF' + ${{ toJSON(github) }} + EOF + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env + - run: su forgejo -c 'make deps-backend deps-tools' + - run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check lint-swagger fmt-check swagger-validate' # ensure the "go-licenses" make target runs + - uses: ./.forgejo/workflows-composite/build-backend frontend-checks: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime steps: - - uses: https://code.forgejo.org/actions/checkout@v3 + - uses: https://data.forgejo.org/actions/checkout@v4 - run: make deps-frontend - run: make lint-frontend - run: make checks-frontend - - run: make test-frontend + - run: make test-frontend-coverage - run: make frontend + - name: Install zstd for cache saving + # works around https://github.com/actions/cache/issues/1169, because the + # consuming job has zstd and doesn't restore the cache otherwise + run: | + apt-get update -qq + apt-get -q install -qq -y zstd + - name: "Cache frontend build for playwright testing" + uses: https://data.forgejo.org/actions/cache/save@v4 + with: + path: ${{github.workspace}}/public/assets + key: frontend-build-${{ github.sha }} test-unit: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime services: + elasticsearch: + image: data.forgejo.org/oci/bitnami/elasticsearch:7 + options: --tmpfs /bitnami/elasticsearch/data + env: + discovery.type: single-node + ES_JAVA_OPTS: "-Xms512m -Xmx512m" minio: - image: bitnami/minio:2024.2.26 + image: data.forgejo.org/oci/bitnami/minio:2024.8.17 options: >- - --hostname gitea.minio + --hostname gitea.minio --tmpfs /bitnami/minio/data:noatime env: MINIO_DOMAIN: minio MINIO_ROOT_USER: 123456 MINIO_ROOT_PASSWORD: 12345678 steps: - - uses: https://code.forgejo.org/actions/checkout@v3 - - uses: https://code.forgejo.org/actions/setup-go@v4 - with: - go-version: "1.22" - - run: | - git config --add safe.directory '*' - adduser --quiet --comment forgejo --disabled-password forgejo - chown -R forgejo:forgejo . + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env - name: install git >= 2.42 + uses: ./.forgejo/workflows-composite/apt-install-from + with: + packages: git + - name: test release-notes-assistant.sh run: | - export DEBIAN_FRONTEND=noninteractive - echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list - apt-get update -qq - apt-get -q install -qq -y git - rm /etc/apt/sources.list.d/testing.list - apt-get update -qq - - run: | - su forgejo -c 'make deps-backend' - - run: | - su forgejo -c 'make backend' - env: - TAGS: bindata + apt-get -q install -qq -y jq + ./release-notes-assistant.sh test_main + - uses: ./.forgejo/workflows-composite/build-backend - run: | su forgejo -c 'make test-backend test-check' - timeout-minutes: 50 + timeout-minutes: 120 env: RACE_ENABLED: 'true' TAGS: bindata - test-mysql: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + TEST_ELASTICSEARCH_URL: http://elasticsearch:9200 + TEST_MINIO_ENDPOINT: minio:9000 + test-e2e: + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/playwright:latest' + options: --tmpfs /tmp:exec,noatime + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + with: + fetch-depth: 20 + - uses: ./.forgejo/workflows-composite/setup-env + - name: "Restore frontend build" + uses: https://data.forgejo.org/actions/cache/restore@v4 + id: cache-frontend + with: + path: ${{github.workspace}}/public/assets + key: frontend-build-${{ github.sha }} + - name: "Build frontend (if not cached)" + if: steps.cache-frontend.outputs.cache-hit != 'true' + run: | + su forgejo -c 'make deps-frontend frontend' + - uses: ./.forgejo/workflows-composite/build-backend + - name: Decide to run all tests + id: run-all + if: contains(github.event.pull_request.labels.*.name, 'run-all-playwright-tests') || contains(github.event.pull_request.title, 'playwright') + run: | + echo "all=1" >> "$GITHUB_OUTPUT" + - name: Get changed files + id: changed-files + uses: https://data.forgejo.org/tj-actions/changed-files@v46 + with: + separator: '\n' + - run: | + su forgejo -c 'make generate test-e2e-sqlite' + timeout-minutes: 120 + env: + USE_REPO_TEST_DIR: 1 + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 + CHANGED_FILES: ${{steps.changed-files.outputs.all_changed_files}} + RUN_ALL: ${{steps.run-all.all}} + - name: Upload test artifacts on failure + if: failure() + uses: https://data.forgejo.org/forgejo/upload-artifact@v4 + with: + name: test-artifacts.zip + path: tests/e2e/test-artifacts/ + retention-days: 3 + test-remote-cacher: + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + runs-on: docker + needs: [backend-checks, frontend-checks, test-unit] + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime + name: ${{ format('test-remote-cacher ({0})', matrix.cacher.name) }} + strategy: + matrix: + cacher: + - name: redis + image: data.forgejo.org/oci/bitnami/redis:7.2 + options: --tmpfs /bitnami/redis/data:noatime + - name: redict + image: registry.redict.io/redict:7.3.0-scratch + options: --tmpfs /data:noatime + - name: valkey + image: data.forgejo.org/oci/bitnami/valkey:7.2 + options: --tmpfs /bitnami/redis/data:noatime + - name: garnet + image: ghcr.io/microsoft/garnet-alpine:1.0.14 + options: --tmpfs /data:noatime + services: + cacher: + image: ${{ matrix.cacher.image }} + options: ${{ matrix.cacher.options }} + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env + - name: install git >= 2.42 + uses: ./.forgejo/workflows-composite/apt-install-from + with: + packages: git + - uses: ./.forgejo/workflows-composite/build-backend + - run: | + su forgejo -c 'make test-remote-cacher test-check' + timeout-minutes: 120 + env: + RACE_ENABLED: 'true' + TAGS: bindata + TEST_REDIS_SERVER: cacher:${{ matrix.cacher.port }} + test-mysql: + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + runs-on: docker + needs: [backend-checks, frontend-checks] + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime services: mysql: - image: 'docker.io/mysql:8-debian' + image: 'data.forgejo.org/oci/bitnami/mysql:8.4' env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes + ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: testgitea - # - # See also https://codeberg.org/forgejo/forgejo/issues/976 - # - cmd: ['mysqld', '--innodb-adaptive-flushing=OFF', '--innodb-buffer-pool-size=4G', '--innodb-log-buffer-size=128M', '--innodb-flush-log-at-trx-commit=0', '--innodb-flush-log-at-timeout=30', '--innodb-flush-method=nosync', '--innodb-fsync-threshold=1000000000'] + # + # See also https://codeberg.org/forgejo/forgejo/issues/976 + # + MYSQL_EXTRA_FLAGS: --innodb-adaptive-flushing=OFF --innodb-buffer-pool-size=4G --innodb-log-buffer-size=128M --innodb-flush-log-at-trx-commit=0 --innodb-flush-log-at-timeout=30 --innodb-flush-method=nosync --innodb-fsync-threshold=1000000000 --disable-log-bin + options: --tmpfs /bitnami/mysql/data:noatime steps: - - uses: https://code.forgejo.org/actions/checkout@v3 - - uses: https://code.forgejo.org/actions/setup-go@v4 - with: - go-version: "1.22" + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env - name: install dependencies & git >= 2.42 - run: | - export DEBIAN_FRONTEND=noninteractive - echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list - apt-get update -qq - apt-get install --no-install-recommends -qq -y git git-lfs - rm /etc/apt/sources.list.d/testing.list - apt-get update -qq - - name: setup user and permissions - run: | - git config --add safe.directory '*' - adduser --quiet --comment forgejo --disabled-password forgejo - chown -R forgejo:forgejo . - - run: | - su forgejo -c 'make deps-backend' - - run: | - su forgejo -c 'make backend' - env: - TAGS: bindata + uses: ./.forgejo/workflows-composite/apt-install-from + with: + packages: git git-lfs + - uses: ./.forgejo/workflows-composite/build-backend - run: | su forgejo -c 'make test-mysql-migration test-mysql' - timeout-minutes: 50 + timeout-minutes: 120 env: - TAGS: bindata USE_REPO_TEST_DIR: 1 test-pgsql: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime services: minio: - image: bitnami/minio:2024.2.26 + image: data.forgejo.org/oci/bitnami/minio:2024.8.17 env: MINIO_ROOT_USER: 123456 MINIO_ROOT_PASSWORD: 12345678 + options: --tmpfs /bitnami/minio/data + ldap: + image: data.forgejo.org/oci/test-openldap:latest pgsql: - image: 'docker.io/postgres:15' + image: data.forgejo.org/oci/bitnami/postgresql:16 env: - POSTGRES_DB: test - POSTGRES_PASSWORD: postgres + POSTGRESQL_DATABASE: test + POSTGRESQL_PASSWORD: postgres + POSTGRESQL_FSYNC: off + POSTGRESQL_EXTRA_FLAGS: -c full_page_writes=off + options: --tmpfs /bitnami/postgresql steps: - - uses: https://code.forgejo.org/actions/checkout@v3 - - uses: https://code.forgejo.org/actions/setup-go@v4 - with: - go-version: "1.22" + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env - name: install dependencies & git >= 2.42 - run: | - export DEBIAN_FRONTEND=noninteractive - echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list - apt-get update -qq - apt-get install --no-install-recommends -qq -y git git-lfs - rm /etc/apt/sources.list.d/testing.list - apt-get update -qq - - name: setup user and permissions - run: | - git config --add safe.directory '*' - adduser --quiet --comment forgejo --disabled-password forgejo - chown -R forgejo:forgejo . - - run: | - su forgejo -c 'make deps-backend' - - run: | - su forgejo -c 'make backend' - env: - TAGS: bindata + uses: ./.forgejo/workflows-composite/apt-install-from + with: + packages: git git-lfs + - uses: ./.forgejo/workflows-composite/build-backend - run: | su forgejo -c 'make test-pgsql-migration test-pgsql' - timeout-minutes: 50 + timeout-minutes: 120 env: - TAGS: bindata RACE_ENABLED: true USE_REPO_TEST_DIR: 1 + TEST_LDAP: 1 test-sqlite: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: - image: 'docker.io/node:20-bookworm' + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime steps: - - uses: https://code.forgejo.org/actions/checkout@v3 - - uses: https://code.forgejo.org/actions/setup-go@v4 - with: - go-version: "1.22" + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env - name: install dependencies & git >= 2.42 - run: | - export DEBIAN_FRONTEND=noninteractive - echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list - apt-get update -qq - apt-get install --no-install-recommends -qq -y git git-lfs - rm /etc/apt/sources.list.d/testing.list - apt-get update -qq - - name: setup user and permissions - run: | - git config --add safe.directory '*' - adduser --quiet --comment forgejo --disabled-password forgejo - chown -R forgejo:forgejo . - - run: | - su forgejo -c 'make deps-backend' - - run: | - su forgejo -c 'make backend' - env: - TAGS: bindata sqlite sqlite_unlock_notify + uses: ./.forgejo/workflows-composite/apt-install-from + with: + packages: git git-lfs + - uses: ./.forgejo/workflows-composite/build-backend - run: | su forgejo -c 'make test-sqlite-migration test-sqlite' - timeout-minutes: 50 + timeout-minutes: 120 env: - TAGS: bindata sqlite sqlite_unlock_notify + TAGS: sqlite sqlite_unlock_notify RACE_ENABLED: true TEST_TAGS: sqlite sqlite_unlock_notify USE_REPO_TEST_DIR: 1 + security-check: + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' + runs-on: docker + needs: + - test-sqlite + - test-pgsql + - test-mysql + - test-remote-cacher + - test-unit + container: + image: 'data.forgejo.org/oci/node:22-bookworm' + options: --tmpfs /tmp:exec,noatime + steps: + - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: ./.forgejo/workflows-composite/setup-env + - run: su forgejo -c 'make deps-backend deps-tools' + - run: su forgejo -c 'make security-check' diff --git a/.gitattributes b/.gitattributes index 51131c7d83..4e748c071a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ * text=auto eol=lf *.tmpl linguist-language=go-html-template +*.pb.go linguist-generated /assets/*.json linguist-generated /public/assets/img/svg/*.svg linguist-generated /templates/swagger/v1_json.tmpl linguist-generated diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md deleted file mode 100644 index 00b874fd5b..0000000000 --- a/.gitea/pull_request_template.md +++ /dev/null @@ -1,13 +0,0 @@ ---- - -name: "Pull Request Template" -about: "Template for all Pull Requests" -labels: - -- test/needed - ---- - diff --git a/.gitignore b/.gitignore index b883e079d1..744e24a09a 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ _testmain.go *coverage.out coverage.all +coverage/ cpu.out /modules/migration/bindata.go @@ -56,6 +57,7 @@ cpu.out /gitea-vet /debug /integrations.test +/forgejo /bin /dist @@ -72,6 +74,7 @@ cpu.out /tests/e2e/reports /tests/e2e/test-artifacts /tests/e2e/test-snapshots +/tests/e2e/.auth /tests/*.ini /tests/**/*.git/**/*.sample /node_modules @@ -83,7 +86,6 @@ cpu.out /public/assets/css /public/assets/fonts /public/assets/licenses.txt -/public/assets/img/webpack /vendor /web_src/fomantic/node_modules /web_src/fomantic/build/* @@ -102,6 +104,9 @@ cpu.out /.go-licenses /.cur-deadcode-out +# Files and folders that were previously generated +/public/assets/img/webpack + # Snapcraft /gitea_a*.txt snap/.snapcraft/ @@ -113,6 +118,12 @@ prime/ *_source.tar.bz2 .DS_Store +# Direnv configuration +/.envrc + +# nix-direnv generated files +.direnv/ + # Make evidence files /.make_evidence diff --git a/.gitmodules b/.gitmodules index f5796e6e31..e69de29bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "manual-testing"] - path = manual-testing - url = https://codeberg.org/forgejo/forgejo-manual-testing diff --git a/.gitpod.yml b/.gitpod.yml index f573d55a76..8671edc47c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -43,7 +43,7 @@ vscode: - Vue.volar - ms-azuretools.vscode-docker - vitest.explorer - - qwtel.sqlite-viewer + - cweijan.vscode-database-client2 - GitHub.vscode-pull-request-github ports: diff --git a/.golangci.yml b/.golangci.yml index 6d52f99401..532132838d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,136 +1,165 @@ +version: "2" +output: + sort-order: + - file linters: + default: none enable: - bidichk - # - deadcode # deprecated - https://github.com/golangci/golangci-lint/issues/1841 - depguard - dupl - errcheck - forbidigo - gocritic - # - gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time. - - gofmt - - gofumpt - - gosimple - govet - ineffassign - nakedret - nolintlint - revive - staticcheck - # - structcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841 - - stylecheck - - typecheck + - testifylint - unconvert + - unparam - unused - # - varcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841 + - usetesting - wastedassign - enable-all: false - disable-all: true - fast: false - -run: - timeout: 10m - skip-dirs: - - node_modules - - public - - web_src - -linters-settings: - stylecheck: - checks: ["all", "-ST1005", "-ST1003"] - nakedret: - max-func-lines: 0 - gocritic: - disabled-checks: - - ifElseChain - - singleCaseSwitch # Every time this occurred in the code, there was no other way. - revive: - ignore-generated-header: false - severity: warning - confidence: 0.8 - errorCode: 1 - warningCode: 1 + settings: + depguard: + rules: + main: + deny: + - pkg: encoding/json + desc: use gitea's modules/json instead of encoding/json + - pkg: github.com/unknwon/com + desc: use gitea's util and replacements + - pkg: io/ioutil + desc: use os or io instead + - pkg: golang.org/x/exp + desc: it's experimental and unreliable + - pkg: forgejo.org/modules/git/internal + desc: do not use the internal package, use AddXxx function instead + - pkg: gopkg.in/ini.v1 + desc: do not use the ini package, use gitea's config system instead + - pkg: github.com/minio/sha256-simd + desc: use crypto/sha256 instead, see https://codeberg.org/forgejo/forgejo/pulls/1528 + gocritic: + disabled-checks: + - ifElseChain + revive: + severity: error + rules: + - name: atomic + - name: bare-return + - name: blank-imports + - name: constant-logical-expr + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: duplicated-imports + - name: empty-lines + - name: error-naming + - name: error-return + - name: error-strings + - name: errorf + - name: exported + - name: identical-branches + - name: if-return + - name: increment-decrement + - name: indent-error-flow + - name: modifies-value-receiver + - name: package-comments + - name: range + - name: receiver-naming + - name: redefines-builtin-id + - name: string-of-int + - name: superfluous-else + - name: time-naming + - name: unconditional-recursion + - name: unexported-return + - name: unreachable-code + - name: var-declaration + - name: var-naming + - name: redefines-builtin-id + disabled: true + staticcheck: + checks: + - all + testifylint: + disable: + - go-require + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling rules: - - name: blank-imports - - name: context-as-argument - - name: context-keys-type - - name: dot-imports - - name: error-return - - name: error-strings - - name: error-naming - - name: exported - - name: if-return - - name: increment-decrement - - name: var-naming - - name: var-declaration - - name: package-comments - - name: range - - name: receiver-naming - - name: time-naming - - name: unexported-return - - name: indent-error-flow - - name: errorf - - name: duplicated-imports - - name: modifies-value-receiver - gofumpt: - extra-rules: true - depguard: - rules: - main: - deny: - - pkg: encoding/json - desc: use gitea's modules/json instead of encoding/json - - pkg: github.com/unknwon/com - desc: use gitea's util and replacements - - pkg: io/ioutil - desc: use os or io instead - - pkg: golang.org/x/exp - desc: it's experimental and unreliable - - pkg: code.gitea.io/gitea/modules/git/internal - desc: do not use the internal package, use AddXxx function instead - - pkg: gopkg.in/ini.v1 - desc: do not use the ini package, use gitea's config system instead - - pkg: github.com/minio/sha256-simd - desc: use crypto/sha256 instead, see https://codeberg.org/forgejo/forgejo/pulls/1528 - + - linters: + - nolintlint + path: models/db/sql_postgres_with_schema.go + - linters: + - dupl + - errcheck + - gocyclo + - gosec + - staticcheck + - unparam + path: _test\.go + - linters: + - dupl + - errcheck + - gocyclo + - gosec + path: models/migrations/v + - linters: + - forbidigo + path: cmd + - linters: + - dupl + text: (?i)webhook + - linters: + - gocritic + text: (?i)`ID' should not be capitalized + - linters: + - deadcode + - unused + text: (?i)swagger + - linters: + - staticcheck + text: (?i)argument x is overwritten before first use + - linters: + - gocritic + text: '(?i)commentFormatting: put a space between `//` and comment text' + - linters: + - gocritic + text: '(?i)exitAfterDefer:' + - linters: + - staticcheck + text: "(ST1005|ST1003|QF1001):" + paths: + - node_modules + - public + - web_src + - third_party$ + - builtin$ + - examples$ issues: max-issues-per-linter: 0 max-same-issues: 0 - exclude-rules: - # Exclude some linters from running on tests files. - - path: _test\.go - linters: - - gocyclo - - errcheck - - dupl - - gosec - - unparam - - staticcheck - - path: models/migrations/v - linters: - - gocyclo - - errcheck - - dupl - - gosec - - path: cmd - linters: - - forbidigo - - linters: - - dupl - text: "webhook" - - linters: - - gocritic - text: "`ID' should not be capitalized" - - linters: - - unused - - deadcode - text: "swagger" - - linters: - - staticcheck - text: "argument x is overwritten before first use" - - text: "commentFormatting: put a space between `//` and comment text" - linters: - - gocritic - - text: "exitAfterDefer:" - linters: - - gocritic +formatters: + enable: + - gofmt + - gofumpt + settings: + gofumpt: + extra-rules: true + exclusions: + generated: lax + paths: + - node_modules + - public + - web_src + - third_party$ + - builtin$ + - examples$ diff --git a/.ignore b/.ignore index 5c945ab981..5b96dabd38 100644 --- a/.ignore +++ b/.ignore @@ -4,6 +4,8 @@ /modules/options/bindata.go /modules/public/bindata.go /modules/templates/bindata.go -/vendor +/options/gitignore +/options/license /public/assets +/vendor node_modules diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000000..88ff1591a4 --- /dev/null +++ b/.mailmap @@ -0,0 +1,2 @@ +Unknwon +Unknwon ๆ— ้—ป diff --git a/.release-notes-assistant.yaml b/.release-notes-assistant.yaml new file mode 100644 index 0000000000..b3e5a8e665 --- /dev/null +++ b/.release-notes-assistant.yaml @@ -0,0 +1,27 @@ +categorize: './release-notes-assistant.sh' +branch-development: 'forgejo' +branch-pattern: 'v*/forgejo' +branch-find-version: 'v(?P\d+\.\d+)/forgejo' +branch-to-version: '${version}.0' +branch-from-version: 'v%[1]d.%[2]d/forgejo' +tag-from-version: 'v%[1]d.%[2]d.%[3]d' +branch-known: + - 'v7.0/forgejo' +cleanup-line: 'sed -Ee "s/^(feat|fix):\s*//g" -e "s/^\[WIP\] //" -e "s/^WIP: //" -e "s;\[(UI|BUG|FEAT|v.*?/forgejo)\]\s*;;g"' +render-header: | + + ## Release notes +comment: | +
+ Where does that come from? + The following is a preview of the release notes for this pull request, as they will appear in the upcoming release. They are derived from the content of the `%[2]s/%[3]s.md` file, if it exists, or the title of the pull request. They were also added at the bottom of the description of this pull request for easier reference. + + This message and the release notes originate from a call to the [release-notes-assistant](https://code.forgejo.org/forgejo/release-notes-assistant). + + ```diff + %[4]s + ``` + +
+ + %[1]s diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml deleted file mode 100644 index 60cce7dbf7..0000000000 --- a/.stylelintrc.yaml +++ /dev/null @@ -1,223 +0,0 @@ -plugins: - - stylelint-declaration-strict-value - - stylelint-declaration-block-no-ignored-properties - - "@stylistic/stylelint-plugin" - -ignoreFiles: - - "**/*.go" - -overrides: - - files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console.css", "font_i18n.css"] - rules: - scale-unlimited/declaration-strict-value: null - - files: ["**/chroma/*", "**/codemirror/*"] - rules: - block-no-empty: null - - files: ["**/*.vue"] - customSyntax: postcss-html - -rules: - "@stylistic/at-rule-name-case": null - "@stylistic/at-rule-name-newline-after": null - "@stylistic/at-rule-name-space-after": null - "@stylistic/at-rule-semicolon-newline-after": null - "@stylistic/at-rule-semicolon-space-before": null - "@stylistic/block-closing-brace-empty-line-before": null - "@stylistic/block-closing-brace-newline-after": null - "@stylistic/block-closing-brace-newline-before": null - "@stylistic/block-closing-brace-space-after": null - "@stylistic/block-closing-brace-space-before": null - "@stylistic/block-opening-brace-newline-after": null - "@stylistic/block-opening-brace-newline-before": null - "@stylistic/block-opening-brace-space-after": null - "@stylistic/block-opening-brace-space-before": always - "@stylistic/color-hex-case": lower - "@stylistic/declaration-bang-space-after": never - "@stylistic/declaration-bang-space-before": null - "@stylistic/declaration-block-semicolon-newline-after": null - "@stylistic/declaration-block-semicolon-newline-before": null - "@stylistic/declaration-block-semicolon-space-after": null - "@stylistic/declaration-block-semicolon-space-before": never - "@stylistic/declaration-block-trailing-semicolon": null - "@stylistic/declaration-colon-newline-after": null - "@stylistic/declaration-colon-space-after": null - "@stylistic/declaration-colon-space-before": never - "@stylistic/function-comma-newline-after": null - "@stylistic/function-comma-newline-before": null - "@stylistic/function-comma-space-after": null - "@stylistic/function-comma-space-before": null - "@stylistic/function-max-empty-lines": 0 - "@stylistic/function-parentheses-newline-inside": never-multi-line - "@stylistic/function-parentheses-space-inside": null - "@stylistic/function-whitespace-after": null - "@stylistic/indentation": 2 - "@stylistic/linebreaks": null - "@stylistic/max-empty-lines": 1 - "@stylistic/max-line-length": null - "@stylistic/media-feature-colon-space-after": null - "@stylistic/media-feature-colon-space-before": never - "@stylistic/media-feature-name-case": null - "@stylistic/media-feature-parentheses-space-inside": null - "@stylistic/media-feature-range-operator-space-after": always - "@stylistic/media-feature-range-operator-space-before": always - "@stylistic/media-query-list-comma-newline-after": null - "@stylistic/media-query-list-comma-newline-before": null - "@stylistic/media-query-list-comma-space-after": null - "@stylistic/media-query-list-comma-space-before": null - "@stylistic/named-grid-areas-alignment": null - "@stylistic/no-empty-first-line": null - "@stylistic/no-eol-whitespace": true - "@stylistic/no-extra-semicolons": true - "@stylistic/no-missing-end-of-source-newline": null - "@stylistic/number-leading-zero": null - "@stylistic/number-no-trailing-zeros": null - "@stylistic/property-case": lower - "@stylistic/selector-attribute-brackets-space-inside": null - "@stylistic/selector-attribute-operator-space-after": null - "@stylistic/selector-attribute-operator-space-before": null - "@stylistic/selector-combinator-space-after": null - "@stylistic/selector-combinator-space-before": null - "@stylistic/selector-descendant-combinator-no-non-space": null - "@stylistic/selector-list-comma-newline-after": null - "@stylistic/selector-list-comma-newline-before": null - "@stylistic/selector-list-comma-space-after": always-single-line - "@stylistic/selector-list-comma-space-before": never-single-line - "@stylistic/selector-max-empty-lines": 0 - "@stylistic/selector-pseudo-class-case": lower - "@stylistic/selector-pseudo-class-parentheses-space-inside": never - "@stylistic/selector-pseudo-element-case": lower - "@stylistic/string-quotes": double - "@stylistic/unicode-bom": null - "@stylistic/unit-case": lower - "@stylistic/value-list-comma-newline-after": null - "@stylistic/value-list-comma-newline-before": null - "@stylistic/value-list-comma-space-after": null - "@stylistic/value-list-comma-space-before": null - "@stylistic/value-list-max-empty-lines": 0 - alpha-value-notation: null - annotation-no-unknown: true - at-rule-allowed-list: null - at-rule-disallowed-list: null - at-rule-empty-line-before: null - at-rule-no-unknown: [true, {ignoreAtRules: [tailwind]}] - at-rule-no-vendor-prefix: true - at-rule-property-required-list: null - block-no-empty: true - color-function-notation: null - color-hex-alpha: null - color-hex-length: null - color-named: null - color-no-hex: null - color-no-invalid-hex: true - comment-empty-line-before: null - comment-no-empty: true - comment-pattern: null - comment-whitespace-inside: null - comment-word-disallowed-list: null - custom-media-pattern: null - custom-property-empty-line-before: null - custom-property-no-missing-var-function: true - custom-property-pattern: null - declaration-block-no-duplicate-custom-properties: true - declaration-block-no-duplicate-properties: [true, {ignore: [consecutive-duplicates-with-different-values]}] - declaration-block-no-redundant-longhand-properties: null - declaration-block-no-shorthand-property-overrides: null - declaration-block-single-line-max-declarations: null - declaration-empty-line-before: null - declaration-no-important: null - declaration-property-max-values: null - declaration-property-unit-allowed-list: null - declaration-property-unit-disallowed-list: {line-height: [em]} - declaration-property-value-allowed-list: null - declaration-property-value-disallowed-list: null - declaration-property-value-no-unknown: true - font-family-name-quotes: always-where-recommended - font-family-no-duplicate-names: true - font-family-no-missing-generic-family-keyword: true - font-weight-notation: null - function-allowed-list: null - function-calc-no-unspaced-operator: true - function-disallowed-list: null - function-linear-gradient-no-nonstandard-direction: true - function-name-case: lower - function-no-unknown: true - function-url-no-scheme-relative: null - function-url-quotes: always - function-url-scheme-allowed-list: null - function-url-scheme-disallowed-list: null - hue-degree-notation: null - import-notation: string - keyframe-block-no-duplicate-selectors: true - keyframe-declaration-no-important: true - keyframe-selector-notation: null - keyframes-name-pattern: null - length-zero-no-unit: [true, ignore: [custom-properties], ignoreFunctions: [var]] - max-nesting-depth: null - media-feature-name-allowed-list: null - media-feature-name-disallowed-list: null - media-feature-name-no-unknown: true - media-feature-name-no-vendor-prefix: true - media-feature-name-unit-allowed-list: null - media-feature-name-value-allowed-list: null - media-feature-name-value-no-unknown: true - media-feature-range-notation: null - media-query-no-invalid: true - named-grid-areas-no-invalid: true - no-descending-specificity: null - no-duplicate-at-import-rules: true - no-duplicate-selectors: true - no-empty-source: true - no-invalid-double-slash-comments: true - no-invalid-position-at-import-rule: [true, ignoreAtRules: [tailwind]] - no-irregular-whitespace: true - no-unknown-animations: null - no-unknown-custom-properties: null - number-max-precision: null - plugin/declaration-block-no-ignored-properties: true - property-allowed-list: null - property-disallowed-list: null - property-no-unknown: true - property-no-vendor-prefix: null - rule-empty-line-before: null - rule-selector-property-disallowed-list: null - scale-unlimited/declaration-strict-value: [[/color$/, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true, expandShorthand: true}] - selector-anb-no-unmatchable: true - selector-attribute-name-disallowed-list: null - selector-attribute-operator-allowed-list: null - selector-attribute-operator-disallowed-list: null - selector-attribute-quotes: always - selector-class-pattern: null - selector-combinator-allowed-list: null - selector-combinator-disallowed-list: null - selector-disallowed-list: null - selector-id-pattern: null - selector-max-attribute: null - selector-max-class: null - selector-max-combinators: null - selector-max-compound-selectors: null - selector-max-id: null - selector-max-pseudo-class: null - selector-max-specificity: null - selector-max-type: null - selector-max-universal: null - selector-nested-pattern: null - selector-no-qualifying-type: null - selector-no-vendor-prefix: true - selector-not-notation: null - selector-pseudo-class-allowed-list: null - selector-pseudo-class-disallowed-list: null - selector-pseudo-class-no-unknown: true - selector-pseudo-element-allowed-list: null - selector-pseudo-element-colon-notation: double - selector-pseudo-element-disallowed-list: null - selector-pseudo-element-no-unknown: true - selector-type-case: lower - selector-type-no-unknown: [true, {ignore: [custom-elements]}] - shorthand-property-no-redundant-values: true - string-no-newline: true - time-min-milliseconds: null - unit-allowed-list: null - unit-disallowed-list: null - unit-no-unknown: true - value-keyword-case: null - value-no-vendor-prefix: [true, {ignoreValues: [box, inline-box]}] diff --git a/BSDmakefile b/BSDmakefile index 79696eadcf..f4a819ff93 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -36,10 +36,6 @@ GARGS = "--no-print-directory" JARG = -j$(.MAKE.JOBS) .endif -# bmake prefers out-of-source builds and tries to cd into ./obj (among others) -# where possible. GNU Make doesn't, so override that value. -.OBJDIR: ./ - # The GNU convention is to use the lowercased `prefix` variable/macro to # specify the installation directory. Humor them. GPREFIX = @@ -48,11 +44,12 @@ GPREFIX = .endif .BEGIN: .SILENT - which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false) + which $(GMAKE) >/dev/null || (printf "Error: GNU Make is required!\n\n" 1>&2 && false) -.PHONY: FRC -$(.TARGETS): FRC - $(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG) +.PHONY: EMPTY +EMPTY: .SILENT + $(GMAKE) $(GPREFIX) $(GARGS) $(JARG) -.DONE .DEFAULT: .SILENT - $(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG) +.PHONY: $(.TARGETS) +$(.TARGETS): .SILENT + $(GMAKE) $(GPREFIX) $(GARGS) $(JARG) $@ diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index ae87638f1c..0000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,8355 +0,0 @@ -# Changelog - -This changelog goes through all the changes that have been made in each release -without substantial changes to our git log; to see the highlights of what has -been added to each release, please refer to the [blog](https://blog.gitea.com). - -## [1.21.0](https://github.com/go-gitea/gitea/releases/tag/v1.21.0) - 2023-11-14 - -* BREAKING - * Restrict certificate type for builtin SSH server (#26789) - * Refactor to use urfave/cli/v2 (#25959) - * Move public asset files to the proper directory (#25907) - * Remove commit status running and warning to align GitHub (#25839) (partially reverted: Restore warning commit status (#27504) (#27529)) - * Remove "CHARSET" config option for MySQL, always use "utf8mb4" (#25413) - * Set SSH_AUTHORIZED_KEYS_BACKUP to false (#25412) -* FEATURES - * User details page (#26713) - * Chore(actions): support cron schedule task (#26655) - * Support rebuilding issue indexer manually (#26546) - * Allow to archive labels (#26478) - * Add disable workflow feature (#26413) - * Support `.git-blame-ignore-revs` file (#26395) - * Pre-register OAuth2 applications for git credential helpers (#26291) - * Add `Retry` button when creating a mirror-repo fails (#26228) - * Artifacts retention and auto clean up (#26131) - * Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (#25974) - * Implement auto-cancellation of concurrent jobs if the event is push (#25716) - * Newly pushed branches hints on repository home page (#25715) - * Display branch commit status (#25608) - * Add direct serving of package content (#25543) - * Add commits dropdown in PR files view and allow commit by commit review (#25528) - * Allow package cleanup from admin page (#25307) - * Batch delete issue and improve tippy opts (#25253) - * Show branches and tags that contain a commit (#25180) - * Add actor and status dropdowns to run list (#25118) - * Allow Organisations to have a E-Mail (#25082) - * Add codeowners feature (#24910) - * Actions Artifacts support uploading multiple files and directories (#24874) - * Support configuration variables on Gitea Actions (#24724) - * Support downloading raw task logs (#24451) -* API - * Unify two factor check (#27915) (#27929) - * Fix package webhook (#27839) (#27855) - * Fix/upload artifact error windows (#27802) (#27840) - * Fix bad method call when deleting user secrets via API (#27829) (#27831) - * Do not force creation of _cargo-index repo on publish (#27266) (#27765) - * Delete repos of org when purge delete user (#27273) (#27728) - * Fix org team endpoint (#27721) (#27727) - * Api: GetPullRequestCommits: return file list (#27483) (#27539) - * Don't let API add 2 exclusive labels from same scope (#27433) (#27460) - * Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143) (#27304) - * Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27251) - * Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27163) - * Allow empty Conan files (#27092) - * Fix token endpoints ignore specified account (#27080) - * Reduce usage of `db.DefaultContext` (#27073) (#27083) (#27089) (#27103) (#27262) (#27265) (#27347) (#26076) - * Make SSPI auth mockable (#27036) - * Extract auth middleware from service (#27028) - * Add `RemoteAddress` to mirrors (#26952) - * Feat(API): add routes and functions for managing user's secrets (#26909) - * Feat(API): add secret deletion functionality for repository (#26808) - * Feat(API): add route and implementation for creating/updating repository secret (#26766) - * Add Upload URL to release API (#26663) - * Feat(API): update and delete secret for managing organization secrets (#26660) - * Feat: implement organization secret creation API (#26566) - * Add API route to list org secrets (#26485) - * Set commit id when ref used explicitly (#26447) - * PATCH branch-protection updates check list even when checks are disabled (#26351) - * Add file status for API "Get a single commit from a repository" (#16205) (#25831) - * Add API for changing Avatars (#25369) -* BUGFIXES - * Fix viewing wiki commit on empty repo (#28040) (#28044) - * Enable system users for comment.LoadPoster (#28014) (#28032) - * Fixed duplicate attachments on dump on windows (#28019) (#28031) - * Fix wrong xorm Delete usage(backport for 1.21) (#28002) - * Add word-break to repo description in home page (#27924) (#27957) - * Fix rendering assignee changed comments without assignee (#27927) (#27952) - * Add word break to release title (#27942) (#27947) - * Fix JS NPE when viewing specific range of PR commits (#27912) (#27923) - * Show correct commit sha when viewing single commit diff (#27916) (#27921) - * Fix 500 when deleting a dismissed review (#27903) (#27910) - * Fix DownloadFunc when migrating releases (#27887) (#27890) - * Fix http protocol auth (#27875) (#27876) - * Refactor postgres connection string building (#27723) (#27869) - * Close all hashed buffers (#27787) (#27790) - * Fix label render containing invalid HTML (#27752) (#27762) - * Fix duplicate project board when hitting `enter` key (#27746) (#27751) - * Fix `link-action` redirect network error (#27734) (#27749) - * Fix sticky diff header background (#27697) (#27712) - * Always delete existing scheduled action tasks (#27662) (#27688) - * Support allowed hosts for webhook to work with proxy (#27655) (#27675) - * Fix poster is not loaded in get default merge message (#27657) (#27666) - * Improve dropdown button alignment and fix hover bug (#27632) (#27637) - * Improve retrying index issues (#27554) (#27634) - * Fix 404 when deleting Docker package with an internal version (#27615) (#27630) - * Backport manually for a tmpl issue in v1.21 (#27612) - * Don't show Link to TOTP if not set up (#27585) (#27588) - * Fix data-race bug when accessing task.LastRun (#27584) (#27586) - * Fix attachment download bug (#27486) (#27571) - * Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551) - * Improve dropdown's behavior when there is a search input in menu (#27526) (#27534) - * Fix panic in storageHandler (#27446) (#27479) - * When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442) - * Fix pr template (#27436) (#27440) - * Fix git 2.11 error when checking IsEmpty (#27393) (#27397) - * Allow get release download files and lfs files with oauth2 token format (#26430) (#27379) - * Fix missing ctx for GetRepoLink in dashboard (#27372) (#27375) - * Absolute positioned checkboxes overlay floated elements (#26870) (#27366) - * Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365) - * Fix repo count in org action settings (#27245) (#27353) - * Add logs for data broken of comment review (#27326) (#27345) - * Fix the approval count of PR when there is no protection branch rule (#27272) (#27343) - * Fix Bug in Issue Config when only contact links are set (#26521) (#27334) - * Improve issue history dialog and make poster can delete their own history (#27323) (#27327) - * Fix orphan check for deleted branch (#27310) (#27321) - * Fix protected branch icon location (#26576) (#27317) - * Fix yaml test (#27297) (#27303) - * Fix some animation bugs (#27287) (#27294) - * Fix incorrect change from #27231 (#27275) (#27282) - * Add missing public user visibility in user details page (#27246) (#27250) - * Fix EOL handling in web editor (#27141) (#27234) - * Fix issues on action runners page (#27226) (#27233) - * Quote table `release` in sql queries (#27205) (#27218) - * Fix release URL in webhooks (#27182) (#27185) - * Fix review request number and add more tests (#27104) (#27168) - * Fix the variable regexp pattern on web page (#27161) (#27164) - * Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124) - * Fix NPE when editing OAuth2 applications (#27078) - * Fix the incorrect route path in the user edit page. (#27007) - * Fix the secret regexp pattern on web page (#26910) - * Allow users with write permissions for issues to add attachments with API (#26837) - * Make "link-action" backend code respond correct JSON content (#26680) - * Use line-height: normal by default (#26635) - * Fix NPM packages name validation (#26595) - * Rewrite the DiffFileTreeItem and fix misalignment (#26565) - * Return empty when searching issues with no repos (#26545) - * Explain SearchOptions and fix ToSearchOptions (#26542) - * Add missing triggers to update issue indexer (#26539) - * Handle base64 decoding correctly to avoid panic (#26483) - * Avoiding accessing undefined mentionValues (#26461) - * Fix incorrect redirection in new issue using references (#26440) - * Fix the bug when getting files changed for `pull_request_target` event (#26320) - * Remove IsWarning in tmpl (#26120) - * Fix loading `LFS_JWT_SECRET` from wrong section (#26109) - * Fixing redirection issue for logged-in users (#26105) - * Improve "gitea doctor" sub-command and fix "help" commands (#26072) - * Fix the truncate and alignment problem for some admin tables (#26042) - * Update minimum password length requirements (#25946) - * Do not "guess" the file encoding/BOM when using API to upload files (#25828) - * Restructure issue list template, styles (#25750) - * Fix `ref` for workflows triggered by `pull_request_target` (#25743) - * Fix issues indexer document mapping (#25619) - * Use JSON response for "user/logout" (#25522) - * Fix migrate page layout on mobile (#25507) - * Link to existing PR when trying to open a new PR on the same branches (#25494) - * Do not publish docker release images on `-dev` tags (#25471) - * Support `pull_request_target` event (#25229) - * Modify the content format of the Feishu webhook (#25106) -* ENHANCEMENTS - * Render email addresses as such if followed by punctuation (#27987) (#27992) - * Show error toast when file size exceeds the limits (#27985) (#27986) - * Fix citation error when the file size is larger than 1024 bytes (#27958) (#27965) - * Remove action runners on user deletion (#27902) (#27908) - * Remove set tabindex on view issue (#27892) (#27896) - * Reduce margin/padding on flex-list items and divider (#27872) (#27874) - * Change katex limits (#27823) (#27868) - * Clean up template locale usage (#27856) (#27857) - * Add dedicated class for empty placeholders (#27788) (#27792) - * Add gap between diff boxes (#27776) (#27781) - * Fix incorrect "tab" parameter for repo search sub-template (#27755) (#27764) - * Enable followCursor for language stats bar (#27713) (#27739) - * Improve diff tree spacing (#27714) (#27719) - * Feed UI Improvements (#27356) (#27717) - * Improve feed icons and feed merge text color (#27498) (#27716) - * [FIX] resolve confusing colors in languages stats by insert a gap (#27704) (#27715) - * Add doctor dbconsistency fix to delete repos with no owner (#27290) (#27693) - * Fix required checkboxes in issue forms (#27592) (#27692) - * Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661) - * Cleanup repo details icons/labels (#27644) (#27654) - * Keep filter when showing unfiltered results on explore page (#27192) (#27589) - * Show manual cron run's last time (#27544) (#27577) - * Revert "Fix pr template (#27436)" (#27567) - * Increase queue length (#27555) (#27562) - * Avoid run change title process when the title is same (#27467) (#27558) - * Remove max-width and add hide text overflow (#27359) (#27550) - * Add hover background to wiki list page (#27507) (#27521) - * Fix mermaid flowchart margin issue (#27503) (#27516) - * Refactor system setting (#27000) (#27452) - * Fix missing `ctx` in new_form.tmpl (#27434) (#27438) - * Add Index to `action.user_id` (#27403) (#27425) - * Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408) - * Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407) - * Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402) - * Hide archived labels when filtering by labels on the issue list (#27115) (#27381) - * Highlight user details link (#26998) (#27376) - * Add protected branch name description (#27257) (#27351) - * Improve tree not found page (#26570) (#27346) - * Add Index to `comment.dependent_issue_id` (#27325) (#27340) - * Improve branch list UI (#27319) (#27324) - * Fix divider in subscription page (#27298) (#27301) - * Add missed return to actions view fetch (#27289) (#27293) - * Backport ctx locale refactoring manually (#27231) (#27259) (#27260) - * Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211) (#27253) - * Use mask-based fade-out effect for `.new-menu` (#27181) (#27243) - * Cleanup locale function usage (#27227) (#27240) - * Fix z-index on markdown completion (#27237) (#27239) - * Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225) (#27228) - * Allow copying issue comment link on archived repos and when not logged in (#27193) (#27210) - * Fix: text decorator on issue sidebar menu label (#27206) (#27209) - * Fix dropdown icon position (#27175) (#27177) - * Add index to `issue_user.issue_id` (#27154) (#27158) - * Increase auth provider icon size on login page (#27122) - * Remove a `gt-float-right` and some unnecessary helpers (#27110) - * Change green buttons to primary color (#27099) - * Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095) - * Use `print` instead of `printf` (#27093) - * Remove the useless function `GetUserIssueStats` and move relevant tests to `indexer_test.go` (#27067) - * Search branches (#27055) - * Display all user types and org types on admin management UI (#27050) - * Ui correction in mobile view nav bar left aligned items. (#27046) - * Chroma color tweaks (#26978) - * Move some functions to service layer (#26969) - * Improve "language stats" UI (#26968) - * Replace `util.SliceXxx` with `slices.Xxx` (#26958) - * Refactor dashboard/feed.tmpl (#26956) - * Move repository deletion to service layer (#26948) - * Fix the missing repo count (#26942) - * Improve hint when uploading a too large avatar (#26935) - * Extract common code to new template (#26933) - * Move createrepository from module to service layer (#26927) - * Move notification interface to services layer (#26915) - * Move feed notification service layer (#26908) - * Move ui notification to service layer (#26907) - * Move indexer notification to service layer (#26906) - * Move mail notification logic to service layer (#26905) - * Extract common code to new template (#26903) - * Show queue's active worker number (#26896) - * Fix media description render for orgmode (#26895) - * Remove CSS `has` selector and improve various styles (#26891) - * Relocate the `RSS user feed` button (#26882) - * Refactor "shortsha" (#26877) - * Refactor `og:description` to limit the max length (#26876) - * Move web/api context related testing function into a separate package (#26859) - * Redable error on S3 storage connection failure (#26856) - * Improve opengraph previews (#26851) - * Add more descriptive error on forgot password page (#26848) - * Show always repo count in header (#26842) - * Remove "TODO" tasks from CSS file (#26835) - * Render code blocks in repo description (#26830) - * Minor dashboard tweaks, fix flex-list margins (#26829) - * Remove polluted `.ui.right` (#26825) - * Display archived labels specially when listing labels (#26820) - * Remove polluted ".ui.left" style (#26809) - * Make it posible to customize nav text color via css var (#26807) - * Refactor lfs requests (#26783) - * Improve flex list item padding (#26779) - * Remove fomantic `text` module (#26777) - * Remove fomantic `item` module (#26775) - * Remove redundant nil check in `WalkGitLog` (#26773) - * Reduce some allocations in type conversion (#26772) - * Refactor some CSS styles and simplify code (#26771) - * Unify `border-radius` behavior (#26770) - * Improve modal dialog UI (#26764) - * Allow "latest" to be used in release vTag when downloading file (#26748) - * Adding hint `Archived` to archive label. (#26741) - * Move `modules/mirror` to `services` (#26737) - * Add "dir=auto" for input/textarea elements by default (#26735) - * Add auth-required to config.json for Cargo http registry (#26729) - * Simplify helper CSS classes and avoid abuse (#26728) - * Make web context initialize correctly for different cases (#26726) - * Focus editor on "Write" tab click (#26714) - * Remove incorrect CSS helper classes (#26712) - * Fix review bar misalignment (#26711) - * Add reverseproxy auth for API back with default disabled (#26703) - * Add default label in branch select list (#26697) - * Improve Image Diff UI (#26696) - * Fixed text overflow in dropdown menu (#26694) - * [Refactor] getIssueStatsChunk to move inner function into own one (#26671) - * Remove fomantic loader module (#26670) - * Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips (#26658) - * Improve some flex layouts (#26649) - * Improve the branch selector tab UI (#26631) - * Improve show role (#26621) - * Remove avatarHTML from template helpers (#26598) - * Allow text selection in actions step header (#26588) - * Improve translation of milestone filters (#26569) - * Add optimistic lock to ActionRun table (#26563) - * Update team invitation email link (#26550) - * Differentiate better between user settings and admin settings (#26538) - * Check disabled workflow when rerun jobs (#26535) - * Improve deadline icon location in milestone list page (#26532) - * Improve repo sub menu (#26531) - * Fix the display of org level badges (#26504) - * Rename `Sync2` -> `Sync` (#26479) - * Fix stderr usages (#26477) - * Remove fomantic transition module (#26469) - * Refactor tests (#26464) - * Refactor project templates (#26448) - * Fall back to esbuild for css minify (#26445) - * Always show usernames in reaction tooltips (#26444) - * Use correct pull request commit link instead of a generic commit link (#26434) - * Refactor "editorconfig" (#26391) - * Make `user-content-* ` consistent with github (#26388) - * Remove unnecessary template helper repoAvatar (#26387) - * Remove unnecessary template helper DisableGravatar (#26386) - * Use template context function for avatar rendering (#26385) - * Rename code_langauge.go to code_language.go (#26377) - * Use more `IssueList` instead of `[]*Issue` (#26369) - * Do not highlight `#number` in documents (#26365) - * Fix display problems of members and teams unit (#26363) - * Fix 404 error when remove self from an organization (#26362) - * Improve CLI and messages (#26341) - * Refactor backend SVG package and add tests (#26335) - * Add link to job details and tooltip to commit status in repo list in dashboard (#26326) - * Use yellow if an approved review is stale (#26312) - * Remove commit load branches and tags in wiki repo (#26304) - * Add highlight to selected repos in milestone dashboard (#26300) - * Delete `issue_service.CreateComment` (#26298) - * Do not show Profile README when repository is private (#26295) - * Tweak actions menu (#26278) - * Start using template context function (#26254) - * Use calendar icon for `Joined on...` in profiles (#26215) - * Add 'Show on a map' button to Location in profile, fix layout (#26214) - * Render plaintext task list items for markdown files (#26186) - * Add tooltip to describe LFS table column and color `delete LFS file` button red (#26181) - * Release attachments duplicated check (#26176) - * De-emphasize issue sidebar buttons (#26171) - * Fixing the align of commit stats in commit_page template. (#26161) - * Allow editing push mirrors after creation (#26151) - * Move web JSON functions to web context and simplify code (#26132) - * Refactor improve NoBetterThan (#26126) - * Improve clickable area in repo action view page (#26115) - * Add context parameter to some database functions (#26055) - * Docusaurus-ify (#26051) - * Improve text for empty issue/pr description (#26047) - * Categorize admin settings sidebar panel (#26030) - * Remove redundant "RouteMethods" method (#26024) - * Refactor and enhance issue indexer to support both searching, filtering and paging (#26012) - * Add a link to OpenID Issuer URL in WebFinger response (#26000) - * Fix UI for release tag page / wiki page / subscription page (#25948) - * Support copy protected branch from template repository (#25889) - * Improve display of Labels/Projects/Assignees sort options (#25886) - * Fix margin on the new/edit project page. (#25885) - * Show image size on view page (#25884) - * Remove ref name in PR commits page (#25876) - * Allow the use of alternative net.Listener implementations by downstreams (#25855) - * Refactor "Content" for file uploading (#25851) - * Add error info if no user can fork the repo (#25820) - * Show edit title button on commits tab of PR, too (#25791) - * Introduce `flex-list` & `flex-item` elements for Gitea UI (#25790) - * Don't stack PR tab menu on small screens (#25789) - * Repository Archived text title center align (#25767) - * Make route middleware/handler mockable (#25766) - * Move issue filters to shared template (#25729) - * Use frontend fetch for branch dropdown component (#25719) - * Add open/closed field support for issue index (#25708) - * Some less naked returns (#25682) - * Fix inconsistent user profile layout across tabs (#25625) - * Get latest commit statuses from database instead of git data on dashboard for repositories (#25605) - * Adding branch-name copy to clipboard branches screen. (#25596) - * Update emoji set to Unicode 15 (#25595) - * Move some files under repo/setting (#25585) - * Add custom ansi colors and CSS variables for them (#25546) - * Add log line anchor for action logs (#25532) - * Use flex instead of float for sort button and search input (#25519) - * Update octicons and use `octicon-file-directory-symlink` (#25453) - * Add toasts to UI (#25449) - * Fine tune project board label colors and modal content background (#25419) - * Import additional secrets via file uri (#25408) - * Switch to ansi_up for ansi rendering in actions (#25401) - * Store and use seconds for timeline time comments (#25392) - * Support displaying diff stats in PR tab bar (#25387) - * Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380) - * Refactor: TotalTimes return seconds (#25370) - * Navbar styling rework (#25343) - * Introduce shared template for search inputs (#25338) - * Only show 'Manage Account Links' when necessary (#25311) - * Improve 'Privacy' section in profile settings (#25309) - * Substitute variables in path names of template repos too (#25294) - * Fix tags line no margin see #25255 (#25280) - * Use fetch to send requests to create issues/comments (#25258) - * Change form actions to fetch for submit review box (#25219) - * Improve AJAX link and modal confirm dialog (#25210) - * Reduce unnecessary DB queries for Actions tasks (#25199) - * Disable `Create column` button while the column name is empty (#25192) - * Refactor indexer (#25174) - * Adjust style for action run list (align icons, adjust padding) (#25170) - * Remove duplicated functions when deleting a branch (#25128) - * Make confusable character warning less jarring (#25069) - * Highlight viewed files differently in the PR filetree (#24956) - * Support changing labels of Actions runner without re-registration (#24806) - * Fix duplicate Reviewed-by trailers (#24796) - * Resolve issue with sort icons on admin/users and admin/runners (#24360) - * Split lfs size from repository size (#22900) - * Sync branches into databases (#22743) - * Disable run user change in installation page (#22499) - * Add merge files files to GetCommitFileStatus (#20515) - * Show OpenID Connect and OAuth on signup page (#20242) -* SECURITY - * Dont leak private users via extensions (#28023) (#28029) - * Expanded minimum RSA Keylength to 3072 (#26604) -* TESTING - * Add user secrets API integration tests (#27832) (#27852) - * Add tests for db indexer in indexer_test.go (#27087) - * Speed up TestEventSourceManagerRun (#26262) - * Add unit test for user renaming (#26261) - * Add some Wiki unit tests (#26260) - * Improve unit test for caching (#26185) - * Add unit test for `HashAvatar` (#25662) -* TRANSLATION - * Backport translations to v1.21 (#27899) - * Fix issues in translation file (#27699) (#27737) - * Add locale for deleted head branch (#26296) - * Improve multiple strings in en-US locale (#26213) - * Fix broken translations for package documantion (#25742) - * Correct translation wrong format (#25643) -* BUILD - * Dockerfile small refactor (#27757) (#27826) - * Fix build errors on BSD (in BSDMakefile) (#27594) (#27608) - * Fully replace drone with actions (#27556) (#27575) - * Enable markdownlint `no-duplicate-header` (#27500) (#27506) - * Enable production source maps for index.js, fix CSS sourcemaps (#27291) (#27295) - * Update snap package (#27021) - * Bump go to 1.21 (#26608) - * Bump xgo to go-1.21.x and node to 20 in release-version (#26589) - * Add template linting via djlint (#25212) -* DOCS - * Change default size of issue/pr attachments and repo file (#27946) (#28017) - * Remove `known issue` section in Gitea Actions Doc (#27930) (#27938) - * Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119) - * Update brew installation documentation since gitea moved to brew core package (#27070) - * Actions are no longer experimental, so enable them by default (#27054) - * Add a documentation note for Windows Service (#26938) - * Add sparse url in cargo package guide (#26937) - * Update nginx recommendations (#26924) - * Update backup instructions to align with archive structure (#26902) - * Expanding documentation in queue.go (#26889) - * Update info regarding internet connection for build (#26776) - * Docs: template variables (#26547) - * Update index doc (#26455) - * Update zh-cn documentation (#26406) - * Fix typos and grammer problems for actions documentation (#26328) - * Update documentation for 1.21 actions (#26317) - * Doc update swagger doc for POST /orgs/{org}/teams (#26155) - * Doc sync authentication.md to zh-cn (#26117) - * Doc guide the user to create the appropriate level runner (#26091) - * Make organization redirect warning more clear (#26077) - * Update blog links (#25843) - * Fix default value for LocalURL (#25426) - * Update `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig (#25194) -* MISC - * Replace deprecated `elliptic.Marshal` (#26800) - * Add elapsed time on debug for slow git commands (#25642) - -## [1.20.5](https://github.com/go-gitea/gitea/releases/tag/v1.20.5) - 2023-10-03 - -* ENHANCEMENTS - * Fix z-index on markdown completion (#27237) (#27242 & #27238) - * Use secure cookie for HTTPS sites (#26999) (#27013) -* BUGFIXES - * Fix git 2.11 error when checking IsEmpty (#27393) (#27396) - * Allow get release download files and lfs files with oauth2 token format (#26430) (#27378) - * Fix orphan check for deleted branch (#27310) (#27320) - * Quote table `release` in sql queries (#27205) (#27219) - * Fix release URL in webhooks (#27182) (#27184) - * Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152) (#27156) - * fix pagination for followers and following (#27127) (#27138) - * Fix issue templates when blank isses are disabled (#27061) (#27082) - * Fix context cache bug & enable context cache for dashabord commits' authors(#26991) (#27017) - * Fix INI parsing for value with trailing slash (#26995) (#27001) - * Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203) (#27249) - * Fix organization field being null in POST /orgs/{orgid}/teams (#27150) (#27167 & #27162) - * Fix bug of review request number (#27406) (#27104) -* TESTING - * services/wiki: Close() after error handling (#27129) (#27137) -* DOCS - * Improve actions docs related to `pull_request` event (#27126) (#27145) -* MISC - * Add logs for data broken of comment review (#27326) (#27344) - * Load reviewer before sending notification (#27063) (#27064) - -## [1.20.4](https://github.com/go-gitea/gitea/releases/tag/v1.20.4) - 2023-09-08 - -* SECURITY - * Check blocklist for emails when adding them to account (#26812) (#26831) -* ENHANCEMENTS - * Add `branch_filter` to hooks API endpoints (#26599) (#26632) - * Fix incorrect "tabindex" attributes (#26733) (#26734) - * Use line-height: normal by default (#26635) (#26708) - * Fix unable to display individual-level project (#26198) (#26636) -* BUGFIXES - * Fix wrong review requested number (#26784) (#26880) - * Avoid double-unescaping of form value (#26853) (#26863) - * Redirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues are disabled (#26813) (#26847) - * Sync tags when adopting repos (#26816) (#26834) - * Fix verifyCommits error when push a new branch (#26664) (#26810) - * Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759) (#26806) - * Fix some slice append usages (#26778) (#26798) - * Add fix incorrect can_create_org_repo for org owner team (#26683) (#26791) - * Fix bug for ctx usage (#26763) - * Make issue template field template access correct template data (#26698) (#26709) - * Use correct minio error (#26634) (#26639) - * Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) (#26618) - * Set errwriter for urfave/cli v1 (#26616) - * Fix reopen logic for agit flow pull request (#26399) (#26613) - * Fix context filter has no effect in dashboard (#26695) (#26811) - * Fix being unable to use a repo that prohibits accepting PRs as a PR source. (#26785) (#26790) - * Fix Page Not Found error (#26768) - -## [1.20.3](https://github.com/go-gitea/gitea/releases/tag/v1.20.3) - 2023-08-20 - -* BREAKING - * Fix the wrong derive path (#26271) (#26318) -* SECURITY - * Fix API leaking Usermail if not logged in (#25097) (#26350) -* FEATURES - * Add ThreadID parameter for Telegram webhooks (#25996) (#26480) -* ENHANCEMENTS - * Add minimum polyfill to support "relative-time-element" in PaleMoon (#26575) (#26578) - * Fix dark theme highlight for "NameNamespace" (#26519) (#26527) - * Detect ogg mime-type as audio or video (#26494) (#26505) - * Use `object-fit: contain` for oauth2 custom icons (#26493) (#26498) - * Move dropzone progress bar to bottom to show filename when uploading (#26492) (#26497) - * Remove last newline from config file (#26468) (#26471) - * Minio: add missing region on client initialization (#26412) (#26438) - * Add pull request review request webhook event (#26401) (#26407) - * Fix text truncate (#26354) (#26384) - * Fix incorrect color of selected assignees when create issue (#26324) (#26372) - * Display human-readable text instead of cryptic filemodes (#26352) (#26358) - * Hide `last indexed SHA` when a repo could not be indexed yet (#26340) (#26345) - * Fix the topic validation rule and suport dots (#26286) (#26303) - * Fix due date rendering the wrong date in issue (#26268) (#26274) - * Don't autosize textarea in diff view (#26233) (#26244) - * Fix commit compare style (#26209) (#26226) - * Warn instead of reporting an error when a webhook cannot be found (#26039) (#26211) -* BUGFIXES - * Use "input" event instead of "keyup" event for migration form (#26602) (#26605) - * Do not use deprecated log config options by default (#26592) (#26600) - * Fix "issueReposQueryPattern does not match query" (#26556) (#26564) - * Sync repo's IsEmpty status correctly (#26517) (#26560) - * Fix project filter bugs (#26490) (#26558) - * Use `hidden` over `clip` for text truncation (#26520) (#26522) - * Set "type=button" for editor's toolbar buttons (#26510) (#26518) - * Fix NuGet search endpoints (#25613) (#26499) - * Fix storage path logic especially for relative paths (#26441) (#26481) - * Close stdout correctly for "git blame" (#26470) (#26473) - * Check first if minio bucket exists before trying to create it (#26420) (#26465) - * Avoiding accessing undefined tributeValues #26461 (#26462) - * Call git.InitSimple for runRepoSyncReleases (#26396) (#26450) - * Add transaction when creating pull request created dirty data (#26259) (#26437) - * Fix wrong middleware sequence (#26428) (#26436) - * Fix admin queue page title and fix CI failures (#26409) (#26421) - * Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) (#26405) - * Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368) - * Fix incorrect CLI exit code and duplicate error message (#26346) (#26347) - * Prevent newline errors with Debian packages (#26332) (#26342) - * Fix bug with sqlite load read (#26305) (#26339) - * Make git batch operations use parent context timeout instead of default timeout (#26325) (#26330) - * Support getting changed files when commit ID is `EmptySHA` (#26290) (#26316) - * Clarify the logger's MODE config option (#26267) (#26281) - * Use shared template for webhook icons (#26242) (#26246) - * Fix pull request check list is limited (#26179) (#26245) - * Fix attachment clipboard copy on insecure origin (#26224) (#26231) - * Fix access check for org-level project (#26182) (#26223) -* MISC - * Improve profile readme rendering (#25988) (#26453) - * [docs] Add missing backtick in quickstart.zh-cn.md (#26349) (#26357) - * Upgrade x/net to 0.13.0 (#26301) - -## [1.20.2](https://github.com/go-gitea/gitea/releases/tag/v1.20.2) - 2023-07-29 - -* ENHANCEMENTS - * Calculate MAX_WORKERS default value by CPU number (#26177) (#26183) - * Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154) -* BUGFIXES - * Fix allowed user types setting problem (#26200) (#26206) - * Fix handling of plenty Nuget package versions (#26075) (#26173) - * Fix UI regression of asciinema player (#26159) (#26162) - * Fix LFS object list style (#26133) (#26147) - * Fix allowed user types setting problem (#26200) (#26206) - * Prevent primary key update on migration (#26192) (#26199) - * Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158) - * Fix bugs in LFS meta garbage collection (#26122) (#26157) - * Update xorm version (#26128) (#26150) - * Remove "misc" scope check from public API endpoints (#26134) (#26149) - * Fix CLI allowing creation of access tokens with existing name (#26071) (#26144) - * Fix incorrect router logger (#26137) (#26143) - * Improve commit graph alignment and truncating (#26112) (#26127) - * Avoid writing config file if not installed (#26107) (#26113) - * Fix escape problems in the branch selector (#25875) (#26103) - * Fix handling of Debian files with trailing slash (#26087) (#26098) - * Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089) - * Use stderr as fallback if the log file can't be opened (#26074) (#26083) - * Increase table cell horizontal padding (#26140) (#26142) - * Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124) - * Fix duplicated url prefix on issue context menu (#26066) (#26067) - -## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/v1.20.1) - 2023-07-22 - -* SECURITY - * Disallow dangerous URL schemes (#25960) (#25964) -* ENHANCEMENTS - * Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947) (#25972) - * Make pending commit status yellow again (#25935) (#25968) -* BUGFIXES - * Fix version in rpm repodata/primary.xml.gz (#26009) (#26048) - * Fix env config parsing for "GITEA____APP_NAME" (#26001) (#26013) - * ParseScope with owner/repo always sets owner to zero (#25987) (#25989) - * Fix SSPI auth panic (#25955) (#25969) - * Avoid creating directories when loading config (#25944) (#25957) - * Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937) - * Ignore `runs-on` with expressions when warning no matched runners (#25917) (#25933) - * Avoid opening/closing PRs which are already merged (#25883) (#25903) -* DOCS - * RPM Registry: Show zypper commands for SUSE based distros as well (#25981) (#26020) - * Correctly refer to dev tags as nightly in the docker docs (#26004) (#26019) - * Update path related documents (#25417) (#25982) -* MISC - * Adding remaining enum for migration repo model type. (#26021) (#26034) - * Fix the route for pull-request's authors (#26016) (#26018) - * Fix commit status color on dashboard repolist (#25993) (#25998) - * Avoid hard-coding height in language dropdown menu (#25986) (#25997) - * Add shutting down notice (#25920) (#25922) - * Fix incorrect milestone count when provide a keyword (#25880) (#25904) - -## [1.20.0](https://github.com/go-gitea/gitea/releases/tag/v1.20.0) - 2023-07-16 - -* BREAKING - * Fix WORK_DIR for docker (root) image (#25738) (#25811) - * Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581) (#25604) - * Refactor path & config system (#25330) (#25416) - * Fix all possible setting error related storages and added some tests (#23911) (#25244) - * Use a separate admin page to show global stats, remove `actions` stat (#25062) - * Remove the service worker (#25010) - * Remove meta tags `theme-color` and `default-theme` (#24960) - * Use `[git.config]` for reflog cleaning up (#24958) - * Allow all URL schemes in Markdown links by default (#24805) - * Redesign Scoped Access Tokens (#24767) - * Fix team members API endpoint pagination (#24754) - * Rewrite logger system (#24726) - * Increase default LFS auth timeout from 20m to 24h (#24628) - * Rewrite queue (#24505) - * Remove unused setting `time.FORMAT` (#24430) - * Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) - * Correct the access log format (#24085) - * Reserve ".png" suffix for user/org names (#23992) - * Prefer native parser for SSH public key parsing (#23798) - * Editor preview support for external renderers (#23333) - * Add Gitea Profile Readmes (#23260) - * Refactor `ctx` in templates (#23105) -* SECURITY - * Test if container blob is accessible before mounting (#22759) (#25784) - * Set type="password" on all auth_token fields (#22175) -* FEATURES - * Add button on diff header to copy file name, misc diff header tweaks (#24986) - * API endpoint for changing/creating/deleting multiple files (#24887) - * Support changing git config through `app.ini`, use `diff.algorithm=histogram` by default (#24860) - * Add up and down arrows to selected lookup repositories (#24727) - * Add Go package registry (#24687) - * Add status indicator on main home screen for each repo (#24638) - * Support for status check pattern (#24633) - * Implement Cargo HTTP index (#24452) - * Add Debian package registry (#24426) - * Add the ability to pin Issues (#24406) - * Add follow organization and fix the logic of following page (#24345) - * Allow `webp` images as avatars (#24248) - * Support upload `outputs` and use `needs` context on Actions (#24230) - * Allow adding new files to an empty repo (#24164) - * Make wiki title supports dashes and improve wiki name related features (#24143) - * Add monospace toggle button to textarea (#24034) - * Use auto-updating, natively hoverable, localized time elements (#23988) - * Add ntlm authentication support for mail (#23811) - * Add CLI command to register runner tokens (#23762) - * Add Alpine package registry (#23714) - * Expand/Collapse all changed files (#23639) - * Add unset default project column (#23531) - * Add activity feeds API (#23494) - * Add RPM registry (#23380) - * Add meilisearch support (#23136) - * Add API for License templates (#23009) - * Add admin API email endpoints (#22792) - * Add user rename endpoint to admin api (#22789) - * Add API for gitignore templates (#22783) - * Implement actions artifacts (#22738) - * Add RSS Feeds for branches and files (#22719) - * Display when a repo was archived (#22664) - * Add Swift package registry (#22404) - * Add CRAN package registry (#22331) - * Add user webhooks (#21563) - * Implement systemd-notify protocol (#21151) - * Implement Issue Config (#20956) - * Add API to manage issue dependencies (#17935) -* API - * Use correct response code in push mirror creation response in v1_json.tmpl (#25476) (#25571) - * Fix `Permission` in API returned repository struct (#25388) (#25441) - * Add API for Label templates (#24602) - * Filters for GetAllCommits (#24568) - * Add ability to specify '--not' from GetAllCommits (#24409) - * Support uploading file to empty repo by API (#24357) - * Add absent repounits to create/edit repo API (#23500) - * Add login name and source id for admin user searching API (#23376) - * Create a branch directly from commit on the create branch API (#22956) -* ENHANCEMENTS - * Make `add line comment` buttons focusable (#25894) (#25896) - * Always pass 6-digit hex color to monaco (#25780) (#25782) - * Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764) - * Hide `add file` button for pull mirrors (#25748) (#25751) - * Allow/fix review (approve/reject) of empty PRs (#25690) (#25732) - * Fix tags header and pretty format numbers (#25624) (#25694) - * Actions list enhancements (#25601) (#25678) - * Fix show more for image on diff page (#25672) (#25673) - * Prevent SVG shrinking (#25652) (#25669) - * Fix UI misalignment on user setting page (#25629) (#25656) - * Use css on labels (#25626) (#25636) - * Read-only checkboxes don't appear and don't entirely act the way one might expect (#25573) (#25602) - * Redirect to package after version deletion (#25594) (#25599) - * Reduce table padding globally (#25568) (#25577) - * Change `Regenerate Secret` button display (#25534) (#25541) - * Fix rerun icon on action view component (#25531) (#25536) - * Move some regexp out of functions (#25430) (#25445) - * Diff page enhancements (#25398) (#25437) - * Various UI fixes (#25264) (#25431) - * Fix label list divider (#25312) (#25372) - * Fix UI on mobile view (#25315) (#25340) - * When viewing a file, hide the add button (#25320) (#25339) - * Show if File is Executable (#25287) (#25300) - * Fix edit OAuth application width (#25262) (#25263) - * Use flex to align SVG and text (#25163) (#25260) - * Revert overflow: overlay (revert #21850) (#25231) (#25239) - * Use inline SVG for built-in OAuth providers (#25171) (#25234) - * Change access token UI to select dropdowns (#25109) (#25230) - * Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211) - * Minor arc-green color tweaks (#25175) (#25205) - * Button and color enhancements (#24989) (#25176) - * Fix mobile navbar and misc cleanups (#25134) (#25169) - * Modify OAuth login ui and fix display name, iconurl related logic (#25030) (#25161) - * Improve notification icon and navbar (#25111) (#25124) - * Add details summary for vertical menus in settings to allow toggling (#25098) - * Don't display `select all issues` checkbox when no issues are available (#25086) - * Use RepositoryList instead of []*Repository (#25074) - * Add ability to set multiple redirect URIs in OAuth application UI (#25072) - * Use git command instead of the ini package to remove the `origin` remote (#25066) - * Remove cancel button from branch protection form (#25063) - * Show file tree by default (#25052) - * Add Progressbar to Milestone Page (#25050) - * Minor UI improvements: logo alignment, auth map editor, auth name display (#25043) - * Allow for PKCE flow without client secret + add docs (#25033) - * Refactor INI package (first step) (#25024) - * Various style fixes (#25008) - * Fix delete user account modal (#25004) - * Refactor diffFileInfo / DiffTreeStore (#24998) - * Add user level action runners (#24995) - * Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988) - * Add step start time to `ViewStepLog` (#24980) - * Add dark mode to API Docs (#24971) - * Display file mode for new file and file mode changes (#24966) - * Make the 500 page load themes (#24953) - * Show `bot` label next to username when rendering autor link if the user is a bot (#24943) - * Repo list improvements, fix bold helper classes (#24935) - * Improve queue and logger context (#24924) - * Improve RunMode / dev mode (#24886) - * Improve some Forms (#24878) - * Add show timestamp/seconds and fullscreen options to action page (#24876) - * Fix double border and adjust width for user profile page (#24870) - * Improve Actions CSS (#24864) - * Fix `@font-face` overrides (#24855) - * Remove `In your repositories` link in milestones dashboard (#24853) - * Fix missing yes/no in delete time log modal (#24851) - * Show new pull request button also on subdirectories and files (#24842) - * Make environment-to-ini support loading key value from file (#24832) - * Support wildcard in email domain allow/block list (#24831) - * Use `CommentList` instead of `[]*Comment` (#24828) - * Add RTL rendering support to Markdown (#24816) - * Rework notifications list (#24812) - * Mute repo names in dashboard repo list (#24811) - * Fix max width and margin of comment box on conversation page (#24809) - * Some refactors for issues stats (#24793) - * Rework label colors (#24790) - * Fix OAuth login loading state (#24788) - * Remove duplicated issues options and some more refactors (#24787) - * Decouple the different contexts from each other (#24786) - * Remove background on user dashboard filter bar (#24779) - * Improve and fix bugs surrounding reactions (#24760) - * Make the color of zero-contribution-squares in the activity heatmap more subtle (#24758) - * Fix WEBP image copying (#24743) - * Rework OAuth login buttons, swap github logo to monocolor (#24740) - * Consolidate the two review boxes into one (#24738) - * Unification of registration fields order (#24737) - * Refactor Pull Mirror and fix out-of-sync bugs (#24732) - * Improvements for action detail page (#24718) - * Fix flash of unstyled content in action view page (#24712) - * Don't filter action runs based on state (#24711) - * Optimize actions list by removing an unnecessary `git` call (#24710) - * Support no label/assignee filter and batch clearing labels/assignees (#24707) - * Add icon support for safari (#24697) - * Use standard HTTP library to serve files (#24693) - * Improve button-ghost, remove tertiary button (#24692) - * Only hide tooltip tippy instances (#24688) - * Support migrating storage for actions log via command line (#24679) - * Remove highlight in repo list (#24675) - * Add markdown preview to Submit Review Textarea (#24672) - * Update pin and add pin-slash (#24669) - * Improve empty notifications display (#24668) - * Support SSH for go get (#24664) - * Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) - * Only show one tippy at a time (#24648) - * Notification list enhancements, fix striped tables on dark theme (#24639) - * Improve queue & process & stacktrace (#24636) - * Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) - * Remove fluid on compare diff page (#24627) - * Add a tooltip to the job rerun button (#24617) - * Attach a tooltip to the action status icon (#24614) - * Make the actions control button look like an actual button (#24611) - * Remove unnecessary code (#24610) - * Make repo migration cancelable and fix various bugs (#24605) - * Improve updating Actions tasks (#24600) - * Attach a tooltip to the action control button (#24595) - * Make repository response support HTTP range request (#24592) - * Improve Gitea's web context, decouple "issue template" code into service package (#24590) - * Modify luminance calculation and extract related functions into single files (#24586) - * Simplify template helper functions (#24570) - * Split "modules/context.go" to separate files (#24569) - * Add org visibility label to non-organization's dashboard (#24558) - * Update LDAP filters to include both username and email address (#24547) - * Review fixes and enhancements (#24526) - * Display warning when user try to rename default branch (#24512) - * Fix color for transfer related buttons when having no permission to act (#24510) - * Rework button coloring, add focus and active colors (#24507) - * New webhook trigger for receiving Pull Request review requests (#24481) - * Add goto issue id function (#24479) - * Fix incorrect webhook time and use relative-time to display it (#24477) - * RSS icon fixes (#24476) - * Replace `N/A` with `-` everywhere (#24474) - * Pass 'not' to commit count (#24473) - * Enhance stylelint rule config, remove dead CSS (#24472) - * Remove `font-awesome` and fomantic `icon` module (#24471) - * Improve "new-menu" (#24465) - * Remove fomantic breadcrumb module (#24463) - * Improve template system and panic recovery (#24461) - * Make Issue/PR/projects more compact, misc CSS tweaks (#24459) - * Replace remaining fontawesome dropdown icons with SVG (#24455) - * Remove all direct references to font-awesome (#24448) - * Move links out of translation (#24446) - * Add `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442) - * Hide 'Mirror Settings' when unneeded, improve hints (#24433) - * Add "Updated" column for admin repositories list (#24429) - * Improve issue list filter (#24425) - * Rework header bar on issue, pull requests and milestone (#24420) - * Improve template helper (#24417) - * Make repo size style matches others (commits/branches/tags) (#24408) - * Support markdown editor for issue template (#24400) - * Improve commit date in commit graph (#24399) - * Start cleaning the messy ".ui.left / .ui.right", improve label list page, fix stackable menu (#24393) - * Merge setting.InitXXX into one function with options (#24389) - * Move `Rename branch` from repo settings page to the page of branches list (#24380) - * Improve protected branch setting page (#24379) - * Display 'Unknown' when runner.version is empty (#24378) - * Display owner of a runner as a tooltip instead of static text (#24377) - * Fix incorrect last online time in runner_edit.tmpl (#24376) - * Fix unclear `IsRepositoryExist` logic (#24374) - * Add custom helm repo name generated from url (#24363) - * Replace placeholders in licenses (#24354) - * Add rerun workflow button and refactor to use SVG octicons (#24350) - * Fix runner button height (#24338) - * Restore bold on repolist (#24337) - * Improve RSS (#24335) - * Refactor "route" related code, fix Safari cookie bug (#24330) - * Alert error message if open dependencies are included in the issues that try to batch close (#24329) - * Add missed column title in runner management page (#24328) - * Automatically select the org when click create repo from org dashboard (#24325) - * Modify width of ui container, fine tune css for settings pages and org header (#24315) - * Fix config list overflow and layout (#24312) - * Improve some modal action buttons (#24289) - * Move code from module to service (#24287) - * Sort users and orgs on explore by recency by default (#24279) - * Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275) - * Show workflow config error on file view also (#24267) - * Improve template helper functions: string/slice (#24266) - * Use more specific test methods (#24265) - * Add `DumpVar` helper function to help debugging templates (#24262) - * Limit avatar upload to valid image files (#24258) - * Improve emoji and mention matching (#24255) - * Change to vertical navbar layout for secondary navbar for repo/user/admin settings (#24246) - * Refactor config provider (#24245) - * Improve test logger (#24235) - * Default show closed actions list if all actions was closed (#24234) - * Add missing badges in user profile for /projects and /packages (#24232) - * Add repository counter badge to repository tab (#24205) - * Move secrets and runners settings to actions settings (#24200) - * Require at least one unit to be enabled (#24189) - * Use same action status svg icons on actions list as on action page (#24178) - * Use secondary pointing menu for tabs on user/organization home page (#24162) - * Improve Wiki TOC (#24137) - * Refactor locale number (#24134) - * Localize activity heatmap (except tooltip) (#24131) - * Fix duplicate modals when clicking on "remove all" repository button (#24129) - * Add runner check in repo action page (#24124) - * Support triggering workflows by wiki related events (#24119) - * Refactor cookie (#24107) - * Remove untranslatable `on_date` key (#24106) - * Refactor delete_modal_actions template and use it for project column related actions (#24097) - * Improve git log for debugging (#24095) - * Add option to search for users is active join a team (#24093) - * Add PDF rendering via PDFObject (#24086) - * Refactor web route (#24080) - * Make HTML template functions support context (#24056) - * Refactor rename user and rename organization (#24052) - * Localize milestone related time strings (#24051) - * Expand selected file when clicking file tree (#24041) - * Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040) - * Add placeholder and aria attributes to release and wiki edit page (#24031) - * Add new user types `reserved`, `bot`, and `remote` (#24026) - * Allow adding SSH keys even if SSH server is disabled (#24025) - * Use a general approach to access custom/static/builtin assets (#24022) - * Update github.com/google/go-github to v52 (#24004) - * Replace tribute with text-expander-element for textarea (#23985) - * Group template helper functions, remove `Printf`, improve template error messages (#23982) - * Drop "unrolled/render" package (#23965) - * Add job.duration in web ui (#23963) - * Tweak pull request branch delete ui (#23951) - * Merge template functions "dict/Dict/mergeinto" (#23932) - * Use a general Eval function for expressions in templates. (#23927) - * Clean template/helper.go (#23922) - * Actions: Use default branch as ref when a branch/tag delete occurs (#23910) - * Add tooltips for MD editor buttons and add `muted` class for buttons (#23896) - * Improve markdown editor: width, height, preferred (#23895) - * Make Release Download URLs predictable (#23891) - * Remove fomantic ".link" selector and styles (#23888) - * Added close/open button to details page of milestone (#23877) - * Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) - * Introduce GiteaLocaleNumber custom element to handle number localization on pages. (#23861) - * Make first section on home page full width (#23854) - * Use different SVG for pending and running actions (#23836) - * Display image size for multiarch container images (#23821) - * Improve action log display with control chars (#23820) - * Fix dropdown direction behavior (#23806) - * Fix incorrect/Improve error handle in edit user page (#23805) - * Use clippie module to copy to clipboard (#23801) - * Make minio package support legacy MD5 checksum (#23768) - * Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) - * Refactor docs (#23752) - * Fix markup background, improve wiki rendering (#23750) - * Make label templates have consistent behavior and priority (#23749) - * Improve LoadUnitConfig to handle invalid or duplicate units (#23736) - * Append `(comment)` when a link points at a comment rather than the whole issue (#23734) - * Clean some legacy files and move some build files (#23699) - * Refactor repo commit list (#23690) - * Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) - * Add aria attributes to interactive time tooltips. (#23661) - * Fix long project name display in issue list and in related dropdown (#23653) - * Use data-tooltip-content for tippy tooltip (#23649) - * Fix new issue/pull request btn margin when it is next to sort (#23647) - * Fine tune more downdrop settings, use SVG for labels, improve Repo Topic Edit form (#23626) - * Allow new file and edit file preview if it has editable extension (#23624) - * Replace a few fontawesome icons with svg (#23602) - * `Publish Review` buttons should indicate why they are disabled (#23598) - * Convert issue list checkboxes to native (#23596) - * Set opaque background on markup and images (#23578) - * Use a general approach to show tooltip, fix temporary tooltip bug (#23574) - * Improve `` to make it output `svg` node and optimize performance (#23570) - * Enable color for consistency checks diffs (#23563) - * Fix dropdown icon misalignment when using fomantic icon (#23558) - * Decouple the issue-template code from comment_tab.tmpl (#23556) - * Remove `id="comment-form"` dead code, fix tag (#23555) - * Diff improvements (#23553) - * Sort Python package descriptors by version to mimic PyPI format (#23550) - * Use a general approch to improve a11y for all checkboxes and dropdowns. (#23542) - * Fix long name ui issues and label ui issue (#23541) - * Return `repository` in npm package metadata endpoint (#23539) - * Use `project.IconName` instead of repeated unreadable `if-else` chains (#23538) - * Remove stars in dashboard repo list (#23530) - * Update mini-css-extract-plugin, remove postcss (#23520) - * Change `Close` to either `Close issue` or `Close pull request` (#23506) - * Fix theme-auto loading (#23504) - * Fix tags sort by creation time (descending) on branch/tag dropdowns (#23491) - * Display the version of runner in the runner list (#23490) - * Replace Less with CSS (#23481) - * Fix `.locale.Tr` function not found in delete modal (#23468) - * Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463) - * Add project type descriptions in issue badge and improve project icons (#23437) - * Use context for `RepositoryList.LoadAttributes` (#23435) - * Refactor branch/tag selector to Vue SFC (#23421) - * Keep (add if not existing) xmlns attribute for generated SVG images (#23410) - * Refactor dashboard repo list to Vue SFC (#23405) - * Add workflow error notification in ui (#23404) - * Refactor branch/tag selector dropdown (first step) (#23394) - * Reduce duplicate and useless code in options (#23369) - * Convert `
` to ` + +
diff --git a/templates/admin/config_settings.tmpl b/templates/admin/config_settings.tmpl index d7fb022274..02ab5fd0fb 100644 --- a/templates/admin/config_settings.tmpl +++ b/templates/admin/config_settings.tmpl @@ -7,14 +7,14 @@
{{ctx.Locale.Tr "admin.config.disable_gravatar"}}
- +
{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}
- +
diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl index 3cb641488c..ee37f6ca75 100644 --- a/templates/admin/cron.tmpl +++ b/templates/admin/cron.tmpl @@ -23,8 +23,8 @@ {{ctx.Locale.Tr (printf "admin.dashboard.%s" .Name)}} {{.Spec}} - {{DateTime "full" .Next}} - {{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}-{{end}} + {{DateUtils.FullTime .Next}} + {{if gt .Prev.Year 1}}{{DateUtils.FullTime .Prev}}{{else}}-{{end}} {{.ExecTimes}} {{if eq .Status ""}}โ€”{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}} diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index bfd2ee6670..b61de666b8 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -2,7 +2,7 @@
{{if .NeedUpdate}}
-

{{ctx.Locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer}}

+

{{ctx.Locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer "https://forgejo.org/news"}}

{{end}}

@@ -76,7 +76,8 @@ {{ctx.Locale.Tr "admin.dashboard.system_status"}}

{{/* TODO: make these stats work in multi-server deployments, likely needs per-server stats in DB */}} -
+
+
{{template "admin/system_status" .}}
diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index 388863df9b..5c30df87af 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -38,6 +38,7 @@ {{ctx.Locale.Tr "admin.emails.primary"}} {{ctx.Locale.Tr "admin.emails.activated"}} + @@ -59,7 +60,14 @@ {{if .IsActivated}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{end}} + + + + {{else}} + {{ctx.Locale.Tr "repo.pulls.no_results"}} {{end}} @@ -95,4 +103,16 @@
+ + + {{template "admin/layout_footer" .}} diff --git a/templates/admin/layout_head.tmpl b/templates/admin/layout_head.tmpl index c1f5fb3314..8ba47f2f14 100644 --- a/templates/admin/layout_head.tmpl +++ b/templates/admin/layout_head.tmpl @@ -1,11 +1,9 @@ {{template "base/head" .ctxData}}
-
- {{template "base/alert" .ctxData}} -
-
+
{{template "admin/navbar" .ctxData}}
+ {{template "base/alert" .ctxData}} {{/* block: admin-setting-content */}} {{if false}}{{/* to make html structure "likely" complete to prevent IDE warnings */}} diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl index 16ec1b4b5b..1ec703b296 100644 --- a/templates/admin/navbar.tmpl +++ b/templates/admin/navbar.tmpl @@ -4,7 +4,7 @@ {{ctx.Locale.Tr "admin.dashboard"}} - {{if or .DatabaseType.IsMySQL .DatabaseType.IsMSSQL}} + {{if .DatabaseType.IsMySQL}} {{ctx.Locale.Tr "admin.self_check"}} diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 5ea003e5ec..08f0a4f204 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -21,9 +21,11 @@ {{.ID}} {{ctx.Locale.Tr .TrStr}} {{.Description}} - {{DateTime "short" .CreatedUnix}} + {{DateUtils.AbsoluteShort .CreatedUnix}} {{svg "octicon-note" 16}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.no_results"}} {{end}} {{if .Notices}} @@ -62,10 +64,7 @@ {{template "admin/layout_footer" .}} diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index 987ceab1e0..8c9c198897 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -63,9 +63,11 @@ {{.NumTeams}} {{.NumMembers}} {{.NumRepos}} - {{DateTime "short" .CreatedUnix}} + {{DateUtils.AbsoluteShort .CreatedUnix}} {{svg "octicon-pencil"}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.no_results"}} {{end}} diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index 863f11da25..5f9965e34c 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -2,10 +2,10 @@

{{ctx.Locale.Tr "admin.packages.package_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .TotalCount}}, - {{ctx.Locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}}, - {{ctx.Locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}}) + {{ctx.Locale.Tr "admin.packages.total_size" (ctx.Locale.TrSize .TotalBlobSize)}}, + {{ctx.Locale.Tr "admin.packages.unreferenced_size" (ctx.Locale.TrSize .TotalUnreferencedBlobSize)}})
-
+ {{.CsrfTokenHtml}}
@@ -70,10 +70,12 @@ {{.Repository.Name}} {{end}} - {{FileSize .CalculateBlobSize}} - {{DateTime "short" .Version.CreatedUnix}} + {{ctx.Locale.TrSize .CalculateBlobSize}} + {{DateUtils.AbsoluteShort .Version.CreatedUnix}} {{svg "octicon-trash"}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.no_results"}} {{end}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index 4b27d87a45..7a75ceded7 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -47,13 +47,13 @@ {{.ID}} - {{.Owner.Name}} + {{.Owner.Name}} {{if .Owner.Visibility.IsPrivate}} {{svg "octicon-lock"}} {{end}} - {{.Name}} + {{.Name}} {{if .IsArchived}} {{ctx.Locale.Tr "repo.desc.archived"}} {{end}} @@ -80,12 +80,14 @@ {{.NumStars}} {{.NumForks}} {{.NumIssues}} - {{FileSize .GitSize}} - {{FileSize .LFSSize}} - {{DateTime "short" .UpdatedUnix}} - {{DateTime "short" .CreatedUnix}} + {{ctx.Locale.TrSize .GitSize}} + {{ctx.Locale.TrSize .LFSSize}} + {{DateUtils.AbsoluteShort .UpdatedUnix}} + {{DateUtils.AbsoluteShort .CreatedUnix}} {{svg "octicon-trash"}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.no_results"}} {{end}} diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl index 6a8e203694..a95f6b5120 100644 --- a/templates/admin/repo/unadopted.tmpl +++ b/templates/admin/repo/unadopted.tmpl @@ -54,7 +54,7 @@ - {{template "base/modal_actions_confirm" (dict "ModalButtonColors" "yellow")}} + {{template "base/modal_actions_confirm"}}

diff --git a/templates/admin/self_check.tmpl b/templates/admin/self_check.tmpl index 94c4673a49..afcd4cd640 100644 --- a/templates/admin/self_check.tmpl +++ b/templates/admin/self_check.tmpl @@ -8,8 +8,6 @@ {{if .DatabaseCheckHasProblems}} {{if .DatabaseType.IsMySQL}}
{{ctx.Locale.Tr "admin.self_check.database_fix_mysql"}}
- {{else if .DatabaseType.IsMSSQL}} -
{{ctx.Locale.Tr "admin.self_check.database_fix_mssql"}}
{{end}} {{if .DatabaseCheckCollationMismatch}}
{{ctx.Locale.Tr "admin.self_check.database_collation_mismatch" .DatabaseCheckResult.ExpectedCollation}}
@@ -30,6 +28,13 @@ {{else}}
{{ctx.Locale.Tr "admin.self_check.no_problem_found"}}
{{end}} + + {{if .CacheError}} +
{{ctx.Locale.Tr "admin.config.cache_test_failed" .CacheError}}
+ {{end}} + {{if .CacheSlow}} +
{{ctx.Locale.Tr "admin.config.cache_test_slow" .CacheSlow}}
+ {{end}}
diff --git a/templates/admin/stacktrace-row.tmpl b/templates/admin/stacktrace-row.tmpl index 694bf56d96..048056cf4e 100644 --- a/templates/admin/stacktrace-row.tmpl +++ b/templates/admin/stacktrace-row.tmpl @@ -7,13 +7,15 @@ {{svg "octicon-cpu" 16}} {{else if eq .Process.Type "normal"}} {{svg "octicon-terminal" 16}} + {{else if eq .Process.Type "git"}} + {{svg "octicon-git-branch" 16}} {{else}} {{svg "octicon-code" 16}} {{end}}
{{.Process.Description}}
-
{{if ne .Process.Type "none"}}{{TimeSince .Process.Start ctx.Locale}}{{end}}
+
{{if ne .Process.Type "none"}}{{DateUtils.TimeSince .Process.Start}}{{end}}
{{if or (eq .Process.Type "request") (eq .Process.Type "normal")}} diff --git a/templates/admin/stacktrace.tmpl b/templates/admin/stacktrace.tmpl index e324570c96..afe8e6942a 100644 --- a/templates/admin/stacktrace.tmpl +++ b/templates/admin/stacktrace.tmpl @@ -8,11 +8,12 @@ {{ctx.Locale.Tr "admin.monitor.stacktrace"}}
-
-
- - {{ctx.Locale.Tr "tool.raw_seconds"}} -
+ + +
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 41b00defb4..a1ff3d4117 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -9,7 +9,7 @@ {{.CsrfTokenHtml}}
- +
@@ -61,6 +61,10 @@
+
+ + +
@@ -106,46 +110,53 @@
- +
+ {{ctx.Locale.Tr "admin.users.activated.description"}}
- +
+ {{ctx.Locale.Tr "admin.users.block.description"}}
- +
+ {{ctx.Locale.Tr "admin.users.admin.description"}}
- +
+ {{ctx.Locale.Tr "admin.users.restricted.description"}}
-
- +
+
+ {{ctx.Locale.Tr "admin.users.allow_git_hook_tooltip"}}
- +
+ {{ctx.Locale.Tr "admin.users.local_import.description"}}
{{if not .DisableRegularOrgCreation}}
- +
+ {{ctx.Locale.Tr "admin.users.organization_creation.description"}}
{{end}} @@ -197,6 +208,7 @@
+
{{ctx.Locale.Tr "avatar.constraints_hint" (ctx.Locale.TrSize .MaxAvatarFileSize) .MaxAvatarWidth .MaxAvatarHeight}}
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index e5d429952f..368e113d24 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -96,9 +96,9 @@ {{if .IsActive}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{if .IsRestricted}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{if index $.UsersTwoFaStatus .ID}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} - {{DateTime "short" .CreatedUnix}} + {{DateUtils.AbsoluteShort .CreatedUnix}} {{if .LastLoginUnix}} - {{DateTime "short" .LastLoginUnix}} + {{DateUtils.AbsoluteShort .LastLoginUnix}} {{else}} {{ctx.Locale.Tr "admin.users.never_login"}} {{end}} @@ -109,6 +109,8 @@
+ {{else}} + {{ctx.Locale.Tr "repo.pulls.no_results"}} {{end}} diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl index b04ebc4b60..0f7f930ec0 100644 --- a/templates/admin/user/new.tmpl +++ b/templates/admin/user/new.tmpl @@ -53,7 +53,7 @@
- +
diff --git a/templates/admin/user/view_details.tmpl b/templates/admin/user/view_details.tmpl index be2f32b5ec..c394b4bd3d 100644 --- a/templates/admin/user/view_details.tmpl +++ b/templates/admin/user/view_details.tmpl @@ -26,6 +26,14 @@ {{svg "octicon-x"}} {{end}}
+
+ {{ctx.Locale.Tr "admin.users.prohibit_login"}}: + {{if .User.ProhibitLogin}} + {{svg "octicon-check"}} + {{else}} + {{svg "octicon-x"}} + {{end}} +
{{ctx.Locale.Tr "admin.users.restricted"}}: {{if .User.IsRestricted}} diff --git a/templates/admin/user/view_emails.tmpl b/templates/admin/user/view_emails.tmpl index 22ce305a88..7e77206f1c 100644 --- a/templates/admin/user/view_emails.tmpl +++ b/templates/admin/user/view_emails.tmpl @@ -3,7 +3,7 @@
- {{.Email}} + {{.Email}} {{if .IsPrimary}}
{{ctx.Locale.Tr "settings.primary"}}
{{end}} diff --git a/templates/api/packages/pypi/simple.tmpl b/templates/api/packages/pypi/simple.tmpl index 77cb035600..181f8266e6 100644 --- a/templates/api/packages/pypi/simple.tmpl +++ b/templates/api/packages/pypi/simple.tmpl @@ -8,7 +8,7 @@ {{range .PackageDescriptors}} {{$p := .}} {{range .Files}} - {{.File.Name}}
+ {{.File.Name}}
{{end}} {{end}} diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl index 760d3bfa2c..e2853d3dab 100644 --- a/templates/base/alert.tmpl +++ b/templates/base/alert.tmpl @@ -1,20 +1,23 @@ {{if .Flash.ErrorMsg}} -
+

{{.Flash.ErrorMsg | SanitizeHTML}}

{{end}} {{if .Flash.SuccessMsg}} -
+

{{.Flash.SuccessMsg | SanitizeHTML}}

{{end}} {{if .Flash.InfoMsg}} -
+

{{.Flash.InfoMsg | SanitizeHTML}}

{{end}} {{if .Flash.WarningMsg}} -
+

{{.Flash.WarningMsg | SanitizeHTML}}

{{end}} +{{if and (not .Flash.ErrorMsg) (not .Flash.SuccessMsg) (not .Flash.InfoMsg) (not .Flash.WarningMsg) (not .IsHTMX)}} +
+{{end}} diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index fed426a469..3c2def228a 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -13,7 +13,7 @@ {{template "base/footer_content" .}} - + {{template "custom/footer" .}} diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 75b7845310..133ebac33a 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -1,12 +1,14 @@
- - - -