Commit graph

468 commits

Author SHA1 Message Date
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
Earl Warren ea5f84bf66
[CI] Forgejo Actions based CI for PR & branches (squash) lint workflows
(cherry picked from commit 074f49937e)
(cherry picked from commit 0c1c7d61e2)
(cherry picked from commit 4e4dc0e0e4)
(cherry picked from commit 95dcd5a91a)
(cherry picked from commit e260fbc445)
(cherry picked from commit 805c72c9ce)
(cherry picked from commit 92c084fd2c)
2024-02-05 13:33:59 +01:00
Earl Warren 5e6bf138af
[CI] Makefile: release: only supported platforms
(cherry picked from commit 16381262c5)
(cherry picked from commit c93f41dcef)
(cherry picked from commit cf17c69487)
(cherry picked from commit 174b8cf327)
(cherry picked from commit ae1b8dd441)
(cherry picked from commit 1b56d9049f)
(cherry picked from commit 6b00196175)
(cherry picked from commit 087b38c3f3)
(cherry picked from commit 70fcc63816)
(cherry picked from commit 81e2f27426)
(cherry picked from commit 9741a9960b)
(cherry picked from commit 0625fc7ad8)
(cherry picked from commit e7758aaa94)
(cherry picked from commit be25432687)
(cherry picked from commit 64c6d2f263)
(cherry picked from commit 3445ae53e3)
(cherry picked from commit 3e359ef3cd)
(cherry picked from commit 3c44026cc5)
(cherry picked from commit 9528250188)
(cherry picked from commit 840a307a25)
(cherry picked from commit 1c486047ac)
(cherry picked from commit 7e6ccb52ff)
(cherry picked from commit 7a1b3fef59)
2024-02-05 13:33:59 +01:00
Earl Warren 460f3c1752
[CI] lint-go-vet: do not include gitea-vet
(cherry picked from commit 8cbbab7fef)
(cherry picked from commit 51113f0f29)
(cherry picked from commit 0d061e411f)
(cherry picked from commit 1eb4e7e691)
(cherry picked from commit 3c3760f3b6)
(cherry picked from commit c11907373d)
(cherry picked from commit d990fcf446)
(cherry picked from commit 62fd8a0b39)
(cherry picked from commit 0663a25341)
(cherry picked from commit c20d4386e5)
(cherry picked from commit 5981040a19)
(cherry picked from commit b62809313f)
(cherry picked from commit 205512ef96)
(cherry picked from commit 8b923cf770)
(cherry picked from commit bdc50fff48)
(cherry picked from commit 35da9d2316)
(cherry picked from commit f185ba6d03)
(cherry picked from commit dfe5502f56)
(cherry picked from commit 193fd9bec7)
(cherry picked from commit 1e3af954ee)
(cherry picked from commit 0430ad7312)
(cherry picked from commit 5d05f7f9f6)
(cherry picked from commit 82afc7c30b)
2024-02-05 13:33:59 +01:00
Earl Warren cb786f0d40
[CI] Forgejo Actions based release process
Refs: https://codeberg.org/forgejo/website/pulls/230
(cherry picked from commit 87d56bf6c7)

[CI] Forgejo Actions based release process (squash)

base64 -w0 to avoid wrapping when the doer name is long as it creates
a broken config.json

(cherry picked from commit 9efdc27e49)

[CI] Forgejo Actions based release process (squash) generate .xz files and sources

Generate .xz files
Check .sha256
Generate the source tarbal

(cherry picked from commit 7afec520c4)

[CI] Forgejo Actions based release process (squash) release notes

(cherry picked from commit d8f4f4807b)

[CI] Forgejo Actions based release process (squash) publish and sign release

(cherry picked from commit a52778c747)
(cherry picked from commit cf2ec62740)

[CI] Forgejo Actions based release process (squash) version

