Commit graph

63 commits

Author SHA1 Message Date
Earl Warren 0f5ebe8c3e
[CI] Forgejo Actions based CI for PR & branches
(cherry picked from commit f9d75d4705)
(cherry picked from commit 64f76f4ab2)
(cherry picked from commit 5d02454155)

[CI] Forgejo Actions workflows

(cherry picked from commit 3ff59b5379)
(cherry picked from commit 8af826a6f7)
(cherry picked from commit d7c09d9cc8)

[CI] use the docker label instead of ubuntu-latest

(cherry picked from commit b6a6470db6)

[CI] all tests need compliance before proceeding

(cherry picked from commit b35c496f2c)
(cherry picked from commit 36a4148a8e)
(cherry picked from commit 7ffcffa653)
(cherry picked from commit 8a246d296e)
(cherry picked from commit dd0b6e1826)

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

Refs: https://codeberg.org/forgejo/forgejo/issues/976
(cherry picked from commit b4b8c489e6)
(cherry picked from commit 1e861db4af)
(cherry picked from commit a6c0e00330)
(cherry picked from commit f97b336465)
(cherry picked from commit 6d65d5f0d6f798556a8f9e547896be03a5ee2f87)
(cherry picked from commit 79bfbadbed)
(cherry picked from commit e86c40a34a)
(cherry picked from commit da0c454adb)
(cherry picked from commit b49d892cda)

[CI] enable minio tests

(cherry picked from commit 4d8f438031)
(cherry picked from commit c4eeb0a61e)

[CI] Forgejo Actions based CI for PR & branches (squash) cleanup

(cherry picked from commit 80eb20e842)
(cherry picked from commit d2ff589858)
(cherry picked from commit f6eedecb67)
(cherry picked from commit cf458091e2)
(cherry picked from commit ddd322cb2d)
(cherry picked from commit f0f5729b64)

Conflicts:
	.github/workflows/pull-db-tests.yml
	https://codeberg.org/forgejo/forgejo/pulls/1573
