Commit graph

83 commits

Author SHA1 Message Date
Loïc Dachary e138685bac
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)
2023-08-07 10:28:47 +02:00
Earl Warren 79bfbadbed
[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)
2023-08-07 09:54:10 +02: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
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
silverwind 6c8b680f91
GitHub Actions cleanups (#24620)
- Remove actions name where command is descriptive enough
- Use kebab-case instead of snake-case for step names
- Use shorter job names because to make PR checks more readable
- Remove duplicate `checks-backend`

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
2023-05-11 21:21:28 -04:00
Kyle D a54c8b4ce9
Kd/fix redis unit test (#24650)
Replaces #24641

Currently, unit tests fail when run locally (unless users have minio
instance running). This PR only requires redis unit tests if in CI.

- Only run redis unit tests when `CI` env variable is set
- Add minio as a service in unit tests actions
2023-05-11 10:09:37 +08:00
Lunny Xiao 0deb5053bd
Check latest version on CI (#24556) 2023-05-06 15:43:56 +08:00
techknowlogick c1e9c7b7b9
automate locking closed threads (#24525)
With comments happening on closed issues/prs this locks issues that have
been closed for >45days. This allows for comments on recently closed
issues/prs to still happen.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-05-05 10:17:29 +08:00
silverwind 0ca1958e1a
Upgrade to Node 20 on CI, enable actions cancellation (#24524)
- Upgrade node, the
[snap](7abe958f5b/snap/snapcraft.yaml (L47))
is excluded from this because [there is no Node 20 snap
yet](https://snapcraft.io/node).
- Add actions build cancellation based on
[this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value).

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-05-04 22:21:48 +00:00
techknowlogick f7f0782132
Use Actions for DB & E2E tests (#24494)
following https://github.com/go-gitea/gitea/pull/24314 and
https://github.com/go-gitea/gitea/pull/24434, this PR moves drone cron
pipelines to (GitHub) Actions. As these are mostly compatible with Gitea
Actions, when we start to dogfood, these will already be migrated.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-05-04 02:04:02 +00:00
techknowlogick e8887de090
replace PR docker dry run in drone with Actions (#24475)
As before with past PRs to switch Drone pipelines to use (GitHub)
Actions.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-05-01 16:39:36 -04:00
techknowlogick 2b241ac914
correct env vars 2023-05-01 14:31:11 -04:00
techknowlogick 8d33ce08b1
target correct conditional 2023-05-01 00:31:50 -04:00
techknowlogick a4c13af578
Move docs pipelines to use Actions (#24434)
similar to #24314, this moves drone cron pipelines to (GitHub) Actions.
As these are mostly compatible with Gitea Actions, when we start to
dogfood, these will already be migrated.

I also removed the discord notify pipeline, as it hasn't been working
for several months.
2023-04-30 12:23:26 -04:00
techknowlogick 2ec2d06531
on schedule 2023-04-25 21:38:49 -04:00
techknowlogick abc5f8c235
on schedule 2023-04-25 21:38:33 -04:00
techknowlogick 61a73edbf3
switch to use Actions from drone for cron (#24314)
Move drone cron pipelines to (GitHub) Actions. As these are mostly
compatible with Gitea Actions, when we start to dogfood, these will
already be migrated.
2023-04-25 21:32:49 -04:00
Jason Song 97aacc3ea1
Improve pull_request_template.md (#22888)
Update `pull_request_template.md` because:

- It's a kind idea to hide the tips. However, it's easier to include
them in the commit message by mistake when you cannot see them. Check
`git log | grep 'Please check the following:'`. So don't hide it, expose
it and help fix it.
- "for backports" is much clearer than "for bug fixes". I saw someone
post a PR to a release branch because they believed it was the right way
for a bugfix.
- "Allow edits by maintainers", or we have to ask the contributor to
update the branch and they could be confused.
- Remind the contributor that the words could be included in the commit
message, to avoid some words like "Hello", "Sorry". If they really need
them, they can separate them with a line, like:

```markdown
Close #xxxx
Because ... Then ... Finally ...
---
Hello, this is my first time opening a pull request. Sorry for any mistakes.
```
And the merger should be careful, check and delete the extra content
before merging.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-02-20 19:14:02 -05:00
Eugene 5ab2dcb613
update discord invite (#19907) 2022-06-07 11:40:27 -04:00
John Olheiser 3a245230f4
Disable blank issues (#19717) 2022-05-15 13:45:11 -04:00
delvh bfe2e3d562
Reorder issue templates and automatically add labels (#18875)
* Reorder bug-report.yaml

* Add bug label on bug-report.yaml

* Add feature label on feature-request.yaml

* Reorder ui.bug-report.yaml

* Apply suggestions

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
2022-03-21 20:00:25 +08:00
zeripath 6d11a31aef
Make the proformas clearer that we need DEBUG logs (#18700)
It is ridiculous how few of our bug reporter are giving us DEBUG level logs.
This has to change and I think the proforma is not making it clear enough that
they have to give us these logs.

This PR changes the issue proformas to tell people to give us these logs.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-02-10 17:11:58 +00:00
wxiaoguang eaf09a5368
Fix documents for development and bug report (#18249) 2022-01-13 10:58:46 +08:00
qwerty287 5754080eb9
Fix various typos of software names (#18083)
* `git` -> `Git`
* `Github` and `github` -> `GitHub`
* `crowdin` -> `Crowdin`
* `git-lfs` -> `Git LFS`
* `githooks`, `git hooks`, `git-hooks` -> `Git Hooks`
* `discord` -> `Discord`
* `2fa` -> `2FA`
* `gitlab` and `Gitlab` -> `GitLab`
* `web hook` -> `webhook`
* `linux` -> `Linux`
* `sqlite` -> `SQLite`
* `MYSQL` and `mysql` -> `MySQL`
* rename refs to `master` branch -> `main`
* Fix English grammar
2021-12-24 11:56:57 +08:00
a1012112796 12938dd35f
hide note message for pull request template (#17529)
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2021-11-02 22:43:16 -05:00
silverwind d30410675b
Fix wording in issue template (#17176)
There was a typo `systemm` here. I opted to just remove the superfluos word altogether.
2021-09-29 13:03:44 +02:00