use Actions environment variables in Makefile (#25319) (#25318)

uses Actions variable to determine the version. But Forgejo builds
happen in a container where they are not available. Do not use them.

Also verify the version of the binary is as expected for sanity check.

(cherry picked from commit 6decf111a1)
(cherry picked from commit 206d0b3886)

[CI] read STORED_VERSION_FILE if available

(cherry picked from commit af74085ebf)

[CI] backward compatible executable compilation

Add a new static-executable target to use in Dockerfiles and restore
the $(EXECUTABLE) target to what it was before to for backward
compatibility.

The release process now builds static executables instead of
dynamically linked ones which makes them more portable. It changes the
requirements at compile time and is not backward compatible. In
particular it may break packaging that rely on the target that
currently creates a dynamically linked executable.

(cherry picked from commit 84d02a174a)
(cherry picked from commit 854be47328)

[CI] Forgejo Actions based release process (squash) doc / ca / verbosity

- Document workflow
- Increase verbosity if VERBOSE=true
- Download the Certificate Authority if behind the VPN

(cherry picked from commit 168d5d5869)
(cherry picked from commit 8756c9a72a)
(cherry picked from commit 2dad7ef20f)

[CI] Forgejo Actions based release process (squash) add assets sources-tarbal

Refs: https://codeberg.org/forgejo/forgejo/issues/1115
(cherry picked from commit 5531d01f19)

[CI] Forgejo Actions based release process (squash) add assets sources-tarbal

bindata.go is a file, not a directory

Refs: https://codeberg.org/forgejo/forgejo/issues/1115
(cherry picked from commit bd88a44778)
(cherry picked from commit b408085138)

[CI] Forgejo Actions based release process (squash) public/assets moved

(cherry picked from commit d8c921d5a6)
(cherry picked from commit f29e50b1a09b1a22fc2dbdb77e9a1def1196175b)

[CI] Fix release notes link

- Use substitution to replace all dots with dashes.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1163

(cherry picked from commit 96783728f53a072915cace392aa269adfe9a5c73)
(cherry picked from commit c8d8bf8996)

[CI] pin go v1.20 for testing

Refs: https://codeberg.org/forgejo/forgejo/issues/1228
(cherry picked from commit fd4b5a013e)
(cherry picked from commit 00bb15f57f)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	see https://codeberg.org/forgejo/forgejo/pulls/1303
(cherry picked from commit 6e2be54a6d)
(cherry picked from commit 346c418b4a)
(cherry picked from commit 49061f8422)
(cherry picked from commit 8229d59b7e)
(cherry picked from commit 70d45d9193)

[CI] Forgejo Actions based release process (squash) need node 18

(cherry picked from commit 722b1f4590)
(cherry picked from commit a91d786169)

[CI] Forgejo Actions based release process (squash) fix indentation

(cherry picked from commit fbdf9d6abb)
(cherry picked from commit 2deff90a13)
(cherry picked from commit 5710a27fda)

[CI] Forgejo Actions based release process (squash) FQIN for docker

Refs: https://codeberg.org/forgejo/forgejo/issues/1600
(cherry picked from commit f63d38deb6)

[CI] Forgejo Actions based release process (squash) use forgejo-curl.sh

(cherry picked from commit c0c3ef506f)
(cherry picked from commit 933ca7ec5d)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	https://codeberg.org/forgejo/forgejo/pulls/1691
(cherry picked from commit 1068e48805)

[CI] Forgejo Actions based release process (squash) size optimization

(cherry picked from commit 3c653ff742)
(cherry picked from commit 398567fc0c)
(cherry picked from commit e585db9a97)
(cherry picked from commit 17e91c96e3)

[CI] Forgejo Actions based release process (squash) gitea to forgejo

(cherry picked from commit 9c06a318b8)
(cherry picked from commit 95859da3b4)
(cherry picked from commit e3a5f6c1ed)
(cherry picked from commit 7b9b259c75)
(cherry picked from commit c4a152c8dc)
(cherry picked from commit b00bf599ef)
(cherry picked from commit a7836ee2ee)
(cherry picked from commit 3ea7dcbd5b)
(cherry picked from commit 454d705e83)
(cherry picked from commit 35e06c3009)
(cherry picked from commit 904468a38f)
(cherry picked from commit 890e86815a)
(cherry picked from commit bf9f94c63d)
(cherry picked from commit d025d061d1)
(cherry picked from commit 32f209a8e1)
(cherry picked from commit 38ef6802fc)
(cherry picked from commit 8a19bbd2a8)
(cherry picked from commit f352dee786)
(cherry picked from commit b53d9fc090)
(cherry picked from commit 3dae21f4c8)
(cherry picked from commit 8b59e016c7)
(cherry picked from commit 6f54ea6a0e)
(cherry picked from commit ed8d90de6b)
(cherry picked from commit 26ffd3fcac)
(cherry picked from commit 287b3bbfb5)
(cherry picked from commit ab81378d0c)
(cherry picked from commit f6bbe7e875)
(cherry picked from commit 8968f34edf)
(cherry picked from commit d3d914bba2)
(cherry picked from commit 4e4006a990)
(cherry picked from commit edb333569b)
(cherry picked from commit 6c1a4baa15)
(cherry picked from commit 51bda3bfc7)
(cherry picked from commit 6f5f318b8f)
(cherry picked from commit e128da2362)
(cherry picked from commit 3e6735ff23)
(cherry picked from commit 938c444125)
(cherry picked from commit 67f92dc9ab)
(cherry picked from commit ee31df71fb)
(cherry picked from commit 386f232191)
(cherry picked from commit 745785cd7f)
(cherry picked from commit efa8564e76)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	https://codeberg.org/forgejo/forgejo/pulls/2029
(cherry picked from commit f3dfb14321)
(cherry picked from commit 5a0346ee95)
(cherry picked from commit 7a2a6517f2)
(cherry picked from commit 87dcc87da9)
(cherry picked from commit df4099247f)
(cherry picked from commit df23f83545)
2024-02-05 13:33:59 +01:00
Loïc Dachary 00c22a25e5
[CI] implementation: publish forgejo- binaries instead of gitea-
(cherry picked from commit 6d910daafb)
(cherry picked from commit d447861cc9)
(cherry picked from commit dc6e9d8799)
(cherry picked from commit ef232fa20c)
(cherry picked from commit 290c55517a)
(cherry picked from commit db48af1784)
(cherry picked from commit 85f33237a2)
(cherry picked from commit 76899ee33e)
(cherry picked from commit 148b3ee9cb)
(cherry picked from commit 1f6ad8f465)
(cherry picked from commit c330afdba3)
(cherry picked from commit b1f87075a7)
(cherry picked from commit 7da40992cc)
(cherry picked from commit 7ab19ff5e5)
(cherry picked from commit e61e44921b)
(cherry picked from commit 83646119fb)
(cherry picked from commit 20cf748e61)
(cherry picked from commit 0a99919cec)
(cherry picked from commit 21215222a6)
(cherry picked from commit 0f6c5658d7)
(cherry picked from commit 1752e43d3c)
(cherry picked from commit 2332080929)
(cherry picked from commit 590aabf2a2)
(cherry picked from commit 87d8b7b315c3e25bd3fcf9dc9c1d359bcd107281)
(cherry picked from commit ff37de38be)
(cherry picked from commit cee32c9e7a)
(cherry picked from commit 39faade524)
(cherry picked from commit 0e5ca477b6)
(cherry picked from commit 70e2730f7b)
(cherry picked from commit 2ad4003944)
(cherry picked from commit 2429de9e87)
(cherry picked from commit c133915fc1)
(cherry picked from commit c607dcaf9f)
(cherry picked from commit 00f006637f)
(cherry picked from commit 0de6646475)
(cherry picked from commit b05e83bb1e)
(cherry picked from commit cb71f139f0)
(cherry picked from commit 2a8b08ee4f)
(cherry picked from commit 3ebab73c4e)
(cherry picked from commit 07626c088c)
(cherry picked from commit 844e9bc999)
(cherry picked from commit c315e24751)
(cherry picked from commit f5f2b41f3c)
(cherry picked from commit 09134424a8)
(cherry picked from commit 6fc63d48c4)
(cherry picked from commit a0be5c783e)
(cherry picked from commit 124bad8230)
(cherry picked from commit 57069811d1)
(cherry picked from commit 8871d1aac7)
2024-02-05 13:33:58 +01:00
silverwind a6cea59514
Update tool dependencies (#29030) 2024-02-02 19:11:39 -05:00
silverwind 0999721c7b
Add --no-root to update-py (#27937)
Missed this command in https://github.com/go-gitea/gitea/pull/27919.
2023-11-06 15:44:04 +00:00
silverwind 1ccdb546f0
Install poetry dependencies with --no-root (#27919)
Poetry 1.7.0 or higher will print a warning otherwise, see discussions:

https://github.com/python-poetry/poetry/pull/8369
https://github.com/python-poetry/poetry/issues/1132

> --no-root Do not install the root package (the current project).
2023-11-06 00:11:34 +00:00
silverwind ce83609ff6
Upgrade to golangci-lint@v1.55.0 (#27756)
https://github.com/golangci/golangci-lint/releases/tag/v1.55.0
2023-10-24 02:54:59 +00:00
techknowlogick 60fce1568e
Remove network call on make clean (#27689)
fix #27653

credit to silverwind for finding issue
2023-10-19 08:02:22 +00:00
Sergey Zolotarev 6acce16ee3
Remove .exe suffix when cross-compiling on Windows (#27448)
When compiling GItea for Linux on Windows, you get a `gitea.exe` file as
output, but because it's a Linux executable, the `.exe` extension is
unnecessary.

This PR adds a check for `GOOS` environment variable in addition to
`OS`.
2023-10-06 16:39:21 -04:00
silverwind e94f9fcafd
Require MySQL 8.0, PostgreSQL 12, MSSQL 2012 (#27337)
- MySQL 5.7 support and testing is dropped
- MySQL tests now execute against 8.1, up from 5.7 and 8.0
- PostgreSQL 10 and 11 support ist dropped
- PostgreSQL tests now execute against 16, up from 15
- MSSQL 2008 support is dropped
- MSSQL tests now run against locked 2022 version

Fixes: https://github.com/go-gitea/gitea/issues/25657

Ref: https://endoflife.date/mysql
Ref: https://endoflife.date/postgresql
Ref: https://endoflife.date/mssqlserver

## ⚠️ BREAKING ⚠️

Support for MySQL 5.7, PostgreSQL 10 and 11, and MSSQL 2008 is dropped.
You are encouraged to upgrade to supported versions.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-10-03 13:27:57 -04:00
silverwind a101dbaa79
Update JS and Poetry dependencies and eslint (#27200)
- Update all JS and Poetry dependencies
- Remove deprecated `eslint-plugin-custom-elements` and replace it with
rules from `eslint-plugin-wc`
- Add a convenience `make update` to update both js and py dependencies
- Tested markdown toolbar, swagger and citation
2023-09-22 22:51:48 +02:00
silverwind 3c0c279658
Add yamllint (#26965)
So that https://github.com/go-gitea/gitea/pull/26964 does not happen
again. Merge this after that PR. Config is based on
[node's](https://github.com/nodejs/node/blob/main/.yamllint.yaml).

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-07 22:24:06 -04:00
silverwind 3db3f5daae
Update tool dependencies (#26607)
- Updated all tool dependencies to latest versions
- Add Makefile to `swagger` files because it specifies `go-swagger`
version
- Fix lint
2023-08-20 22:59:19 +00:00
techknowlogick 653e77fd22
bump go to 1.21 (#26608)
Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-21 00:27:46 +02:00