Commit graph

484 commits

Author SHA1 Message Date
Earl Warren 306e0706a1
GOVULNCHECK_PACKAGE: pin to v1 instead of patch version 2024-04-13 07:00:52 +02:00
Renovate Bot 463ead502d Update module golang.org/x/vuln/cmd/govulncheck to v1.0.4 2024-04-13 02:11:12 +00:00
Michael Kriese 222e69bfaa
Upgrade github.com/editorconfig-checker/editorconfig-checker to v2.8.0 2024-04-12 09:00:41 +02:00
Renovate Bot 1331c7de8a Update module github.com/rhysd/actionlint/cmd/actionlint to v1.6.27 2024-04-12 02:07:18 +00:00
Antonin Delpeuch 035bba89f5 Update golangci-lint to 1.57.2 2024-04-11 17:16:25 +02:00
Michael Kriese 9f4f7368d0 chore(renovate): Update deps inside Makefile 2024-04-11 13:46:27 +00:00
oliverpool 07d044a32c Makefile: test-e2e-sqlite-firefox 2024-04-09 16:50:10 +02:00
Earl Warren 2d3705bb81 Merge pull request '[CHORE] Remove Microsoft SQL Server support' (#3040) from gusted/forgejo-rm-mssql into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3040
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 05:34:54 +00:00
silverwind 2e542f17a3
replace jquery-minicolors with coloris (#30055)
Get rid of one more jQuery dependant and have a nicer color picker as
well.

Now there is only a single global color picker init because that is all
that's necessary because the elements are present on the page when the
init code runs. The init is slightly weird because the module only takes
a selector instead of DOM elements directly.

The label modals now also perform form validation because previously it
was possible to trigger a 500 error `Color cannot be empty.` by clearing
out the color value on labels.

<img width="867" alt="Screenshot 2024-03-25 at 00 21 05"
src="https://github.com/go-gitea/gitea/assets/115237/71215c39-abb1-4881-b5c1-9954b4a89adb">
<img width="860" alt="Screenshot 2024-03-25 at 00 20 48"
src="https://github.com/go-gitea/gitea/assets/115237/a12cb68f-c38b-4433-ba05-53bbb4b1023e">

(cherry picked from commit dd8dde2be89921b2b1497c6cc5eafdde213429cb)
2024-04-07 11:02:33 +02:00
Gusted 2d9afd0c21
[CHORE] Remove Microsoft SQL Server Support
- Per https://codeberg.org/forgejo/discussions/issues/122
2024-04-05 23:37:36 +02:00
Earl Warren ebf8eb5b85 Merge pull request '[RELEASE] GITEA_VERSION is a fallback for FORGEJO_VERSION' (#2861) from earl-warren/forgejo:wip-version into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2861
2024-03-30 22:23:37 +00:00
silverwind 3a7d05f1ac
Upgrade fabric to 6.0.0-beta20 (#30121)
Fixes https://github.com/go-gitea/gitea/issues/29326 because it includes
https://github.com/fabricjs/fabric.js/pull/9707.

(cherry picked from commit a9e5706696f7d593e281d33783877b7772e48e19)
2024-03-30 07:17:31 +01:00
silverwind 72a3a6fde7
Add svg linter and fix incorrect svgs (#30086)
Fixes https://github.com/go-gitea/gitea/issues/30082.

Adds a new linter that searches for non-existant SVG images in
templates. Output before the fix was:

```
$ make lint-templates
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-markup" not found, used in templates/repo/diff/comment_form.tmpl
make: *** [Makefile:438: lint-templates] Error 1
```

<img width="306" alt="Screenshot 2024-03-25 at 23 31 05"
src="https://github.com/go-gitea/gitea/assets/115237/1052d1a9-bfec-4d5a-9cae-f895f78f7c93">

(cherry picked from commit 2ab5f05f40d93224f73e211e84de50a88a6ecf03)

Conflicts:
	.github/workflows/files-changed.yml
	.github/workflows/pull-compliance.yml
	do not exist in Forgejo and the Forgejo workflows
	already contain the changes
2024-03-30 07:17:30 +01:00
Earl Warren 6647e4d53f
[I18N] make merge-locales & build/merge-forgejo-locales.go are noop
Instead of failing or do things that could be damaging, this script
prints a deprecation notice. It fixes the unnecessary breaking
change introduced in `[I18n] tooling and process`.

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/version-management/forgejo/default.nix#L80

$ make merge-locales
NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY
$ go run build/merge-forgejo-locales.go
NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY

Also remove the build/crowdin-to-weblate.sh script that was never
needed.
2024-03-28 18:02:55 +01:00
Earl Warren 869795a530
[RELEASE] GITEA_VERSION is a fallback for FORGEJO_VERSION
Existing Forgejo packages may rely on setting GITEA_VERSION to specify
the version to build if:

* they do not build from the git repository with the proper tag
* they build from a source tarbal that does not have a VERSION file

With 7.0 the logic of setting the version was modified in the
`[RELEASE] Gitea version is for interoperability only` commit and
ignores this variable which creates an unecessary breaking change.

If GITEA_VERSION is set, the versions will be set on 7.0 exactly as
they would have with version before and included 1.21.

* If GITEA_VERSION is not set, all versions are the same
* If GITEA_VERSION is set, there is a distinction between the version
  set in the binary are returned by the Gitea API and the
  version returned by the Forgejo API which includes metadata.

Before:

$ make GITEA_VERSION=7.0.0 show-version-full
7.0.0-dev-1809-cd6fa771ab+gitea-1.22.0
$ make GITEA_VERSION=7.0.0 show-version-api
7.0.0-dev-1809-cd6fa771ab+gitea-1.22.0

After:

$ make GITEA_VERSION=7.0.0 show-version-full
7.0.0
$ make GITEA_VERSION=7.0.0 show-version-api
7.0.0+gitea-1.22.0
2024-03-28 16:18:52 +01:00
silverwind 3d99b43dd2
remove PATH and GOPATH modification in Makefile (#29978)
We don't need these modifications anymore since all tool
dependencies run via `go run`.

(cherry picked from commit ef33dcf946cc9754b51c955975d67f871702b958)
2024-03-26 19:04:26 +01:00
silverwind 6eb576c36d
move some scripts from 'build' to 'tools' directory, misc refactors (#29844)
- Move some scripts from `build` to new `tools` dir. Eventually i would
like to move all but let's do it step-by-step.
- Add dir to eslint and move the files into vars.
- Update docs accordingly.
- While updating docs I noticed we were incorrectly having `public/img`
path still in a few places. Replace those with the current
`public/assets/img`.

---------

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 095fdd691dd1a7d7748372cc73e7708278c80933)
2024-03-26 19:04:25 +01:00
Earl Warren 89f8d33127 Merge pull request '[CI] simplify end-to-end test cascading PR' (#2706) from wip-ci-end-to-end into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2706
2024-03-20 18:12:41 +00:00
Earl Warren a1889ac348
[CI] simplify end-to-end test cascading PR
Closes: https://codeberg.org/forgejo/forgejo/issues/2670
2024-03-20 18:16:56 +01:00
Daniel YC Lin 4eb8a09423
Fix document error about 'make trans-copy' (#29710)
Change document to 'make docs'

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
(cherry picked from commit 607ed27b4fb8ead346f89b379d9788f5c76fb799)
2024-03-20 08:46:29 +01:00
oliverpool f3180fa1d6 [CI] FORGEJO_VERSION drop "g" prefix
Added by git describe, but is confusing
2024-03-19 10:36:45 +01:00
oliverpool 98f1fe7944 Makefile: check git diff exit-code (#2651)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2651
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-14 10:38:58 +00:00
silverwind 2cb07e8415
Regenerate fomantic lockfile and build it with our browserslist (#29560)
1. Make fomantic build use [our
browserslist](e3524c63d6/package.json (L99)).
I found no other way than to sed-replace into it's js, the normal
browserlist config files do not work. The effect of this change is the
removal of some uneeded CSS vendor prefixes.
2. Regenerate `web_src/fomantic/package-lock.json`, this might shut up
some security scanners.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit da3b7f5039158faae4b617ca878061f8a4f3e489)
2024-03-11 23:36:58 +07:00
Earl Warren d257fa179b
[CI] do not hardcode the Forgejo release in end-to-end testing
Now that Forgejo has its own release number, use the Makefile as a
reference.

Also document and improve support for debugging this
pull_request_target workflow by using a branch in the repository.
2024-03-06 03:15:07 +08:00
Earl Warren 07b99560cc
[SEMVER] X.Y.Z+A.B.C replaced with X.Y.Z+gitea-A.B.C
Gitea versions are

* A.B.C
* A.B.C+rc-0
* A.B.C+dev-5-g4fb9056

If Forgejo versions are:

* X.Y.Z+A.B.C
* X.Y.Z-rc0+A.B.C
* X.Y.Z-dev-1232-g4fb905687+A.B.C

It is non trivial for a client trying to sort out if the server
responding to `/api/v1/version` is Forgejo or Gitea. The Forgejo
version changes to be:

* X.Y.Z+gitea-A.B.C
* X.Y.Z-rc0+gitea-A.B.C
* X.Y.Z-dev-1232-g4fb905687+gitea-A.B.C

and a client can now:

* Split the version with +
* If the second part (the metadata) exists and contains "gitea", the
  answer server is Forgejo
* Otherwise it is Gitea
2024-02-28 15:57:48 +01:00
Earl Warren 4fb9056877 Merge pull request '[RELEASE] switch to semantic versioning' (#2459) from earl-warren/forgejo:wip-release-number into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2459
Reviewed-by: Otto <otto@codeberg.org>
2024-02-28 10:18:20 +00:00
oliverpool f489341fe6 [Swagger] update to latest version 2024-02-27 20:45:57 +00:00
silverwind cfda925862
Add tailwindcss (#29357)
This will get tailwindcss working on a basic level. It provides only the
utility classes, e.g. no tailwind base which we don't need because we
have our own CSS reset. Without the base, we also do not have their CSS
variables so a small amount of features do not work and I removed the
generated classes for them.

***Note for future developers: This currently uses a `tw-` prefix, so we
use it like `tw-p-3`.***

<details>
<summary>Currently added CSS, all false-positives</summary>

```
.\!visible{

    visibility: visible !important
}

.visible{

    visibility: visible
}

.invisible{

    visibility: hidden
}

.collapse{

    visibility: collapse
}

.static{

    position: static
}

.\!fixed{

    position: fixed !important
}

.absolute{

    position: absolute
}

.relative{

    position: relative
}

.sticky{

    position: sticky
}

.left-10{

    left: 2.5rem
}

.isolate{

    isolation: isolate
}

.float-right{

    float: right
}

.float-left{

    float: left
}

.mr-2{

    margin-right: 0.5rem
}

.mr-3{

    margin-right: 0.75rem
}

.\!block{

    display: block !important
}

.block{

    display: block
}

.inline-block{

    display: inline-block
}

.inline{

    display: inline
}

.flex{

    display: flex
}

.inline-flex{

    display: inline-flex
}

.\!table{

    display: table !important
}

.inline-table{

    display: inline-table
}

.table-caption{

    display: table-caption
}

.table-cell{

    display: table-cell
}

.table-column{

    display: table-column
}

.table-column-group{

    display: table-column-group
}

.table-footer-group{

    display: table-footer-group
}

.table-header-group{

    display: table-header-group
}

.table-row-group{

    display: table-row-group
}

.table-row{

    display: table-row
}

.flow-root{

    display: flow-root
}

.inline-grid{

    display: inline-grid
}

.contents{

    display: contents
}

.list-item{

    display: list-item
}

.\!hidden{

    display: none !important
}

.hidden{

    display: none
}

.flex-shrink{

    flex-shrink: 1
}

.shrink{

    flex-shrink: 1
}

.flex-grow{

    flex-grow: 1
}

.grow{

    flex-grow: 1
}

.border-collapse{

    border-collapse: collapse
}

.select-all{

    user-select: all
}

.resize{

    resize: both
}

.flex-wrap{

    flex-wrap: wrap
}

.overflow-visible{

    overflow: visible
}

.rounded{

    border-radius: 0.25rem
}

.border{

    border-width: 1px
}

.text-justify{

    text-align: justify
}

.uppercase{

    text-transform: uppercase
}

.lowercase{

    text-transform: lowercase
}

.capitalize{

    text-transform: capitalize
}

.italic{

    font-style: italic
}

.text-red{

    color: var(--color-red)
}

.text-shadow{

    color: var(--color-shadow)
}

.underline{

    text-decoration-line: underline
}

.overline{

    text-decoration-line: overline
}

.line-through{

    text-decoration-line: line-through
}

.outline{

    outline-style: solid
}

.ease-in{

    transition-timing-function: cubic-bezier(0.4, 0, 1, 1)
}

.ease-in-out{

    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
}

.ease-out{

    transition-timing-function: cubic-bezier(0, 0, 0.2, 1)
}
```

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit f4b92578b4601bc6e9b631b9a5a5f3766c27b0cb)
2024-02-26 22:30:27 +01:00
silverwind 643d66ee0e
Upgrade to fabric 6 (#29334)
Upgrade fabric to latest v6 beta. It works for our use case, even
thought it does not fix the upstream issue
https://github.com/fabricjs/fabric.js/issues/9679 that
https://github.com/go-gitea/gitea/issues/29326 relates to.

(cherry picked from commit c4b0cb4d0d527793296cf801e611f77666f86551)

Conflicts:
	public/assets/img/favicon.svg
	public/assets/img/logo.svg
2024-02-26 22:30:26 +01:00
silverwind 3591d9bff9
Don't install playwright twice (#29302)
1. `playwright/test` is already installed as part of `deps-frontend` on
CI which runs before, so it's better to not install it again (on a
potentially different version), and just use the version from
package.json and add the `deps-frontend` dependency.
2. `PLAYWRIGHT_DIR` is a undefined variable, so I removed it

```bash
$ git show c8ded77680 | grep PLAYWRIGHT_DIR
+playwright: $(PLAYWRIGHT_DIR)
```

(cherry picked from commit c236e64aca42b9ab0743431bc505033a0cb78b93)
2024-02-26 22:30:25 +01:00
Earl Warren 4b8fecd71e
[RELEASE] switch to semantic versioning
The release number displayed by the API and the CLI becomes:

7.0.0+1.22.0

instead of

1.22.0

It would otherwise be inconsistent to have different version number depending on the interface. With the current implementation `/api/forgejo/v1/version` would return `7.0.0+1.22.0` while `/api/v1/version` would return `1.22.0`. The release would be announced as `7.0.0+1.22.0` but the web API would display `1.22.0`.

It may cause some tools that are Gitea specific to not behave as they should in the future if they expect a Gitea version number and activate some features depending on what it is. They would need to be patched to strip the leading Forgejo version number before asserting the Gitea version.

Refs: https://codeberg.org/forgejo/forgejo/issues/2425
2024-02-25 17:00:26 +01:00
Earl Warren 2762dd9597
[CI] name the test release after the latest v*-dev tag
Also ignore the *-test tags when figuring out the Forgejo version,
they exist in the integration repository and experimental repository
for daily releases.
2024-02-23 15:37:46 +01:00
Malte Jürgens 5c67c34ce8
Add e2e debug server
This adds the ability to run `make test-e2e-debugserver` to start a
forgejo server pupulated with the test data from `models/fixtures`. This
is particularly useful for debugging the e2e tests with a external tool,
such as the Playwright extension for VSCode [1].

[1] https://open-vsx.org/extension/ms-playwright/playwright
2024-02-21 20:47:57 +01:00
wxiaoguang 81925ebb0c
Refactor more code in templates (#29236)
Follow #29165.

* Introduce JSONTemplate to help to render JSON templates
* Introduce JSEscapeSafe for templates. Now only use `{{ ... |
JSEscape}}` instead of `{{ ... | JSEscape | Safe}}`
* Simplify "UserLocationMapURL" useage

(cherry picked from commit 31bb9f3247388b993c61a10190cfd512408ce57e)
2024-02-19 22:58:32 +01:00
silverwind 800fa60ee5
Disable parallel Make execution (#29186)
Ref:
https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html

> If the .NOTPARALLEL special target with no prerequisites is specified
anywhere then the entire instance of make will be run serially,
regardless of the parallel setting

(cherry picked from commit 69ed1a4afbc9604cabe83041de31752dd5d101ee)

Conflicts:
	README.md
2024-02-17 23:24:31 +01:00
Earl Warren 014e533206
[RELEASE] decouple the release name from the version number
The release name, as provided by FORGEJO_RELEASE, is used to build OCI
images and binary files. Although it can be the same as the Forgejo
version, it is not a requirement.

When the FORGEJO_RELEASE environment variable is set, use it as a
default for naming the binary file instead of FORGEJO_VERSION. For
instance, when building from the forgejo branch here is what is desired:

FORGEJO_VERSION=7.0.0-g2343
GITEA_VERSION=1.22.0
VERSION=vforgejo-test

The name of the release is also displayed with forgejo --version
for sanity check purposes.

Before:

FORGEJO_VERSION is the computed version
GITEA_VERSION is set manually
VERSION defaults to FORGEJO_VERSION
forgejo --help does not display VERSION

After:

FORGEJO_VERSION is the computed version
GITEA_VERSION is set manually
RELEASE_VERSION defaults to FORGEJO_VERSION
VERSION defaults to RELEASE_VERSION
forgejo --help displays VERSION
2024-02-17 15:27:35 +01:00
Earl Warren 79df409256
[CI] upgrade to golangci-lint@v1.56.1 2024-02-15 16:19:28 +01:00
Earl Warren db3b867b02
[RELEASE] Gitea version is for interoperability only
Forgejo now has its own lifecycle and its version is derived from the
tag. The Gitea tags are no longer found in the Forgejo codebase and
can no longer be used for that purpose.

When a Forgejo release is published, for interoperability with the
existing tools in the ecosystem, it advertises the supported Gitea
version via /api/v1/version. It is set in the Makefile manually and
cannot be automatically set.

https://codeberg.org/forgejo-contrib/delightful-forgejo#packaging

Existing Forgejo packages rely on the Makefile to build and the change
must be done in a way that tries to not break their assumptions. From
the point of view of a Forgejo package build, the following will
happen on the next major release:

- The package version will bump from v1.21.x to v7.0.0
- /api/v1/version will bump from v1.21.x to v1.22.0
- /api/forgejo/v1/version will bump from v6.x to v7.0.0

The Makefile uses the following variables:

GITEA_VERSION is returned by /api/v1/version
FORGEJO_VERSION is returned by /api/forgejo/v1/version
VERSION is used in the name the binary file and the source archive

Before:

GITEA_VERSION is the computed version
FORGEJO_VERSION is set manually
VERSION defaults to GITEA_VERSION

After:

FORGEJO_VERSION is the computed version
GITEA_VERSION is set manually
VERSION defaults to FORGEJO_VERSION

When the version is computed, it comes from:

- The content of the VERSION file if it exists. It is inserted in
  the source archive because it does not contain a git repository
- Otherwise the output of `git describe`
2024-02-11 15:36:58 +01:00
silverwind 22c694a9e9
[gitea] add lint-spell-fix to lint-fix (#29111)
Followup to https://github.com/go-gitea/gitea/pull/29106, fix this
oversight.

(cherry picked from commit c7a21cbb0c5f8302495fa24baf218dc3462de2c5)
2024-02-10 10:53:43 +01:00
silverwind 6fcb8e652b
[gitea] Rework spellchecking, add lint-spell (#29106)
- Use maintained fork https://github.com/golangci/misspell
- Rename `mispell-check` to `lint-spell`, add `lint-spell-fix`
- Run `lint-spell` in separate actions step
- Lint more files, fix discovered issues
- Remove inaccurate and outdated info in docs (we do not need GOPATH for
tools anymore)

Maybe later we can add more spellchecking tools, but I have not found
any good ones yet.

(cherry picked from commit 9c39f8515fa88d644736c6773d7a05d070a02e82)

Conflicts:
	.github/workflows/pull-compliance.yml
	Makefile
2024-02-10 10:53:43 +01:00
Loïc Dachary 5e76094b80
[BRANDING] add forgejo target to Makefile
The gitea target is kept as is, for the sake of compatibility with
build systems that rely on it. The forgejo target creates a hard link
with forgejo.

(cherry picked from commit ce156c7cb4)
(cherry picked from commit b2cb232825)
(cherry picked from commit 85543c22bd)
(cherry picked from commit 302955a20d)
(cherry picked from commit 4b1be0858e)
(cherry picked from commit afed1a6e20)
(cherry picked from commit e81304bcd1)
(cherry picked from commit 479cd51a03)
(cherry picked from commit 8baab7c0c1)
(cherry picked from commit 5d25ad9f09)
(cherry picked from commit f36942789f)
(cherry picked from commit 9abfbae8a0)
(cherry picked from commit 079e0efb01)
(cherry picked from commit 0f1b83005a)
(cherry picked from commit 3cc227aaff)
(cherry picked from commit 245310c682)
(cherry picked from commit 3f83e30c93)
(cherry picked from commit e2bdd6af3d)
(cherry picked from commit fb3ac3a20b)
(cherry picked from commit 0ffbd46032)
(cherry picked from commit 1ba9e954e2)
(cherry picked from commit d4bc10d1e7)
(cherry picked from commit e54dc7293e)
(cherry picked from commit f50e5132d4)
(cherry picked from commit 335abddaa0)
(cherry picked from commit 61e80ffb1f)
(cherry picked from commit 4832167235)
(cherry picked from commit 1bbe7816b2)
2024-02-05 16:05:02 +01:00
Gusted f7f813ab84
[BRANDING] Replace branding in Swagger
- "Gitea" is automatically being determined in Swagger and cannot be
overridden, therefor we override it after `swagger generate spec` is run.
- Resolves https://codeberg.org/forgejo/forgejo/issues/226

(cherry picked from commit 0b45380765)

[BRANDING] Change Swagger title to Forgejo API

(cherry picked from commit 79f6a70b53)
(cherry picked from commit 6cd47afe33)
(cherry picked from commit a7ae2e4c09)
(cherry picked from commit 59f837e466)
(cherry picked from commit c1c3d1f0e6)
(cherry picked from commit 4b088713fb)
(cherry picked from commit 3df1d21371)
(cherry picked from commit a4a5fdbde4)
(cherry picked from commit 57aa9ed710)
(cherry picked from commit 948b49bf94)
(cherry picked from commit be4929ab6a)
(cherry picked from commit 9ecb507457)

Conflicts:
	templates/swagger/ui.tmpl
(cherry picked from commit 8e57e68863)
(cherry picked from commit f0b3f621e3)
(cherry picked from commit 5b0a6d093e)
(cherry picked from commit 2e0f6b5de8)
(cherry picked from commit bb08076f5c)
(cherry picked from commit 5c9360e38a)
(cherry picked from commit 2f27756148)
(cherry picked from commit 6fce7eeb51)
(cherry picked from commit 8d27e7bebd)
(cherry picked from commit fda2ee2aae)
(cherry picked from commit fe0489a4d8)
(cherry picked from commit fe9479b357)
(cherry picked from commit 1deadb2f35)
(cherry picked from commit d1cb84b2f2)
(cherry picked from commit 9de15d49f8)
(cherry picked from commit 461fbe219c)
(cherry picked from commit f39bf3ba5b)
(cherry picked from commit b3f31c2f7b)
(cherry picked from commit b9f493c139)
(cherry picked from commit 83781b1641)
(cherry picked from commit 4438ee0434)
(cherry picked from commit 56b6b36833)
(cherry picked from commit dde88ed2fd)
(cherry picked from commit 96bb13ce54)
(cherry picked from commit aacc824826)
(cherry picked from commit 0db579b0b3)
(cherry picked from commit c1fd3777de)

Conflicts:
	templates/swagger/v1_json.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1832
(cherry picked from commit 5c8a6e1ca8)
(cherry picked from commit ff145b32c7)
(cherry picked from commit db9b904b84)
(cherry picked from commit a79e2b2b56)
(cherry picked from commit a5830247df)
(cherry picked from commit 9120bc4617)
(cherry picked from commit cd873945b2)
(cherry picked from commit 6a48e3ea5b)
(cherry picked from commit 489c1ac8fb)
(cherry picked from commit a1f7fd771e)
2024-02-05 16:02:14 +01:00
Earl Warren c070935f13
[SEMVER] 7.0.0+0-gitea-1.22.0
[SEMVER] 6.0.0+0-gitea-1.21.0

(cherry picked from commit 4107d99f25)
(cherry picked from commit 7e097b945c)
(cherry picked from commit 431edaac36)
(cherry picked from commit 51ecd89e31)
(cherry picked from commit 734d7f5bc7)
(cherry picked from commit f34e88d00c)
(cherry picked from commit cd882a75f9)
(cherry picked from commit 7dfa28db3f)
(cherry picked from commit 4bdaeeb686)
(cherry picked from commit a0e8285914)
(cherry picked from commit 72991a99f3)
(cherry picked from commit c99949bbf7)
(cherry picked from commit d4dd7df8e7)
(cherry picked from commit 1fe5c1e81e)
(cherry picked from commit 969b727c50)
(cherry picked from commit f2061a87c0)
(cherry picked from commit 2d75f86f0e)
(cherry picked from commit 29119a870f)
(cherry picked from commit 76dd36c9eb)
(cherry picked from commit ea761bd43c)
(cherry picked from commit 561faf9af5)

(cherry picked from commit 78e512770f)
(cherry picked from commit e16f5b02c6)
(cherry picked from commit c120212caf)
(cherry picked from commit a4807748c3)
(cherry picked from commit 78fd92eae3)
(cherry picked from commit 2f80066217)
(cherry picked from commit 598756833e)
(cherry picked from commit 93f62e9852)
2024-02-05 15:08:04 +01:00
Gusted 6f960f23e5
[CLEANUP] Reuse ForgejoVersion variable
- Resolves https://codeberg.org/forgejo/forgejo/issues/1226

(cherry picked from commit e383b70109)
(cherry picked from commit 029cfa34de)
(cherry picked from commit 81392b8c55)
(cherry picked from commit 0ebecca1e6)
(cherry picked from commit aff135418d)
(cherry picked from commit b5982f5008)
(cherry picked from commit 00f86df8f4)
(cherry picked from commit 178908c047)
(cherry picked from commit 9cc57d1b3f)
(cherry picked from commit dc80ba9a97)
(cherry picked from commit 5b2f1d7149)
(cherry picked from commit f0ab85cd06)
2024-02-05 14:45:11 +01:00
Gusted 089f51a63c
[DEADCODE] Add deadcode linter
- Add the experimental
[deacode](https://pkg.go.dev/golang.org/x/tools/internal/cmd/deadcode)
linter to Forgejo.
- To deal with false positives that can happen due to build tags or with code
that's currently only referenced by test code, the output of the tool is
compared against a known-good output.
- This commit doesn't make any attempt to remove any deadcode.

(cherry picked from commit ac462279e9)
(cherry picked from commit b5ea6e85ac)
(cherry picked from commit 5915f3643c)

[CLEANUP] Remove deadcode

- This is deadcode since https://codeberg.org/forgejo/forgejo/pulls/1802
removed the usage of it.

(cherry picked from commit d840b9923e)
(cherry picked from commit 9442bab626)
(cherry picked from commit 0de9d18863)
(cherry picked from commit 26abf78374)
(cherry picked from commit 05d3a143c3)
(cherry picked from commit 4b3d38d5e1)
(cherry picked from commit a726e71986)
(cherry picked from commit cb62ae5b98)
(cherry picked from commit 8195ba06d5)
(cherry picked from commit 4570fb591a)
(cherry picked from commit 1f4d33de2b)
2024-02-05 14:45:09 +01:00
Earl Warren 081a155cc1
[SEMVER] store SemVer in ForgejoSemVer after a database upgrade
(cherry picked from commit b7fe7cf401)
(cherry picked from commit cf339eed4f)
(cherry picked from commit 4f3a16168b)
(cherry picked from commit 6f5bbc53fc)
(cherry picked from commit aca42b422e)
(cherry picked from commit 5a7f7580e5)
(cherry picked from commit 06c383c807)
(cherry picked from commit fe831dcb53)
(cherry picked from commit cd12cd0dbc)
(cherry picked from commit cc79163703)
(cherry picked from commit 0102a5715e)
(cherry picked from commit 403f7520b3)
(cherry picked from commit a3b61510a2)
(cherry picked from commit f83f0f9feb)
(cherry picked from commit fd1c3a6d09)
(cherry picked from commit f7cdc3d6f1)
(cherry picked from commit 060121b644)
(cherry picked from commit 62c847ff02)
(cherry picked from commit 4d051b51c2)
(cherry picked from commit 86e6981a93)
(cherry picked from commit c1fc9e441b)
(cherry picked from commit 8bb2f0871a)
(cherry picked from commit 0cd9fe5251)
(cherry picked from commit b0b44778b4)
(cherry picked from commit 7c2f4f749f)
2024-02-05 14:44:33 +01:00
Gusted 8bb5e8b2b4
[DB] Forgejo database migrations
- Implements https://codeberg.org/forgejo/discussions/issues/32#issuecomment-918737
- Allows to add Forgejo-specific migrations that don't interfere with Gitea's migration logic. Please do note that we cannot liberally add migrations for Gitea tables, as they might do their own migrations in a future version on that table, and that could undo our migrations. Luckily,  we don't have a scenario where that's needed and thus not taken into account.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/795
(cherry picked from commit 8ee32978c0)
(cherry picked from commit c240b34f59)
(cherry picked from commit 03936c6492)
(cherry picked from commit a20ed852f8)
(cherry picked from commit 1dfa82676f)
(cherry picked from commit c39ae0bf8a)
(cherry picked from commit cfaff08996)
(cherry picked from commit 94a458835a)
(cherry picked from commit 61a3cf77df)
(cherry picked from commit abb350fde8)
(cherry picked from commit 5194829d6b)
(cherry picked from commit 89239a60f2)
(cherry picked from commit 683cfd86ef)
(cherry picked from commit f4546cfed9)
(cherry picked from commit 86614d5826)
(cherry picked from commit e4b9c32187)
(cherry picked from commit 8c253719af)
(cherry picked from commit 857365d6c1)
(cherry picked from commit a488b3952f)
(cherry picked from commit 98313c4910)
(cherry picked from commit 430d95e824)
(cherry picked from commit 08bf9d918f)
(cherry picked from commit f8a170e2d0)
(cherry picked from commit d20e325378)
(cherry picked from commit 6c0aa7dd4f)
(cherry picked from commit 46c08c26c7)
(cherry picked from commit 9ee22153c4)

[DB] Ensure forgejo migration up to date (squash)

- Hook Forgejo's `EnsureUpToDate` to Gitea's `EnsureUpToDate`, such that
the Forgejo migrations are also being checked to be up to date.
- I'm not sure how I missed this and if this has caused any problems,
but due to the lack of any open issue about it it seems to not be a big
problem.

(cherry picked from commit 6c65b6dcf6)
(cherry picked from commit 6d45c37d84)

[DB] Add test for TestEnsureUpToDate (squash)

- Add a test for the behavior of `EnsureUpToDate`, to ensure it will
error when needed and succeed when the forgejo version is up to date.
- Add forgejo_migrations package to GO_TEST_PACKAGES, to avoid running
it with `test-unit` and instead test it with `test-*-migration`.

(cherry picked from commit b172a50691)
(cherry picked from commit d8af308820)
(cherry picked from commit e69e64a32c)
(cherry picked from commit 4e8363fad4)
(cherry picked from commit fc9ecd6c53)
(cherry picked from commit e5c446e3dc)
(cherry picked from commit 7066a15655)
(cherry picked from commit 9183cdc835)
(cherry picked from commit 5f93039e0d)

Conflicts:
	Makefile
	https://codeberg.org/forgejo/forgejo/pulls/2245
(cherry picked from commit a039b3b0c9)
2024-02-05 14:44:33 +01:00
Earl Warren c3985f05e8
[API] Forgejo API /api/forgejo/v1
(cherry picked from commit 20b5669269)
(cherry picked from commit 1574643a6a)

Update semantic version according to specification

(cherry picked from commit 22510f4130)

Mise à jour de 'Makefile'

(cherry picked from commit c3d85d8409)
(cherry picked from commit 5ea2309851)
(cherry picked from commit ec5217b9d1)
(cherry picked from commit 14f08e364b)
(cherry picked from commit b4465c67b8)

[API] [SEMVER] replace number with version

(cherry picked from commit fba48e6497)
(cherry picked from commit 532ec5d878)

[API] [SEMVER] [v1.20] less is replaced by css

(cherry picked from commit 01ca3a4f42)
(cherry picked from commit 1d928c3ab2)
(cherry picked from commit a39dc804cd)

Conflicts:
	webpack.config.js
(cherry picked from commit adc68578b3)
(cherry picked from commit 9b8d98475f)
(cherry picked from commit 2516103974)
(cherry picked from commit 18e6287963)
(cherry picked from commit e9694e67ab)
(cherry picked from commit a9763edaf0)
(cherry picked from commit e2b550f4fb)
(cherry picked from commit 2edac36701)

[API] Forgejo API /api/forgejo/v1 (squash)

Update semver as v1.20 is entering release candidate mode

(cherry picked from commit 4995098ec3)
(cherry picked from commit 578ccfdd27)
(cherry picked from commit 1bf6ac0952)
(cherry picked from commit 2fe16b2bfe)
(cherry picked from commit 7cd9d027ee)
(cherry picked from commit eaed4be2ae)
(cherry picked from commit cc94f3115f)
(cherry picked from commit d7a77e35cc)
(cherry picked from commit cd8eb68ab7)
(cherry picked from commit 68487ac95f)
(cherry picked from commit 616dceb565)
(cherry picked from commit 545fe5975b)
(cherry picked from commit c042cf8eda)
(cherry picked from commit ae5e5a7468)
(cherry picked from commit 8034ef5fa2)
(cherry picked from commit aaf0293034)
(cherry picked from commit daafa8ce58)
(cherry picked from commit 7ca3681d3e)
(cherry picked from commit 39f72cba71)
(cherry picked from commit 60a5917130)
(cherry picked from commit 4853bd9e16)

[API] Move forgejo api file (squash)

- Move the file to accommodate faa28b5a44

(cherry picked from commit bce89351d2)
(cherry picked from commit 11ae7f6e85)
(cherry picked from commit 25e96cfcb2)
(cherry picked from commit 6d8d19b391)
(cherry picked from commit 5afc5c454b)
(cherry picked from commit 86d07b4c24)
(cherry picked from commit e54d869fda)
(cherry picked from commit ab31ef1bba)
(cherry picked from commit 511cbca2f3)
(cherry picked from commit 333916fea8)
(cherry picked from commit 3802bcd7c9)
(cherry picked from commit 5d0fa034f7)
(cherry picked from commit d15627aa0d)
(cherry picked from commit ba0b21b930)
(cherry picked from commit 39ade66aac)
2024-02-05 14:44:32 +01:00
Earl Warren 5679773afc
[TESTS] add GOLANGCI_LINT_ARGS to control golangci calls
It is for instance useful with:

GOLANGCI_LINT_ARGS="--concurrency $(expr $(nproc) / 2)" make lint-backend

on a laptop where overcommitting the CPU degrades the UI performances.

(cherry picked from commit 76023319c4)
(cherry picked from commit 55eb05b03d)
(cherry picked from commit 49c84de3df)
(cherry picked from commit e8e26f08a6)
(cherry picked from commit 401aa12cac)
(cherry picked from commit 4ae8f663ad)
(cherry picked from commit 2d87e4953b)
(cherry picked from commit e79be7d80e)
(cherry picked from commit 65e3673998)
(cherry picked from commit 54e5a5dca2)
(cherry picked from commit 99e8725e68)
(cherry picked from commit c2048b352f)
(cherry picked from commit ad142d18a8)
(cherry picked from commit 489d42770e)
(cherry picked from commit 2de9069ed4)
(cherry picked from commit 782d8ef6df)
(cherry picked from commit 2068b26cd9)
(cherry picked from commit 1857f062dd)
(cherry picked from commit beced6a2cc)
(cherry picked from commit 538ca28ee8)
(cherry picked from commit cc25e3f35f)
2024-02-05 14:44:32 +01:00
Gusted e8c1bfc2e5
[CI] Fix false positive in database migration
- This also means that if one of the test fails, it will actually
propagate to make and subsequently fail the test.
- Remove the 'delete duplicates issue users' code, I checked this
against my local development database (which contains quite bizarre
cases, even some that Forgejo does not like), my local instance database
and against Codeberg production and they all yielded no results to this
query, so I'm removing it thus resolving the error that the delete code
was not compatible with Mysql.
- Sync all tables that are requires by the migration in the test.
- Resolves #2206

(cherry picked from commit 8e02be7e89)
(cherry picked from commit 006f064416)
2024-02-05 13:33:59 +01:00