Commit graph

108 commits

Author SHA1 Message Date
Giteabot 95a18f778a
Fix Docker meta action for releases (#28232) (#28395)
(cherry picked from commit 3107093394)
2023-12-08 13:41:16 +01:00
Giteabot 93c3924a56
Check for v prefix on tags for release clean name (#28257) (#28270)
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
(cherry picked from commit 5001f63c07)
2023-12-08 13:40:59 +01:00
Giteabot 29556fafb5
Fix actions when tagging (#28061) (#28218)
Backport #28061 by @lunny

close https://github.com/go-gitea/gitea/issues/28053

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 7f81110461)
2023-11-26 13:56:50 +01:00
Loïc Dachary 6deb8f859e
delete Gitea specific files that need rewriting for Forgejo
Although it would be possible to modify these files, it would create
conflicts when rebasing. Instead, this commit removes them entirely
and another commit can start from scratch, borrowing content from the
original files.

The drawback of this approach is that some content updates from Gitea
that also need updating in Forgejo will have to be copy/pasted
instead of being merged.

(cherry picked from commit eb85782115)
(cherry picked from commit 34401f2004)
(cherry picked from commit ef43b1c691)
(cherry picked from commit d17fe25e2f)
(cherry picked from commit 3f65dea3e7)
(cherry picked from commit 3cacb64a1b)
(cherry picked from commit b531b014b7)
(cherry picked from commit adf6e7a840)
(cherry picked from commit 68c19d977d)
(cherry picked from commit 31aa8647ec)
(cherry picked from commit be70dd7208)
(cherry picked from commit 7f44bb60b1)
(cherry picked from commit 5098f1224b)
(cherry picked from commit dc7a859144)
(cherry picked from commit f1e78dd006)
(cherry picked from commit c41ba7a148)
(cherry picked from commit f1da66a918)
(cherry picked from commit 99194a3664)
(cherry picked from commit 52f356f6a9)
(cherry picked from commit c93ffa72ae)
(cherry picked from commit 477c7454d3)
(cherry picked from commit 413df23a40)

[DOCS] delete Gitea specific files that need rewriting for Forgejo (squash)

(cherry picked from commit df78cedd05)
(cherry picked from commit 3b9178b3e5)
(cherry picked from commit 9044dcb0e7)
(cherry picked from commit e138685bac)
(cherry picked from commit 2f1f3fd6b8)
(cherry picked from commit 0b47d02df6)
(cherry picked from commit 7625ca6c42)
(cherry picked from commit e0d720a728)
(cherry picked from commit 19aa974d12)
(cherry picked from commit bb637d398c)
(cherry picked from commit 5357fc952d)
(cherry picked from commit bee0395044)
(cherry picked from commit 5e574bfc8f)
(cherry picked from commit 0b8cb3e3dd)
(cherry picked from commit 8a67a09955)
(cherry picked from commit b0ddef126e)
(cherry picked from commit 4434e44d4a)
(cherry picked from commit 37d0c1bed1)
2023-11-13 12:33:47 +01:00
Earl Warren a0a4721f57
[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)
(cherry picked from commit 26641662b6)
(cherry picked from commit 4e596bc002)
(cherry picked from commit 6ce4ff732e)
(cherry picked from commit 4db9d5e4f9)
(cherry picked from commit 8cd3ce255b)
(cherry picked from commit 3b380c35eb)
2023-11-13 11:52:15 +01:00
Denys Konovalov 9f2b8c7ead
fix labeler config on release/v1.21 (#27738)
Manual backport of #27525
2023-10-22 13:53:34 +00:00
Giteabot 4986dc8351
fully replace drone with actions (#27556) (#27575)
Backport #27556 by @techknowlogick

this builds binaries and docker images for tags

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-10-11 12:03:06 +00:00
Giteabot 9a64a24f29
use hosted runners for nightly actions (#27485) (#27488)
Backport #27485 by @techknowlogick

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: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-10-09 14:10:42 -04:00
Giteabot d8513fc312
switch to using official AWS step in release nightly (#27532) (#27547)
Backport #27532 by @techknowlogick

`jakejarvis/s3-sync-action@master` is out of date, and using official
actions is always recommended

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-10-09 13:53:45 -04: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
JakobDev e481638010
Add more package registry paths to the labeler (#27032)
Found this while working on #26960
2023-09-12 02:29:09 -04:00
silverwind 3442ea62cd
Add some more labels to labeler (#26987)
- Add more automatic labels
- Consistently use `**` glob for recursive directory globs.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-10 19:54:20 +00: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 f9abb6ade2
Fix yaml quoting (#26964)
Yaml [does not
like](https://github.com/go-gitea/gitea/actions/runs/6115139962/job/16598147278?pr=26568)
keys that start with `*` so let's quote all globs.
2023-09-07 20:50:10 -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
wxiaoguang 83208b4991
Improve the "bug report" template and "support options" document (#26753)
* `/help/support` is a better document than
`/administration/logging-config` for bug reporting
* Improve `support.en-us.md`
    * Move/add detailed contents into `Advanced Bug Report Tips` section
    * Merge `Chinese Support` section into `Support Options`
2023-08-28 22:37:39 +00:00
Lunny Xiao 476b9d1589
Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +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
Lunny Xiao c930512f49
Remove feature label from feature request issue template (#25696)
We need a feature request process, so when a user submit a feature
proposal, it should not be marked as feature before it has been accept.
2023-07-05 16:58:56 +08: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