(cherry picked from commit bb347aedd4)
2023-10-16 12:49:08 +02:00
silverwind c37f95fc56
Make disk clean action a bit more robust (#27590) 2023-10-12 00:24:13 -04:00
techknowlogick dc7cf7a984
fully replace drone with actions (#27556)
this builds binaries and docker images for tags
2023-10-11 06:39:32 +00:00
techknowlogick 65eea1d536
switch to using official AWS step in release nightly (#27532)
`jakejarvis/s3-sync-action@master` is out of date, and using official
actions is always recommended
2023-10-09 10:12:19 +00:00
silverwind ab074c9b98
Tweak labeler config (#27502)
Alternative to https://github.com/go-gitea/gitea/pull/27439. Removes a
few spammy labels, and disables `sync-labels` which make it never remove
labels (which is default behaviour).
2023-10-08 13:11:26 +00:00
techknowlogick 72b66032e4
change runner for binary 2023-10-07 00:14:45 -04:00
techknowlogick e820d9966d
move re-useable workflow 2023-10-06 15:22:10 -04:00
techknowlogick bab41dd3a3
add checkout to disk-clean 2023-10-06 15:16:56 -04:00
techknowlogick 1683f1587c
use hosted runners for nightly actions (#27485)
I'm temporarily unable to properly evaluate actuated runners, and so I'm
switching back to hosted runners until I am able to focus on that again.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-10-06 15:13:47 -04:00
Lunny Xiao 74763f50ae
Use minimal required version on CI and remove unnecessary services (#27429) 2023-10-04 11:42:02 +00: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
Earl Warren 2ec0bf3878
verify MinIO works with bitnami/minio:2023.8.31 (#27022) 2023-10-03 14:21:14 +00:00
puni9869 5e039b0580
Upgrading the actions/checkout@4 (#27096)
as title
..Upgrading the actions/checkout@4

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-09-16 15:06:27 +00:00
silverwind 5fc2a3f63a
Add missing deps to files-changed (#27100)
The `docs` and `yaml` actions categories need to run when the
dependencies `markdownlin-cli` or `yamllint` change, so add those to the
list of dependencies for these actions.

Fixes: https://github.com/go-gitea/gitea/issues/27098
2023-09-16 13:23:06 +00:00
techknowlogick 5d755ac6ae
bump all nightly builds to 16gb 2023-09-13 10:43:03 -04:00
techknowlogick 3bebcb2e9c
bump rootful to 16gb 2023-09-12 15:26:41 -04:00
techknowlogick 2abbc43dff
setup go in the nightly release pipeline 2023-09-12 13:36:15 -04:00
techknowlogick c892ab0600
Speed up nightly builds (#27045)
* Rootless/ful docker images build separately
* Vendor go modules outside docker to speed up the build

Thanks to Alex Ellis for these suggestions (and actuated runner build
time)
2023-09-12 13:33:45 -04:00
techknowlogick e6b68c579b
Use Actuated.dev runner for nightly builds 2023-09-12 12:15:05 -04: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 cfa3527118
Add actions/labeler (#26962)
Implements https://github.com/GiteaBot/gitea-backporter/issues/93 using
[`actions/labeler`](https://github.com/actions/labeler). Very basic
configuration, can be extended later.
2023-09-07 21:30:03 +00:00
silverwind 274c16e481
Fix filename for .spectral.yaml (#26828)
Mixed up yml vs. yaml previously.
2023-08-30 20:41:37 -04:00
silverwind 7bc80cb350
Add various missing files-changed dependencies (#26799)
We were missing a number of config files like `.golangci.yml` in the
dependencies for the pull request pipelines, which resulted in the
linting not running for https://github.com/go-gitea/gitea/pull/26786
because only `.golangci.yml` had changed.
2023-08-30 01:40:13 +00: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
silverwind 1772814605
Lock go to 1.21 on CI (#26433)
To prevent unwanted surprises with new minor versions of go, lock the
version to minor version using [semver tilde
syntax](https://github.com/npm/node-semver#tilde-ranges-123-12-1). We
were already getting 1.21.0 since yesterday, so use that version now as
minimum.
2023-08-10 21:53:44 +00:00
Jason Song 1e76a824bc
Refactor and enhance issue indexer to support both searching, filtering and paging (#26012)
Fix #24662.

Replace #24822 and #25708 (although it has been merged)


## Background

In the past, Gitea supported issue searching with a keyword and
conditions in a less efficient way. It worked by searching for issues
with the keyword and obtaining limited IDs (as it is heavy to get all)
on the indexer (bleve/elasticsearch/meilisearch), and then querying with
conditions on the database to find a subset of the found IDs. This is
why the results could be incomplete.

To solve this issue, we need to store all fields that could be used as
conditions in the indexer and support both keyword and additional
conditions when searching with the indexer.

## Major changes

- Redefine `IndexerData` to include all fields that could be used as
filter conditions.
- Refactor `Search(ctx context.Context, kw string, repoIDs []int64,
limit, start int, state string)` to `Search(ctx context.Context, options
*SearchOptions)`, so it supports more conditions now.
- Change the data type stored in `issueIndexerQueue`. Use
`IndexerMetadata` instead of `IndexerData` in case the data has been
updated while it is in the queue. This also reduces the storage size of
the queue.
- Enhance searching with Bleve/Elasticsearch/Meilisearch, make them
fully support `SearchOptions`. Also, update the data versions.
- Keep most logic of database indexer, but remove
`issues.SearchIssueIDsByKeyword` in `models` to avoid confusion where is
the entry point to search issues.
- Start a Meilisearch instance to test it in unit tests.
- Add unit tests with almost full coverage to test
Bleve/Elasticsearch/Meilisearch indexer.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-31 06:28:53 +00:00
John Olheiser bd4c7ce578
Docusaurus-ify (#26051)
This PR cleans up the docs in a way to make them simpler to ingest by
our [docs repo](https://gitea.com/gitea/gitea-docusaurus).

1. It includes all of the sed invocations our ingestion did, removing
the need to do it at build time.
2. It replaces the shortcode variable replacement method with
`@variable@` style, simply for easier sed invocations when required.
3. It removes unused files and moves the docs up a level as cleanup.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-07-26 04:53:13 +00:00
isla w e882398c5a
Update emoji set to Unicode 15 (#25595)
Update emoji set to Unicode 15 which was added upstream here:
cb5c514d47

<img width="854" alt="Screenshot 2023-06-29 at 11 02 56 AM"
src="https://github.com/go-gitea/gitea/assets/1669571/7bfb663d-0804-4d23-a62d-f585a6783ca6">

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-06-29 16:29:48 +00:00
silverwind fdf71460f9
Fix lint-swagger action (#25593)
- Add detection for swagger changes and run `lint-swagger` on it
- Remove `lint-swagger` from `lint-frontend`
- Remove `lint-md` from `lint-frontend`
2023-06-29 10:37:41 -04:00
silverwind e441a5d751
Add Makefile to files-changed (#25463)
When only `Makefile` changes, nothing currently runs. Add it to a few
categories.

Co-authored-by: Giteabot <teabot@gitea.io>
2023-06-23 13:56:18 +00:00
silverwind 478f33030e
Remove deps-tools from backend job (#25454) 2023-06-22 23:24:55 +00:00
silverwind 6281ebfec3
add test-frontend back to actions (#25452)
Apparently we were not running `test-frontend` on actions, this adds it
back.
2023-06-22 23:37:50 +02:00
techknowlogick feda506321
Use Actions git context instead of dynamically created buildkit one (#25381)
The [docker/build-push-action@v2
action](https://github.com/docker/build-push-action) by default ignores
the checkout created using the actions/checkout@v2 action. When you pass
a git build context to docker build, it wouldn't include the .git
directory.

By passing `context: .` to the build step then it'll use the Actions git
context which includes the git fetch from the earlier step.
2023-06-20 01:37:32 -04:00
techknowlogick 1a5b7c86a3
Fetch all git data for embedding correct version in docker image (#25361)
Fix #25350
2023-06-19 18:51:35 +00:00
silverwind 51c2aebe1f
Only run docker-dryrun when necessary (#25329)
`docker-dryrun` runs on almost any PR, which is a huge waste of CI
resources. Run it only when the Dockerfiles change and also add a step
that verifies the rootless file.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-06-18 22:53:20 -04:00
silverwind 1a0a205466
Clean up pyproject.toml and package.json, fix poetry options (#25327)
- Reduce `pyproject.toml` and `package.json` to the minimal required
format, removing unneeded properties. `build-system` is not needed as
per
[this](https://github.com/python-poetry/poetry/issues/8110#issuecomment-1595846841).
- Fix `poetry.toml` options they were wrong previously.
- Add dependencies of poetry files to templates `files-changed`.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-06-18 18:13:08 +00:00
techknowlogick fc2115b494
build nightly docker images (#25317)
followup of https://github.com/go-gitea/gitea/pull/25308 this time to
build & push nightly docker images
2023-06-18 01:04:23 -04:00
techknowlogick 0ab9b7f426
Build nightly binaries with Actions (#25308)
Co-authored-by: silverwind <me@silverwind.io>
2023-06-16 17:00:39 +00:00
silverwind e24f651c86
Add template linting via djlint (#25212)
So I found this [linter](https://github.com/Riverside-Healthcare/djlint)
which features a mode for go templates, so I gave it a try and it did
find a number of valid issue, like unbalanced tags etc. It also has a
number of bugs, I had to disable/workaround many issues.

Given that this linter is written in python, this does add a dependency
on `python` >= 3.8 and `poetry` to the development environment to be
able to run this linter locally.

- `e.g.` prefixes on placeholders are removed because the linter had a
false-positive on `placeholder="e.g. cn=Search"` for the `attr=value`
syntax and it's not ideal anyways to write `e.g.` into a placeholder
because a placeholder is meant to hold a sample value.
- In `templates/repo/settings/options.tmpl` I simplified the logic to
not conditionally create opening tags without closing tags because this
stuff confuses the linter (and possibly the reader as well).
2023-06-14 18:17:58 +00:00
silverwind 4c290e9209
GitHub Actions enhancements for frontend (#25150)
- Don't run DB tests for frontend-only changes
- Build frontend as part of frontend step
- Build everything when actions change
2023-06-14 23:30:37 +08:00
silverwind 3c6aa8d3e1
Fix setup-go actions (#25167)
The `setup-go` actions did not all have `check-latest` which means they
use some cached version of go that currently still resolves to go1.20.4,
as seen in a number of recent runs that currently fail at govulncheck
because of it:

````
Run actions/setup-go@v4
Setup go version spec >=1.20
Attempting to resolve the latest version from the manifest...
matching >=1.20...
Resolved as '1.20.4'
````

Add the
[check-latest](https://github.com/actions/setup-go#check-latest-version)
option which should guarantee that this cache is skipped.
2023-06-09 09:33:48 +02:00
silverwind d783384c19
Clean up github actions (#24984)
- Merge the file filters into `files-changed.yml`
- Remove unused yaml anchors like `&backend`
- Merge the `compliance-docs` workflow into `compliance`
- Add actions linting
- Misc cleanups for whitespace and step names
2023-05-30 13:31:00 +08:00
Lunny Xiao 694f70b57e
Fix documentation ref (#24934)
Fix documentation ref
2023-05-26 00:19:13 +08:00
Lunny Xiao 93c6a9a652
Use file filters action instead of Github's files filter (#24877)
Inspired by
https://github.com/go-gitea/gitea/pull/24530#issuecomment-1558815301

This PR use a file filter action to do different CI jobs according
changed files types. All types are defined in
`.github/file-filters.yml`. Now there are 4 types, `docs`, `backend`,
`frontend` and `build`. Then if a PR only changed docs files, those CI
jobs which passed the conditions will run, and other types are also like
this.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-05-25 01:33:31 +00:00
techknowlogick 21add7ea88
Remove publish docs CI workflow (#24889)
Now that the redirect to docs.gitea.com is in place this is no longer
needed.
2023-05-23 20:41:27 +00:00
a1012112796 25d4f95df2
replace drone exec to act_runner exec in test README.md (#24791) 2023-05-18 19:48:47 +00:00
Lunny Xiao 473dee7c7a
Ignore build for docs only (#24761)
Fix https://github.com/go-gitea/gitea/pull/24530#issuecomment-1550227919
2023-05-17 13:42:08 +08:00
Lunny Xiao c78b923822
Don't run build and test if only docs changed (#24530)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-05-16 02:53:18 +00:00
Lunny Xiao 22da9da0e8
Update cron-translations.yml (#24708)
Fix cron translations push failure
2023-05-14 08:57:23 +00:00
FuXiaoHei 61ad4c607b
fix minio storage iterator path (#24691)
minio storage iterator shows different behavior with local fs iterator.

in local fs storage:

``` go
s.IterateObjects("prefix", func(path,obj)
     println(path) // show "prefix/xxx.file"
})
```

in minio storage:

```go
s.IterateObjects("prefix", func(path,obj)
     println(path) // show "xxx.file"
})
```

I think local fs is correct, minio use wrong `basePath` to trim storage
path prefix.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-05-13 22:33:25 +00:00