Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-29 21:26:10 +01:00
Commit graph

213 commits

Author SHA1 Message Date
erik af0d0f7745 Merge branch 'forgejo' into forgejo-federated-star 2024-04-09 15:38:11 +02:00
erik 97343470bc Merge branch 'forgejo' into forgejo-federated-star 2024-04-09 10:42:42 +02:00
Earl Warren 7179ae8cc1 Merge pull request '[GITEA PORT] Do some performance optimize for issues list and view issue/pull (gitea#29515)' (#3116) from oliverpool/forgejo:port_29515 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3116
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 19:04:40 +00:00
Lunny Xiao c9854bee98 Do some performance optimize for issues list and view issue/pull (gitea#29515)
This PR do some performance optimzations.

- [x] Add `index` for the column `comment_id` of `Attachment` table to
accelerate query from the database.
- [x] Remove unnecessary database queries when viewing issues. Before
some conditions which id = 0 will be sent to the database
- [x] Remove duplicated load posters
- [x] Batch loading attachements, isread of comments on viewing issue

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Conflicts:
models/issues/comment_code.go: function was renamed in Forgejo
models/migrations/migrations.go: migration already ported
2024-04-08 14:47:31 +02:00
JakobDev a610e93cc9 Add fix and migration 2024-04-08 12:54:43 +02:00
JakobDev 613e5387c5 Count downloads for tag archives 2024-04-08 12:51:27 +02:00
Clemens 8d78c3edca make fmt 2024-04-04 15:12:41 +02:00
Clemens 92d011f1a5 fix some linting issues 2024-04-04 15:08:02 +02:00
Clemens 73cf1e3901 Revert "added repoUri to federationService"
This reverts commit 8cd89bf4d3.
2024-04-04 07:22:04 +02:00
Clemens 8cd89bf4d3 added repoUri to federationService
This does not work yet. APAPI url OR host and id have to be derived from repoUri.
2024-04-03 15:39:37 +02:00
Clemens 2b7a22afb3 renamed FederatedRepo to FollowingRepo 2024-04-03 12:26:33 +02:00
erik daccaed157 Rename federatedRepo to followingRepo 2024-04-03 12:08:44 +02:00
0ko 2f38c2220f [I18N] Allow custom repo size format
Following https://codeberg.org/forgejo/forgejo/pulls/2528#issuecomment-1721846

- simplify the code
- allow to have custom format in translations
- provide proper Russian translation because test depends on it
2024-04-02 18:43:12 +05:00
0ko 29cc80d849 Provide a way to translate data units 2024-03-30 21:10:47 +05:00
Clemens 7f19247b0a Moved sendLikeActivities to federation_service 2024-03-28 14:27:50 +01:00
Clemens 1ad7bdf983 fixed tests
part1, one test still failing
2024-03-28 09:36:08 +01:00
Michael Jerger d624ebb712 use doer coming from api 2024-03-28 08:13:00 +01:00
Michael Jerger 992fbf6898 comments 2024-03-28 07:44:22 +01:00
Michael Jerger 259c0202c7 fix test & add some review 2024-03-27 19:56:32 +01:00
erik 01e9853161 Add ToDo for storing federated repos
We need to check whether federated repos already exist in db. This way multiple repos on a server (forks) can have the same federated repos.
2024-03-26 16:54:55 +01:00
erik 436466dcad Check if federation enabled in StarRepo 2024-03-26 16:21:28 +01:00
erik 32d457f9a3 StarRepo Wrapper 2024-03-26 15:28:36 +01:00
Clemens bbe5096307 fixed circular dependencies
next: fix post call error
2024-03-26 14:02:30 +01:00
Clemens 7f0371056e moved functionality
import of forgefed causes circular dependencies. This has to be solved!
2024-03-26 10:23:14 +01:00
Clemens d251fc2611 set federatedRepoList into context 2024-03-26 08:28:22 +01:00
Michael Jerger cf8a30efac mob-next: how to store port & schema 2024-03-26 07:58:04 +01:00
Michael Jerger 5b8173f660 do not return invalid result 2024-03-26 07:36:09 +01:00
erik 6d814447d0 Use Plural 2024-03-25 16:52:39 +01:00
erik 653ced5596 Validate before returning 2024-03-25 16:47:18 +01:00
erik 35d3fc199c Rename to StoreFederatedRepo* 2024-03-25 16:35:35 +01:00
erik ca7d1c6f78 Localize error messages 2024-03-25 16:30:02 +01:00
Lunny Xiao 3b3747ffe8
Fix schedule tasks bugs (#28691)
Fix #28157

This PR fix the possible bugs about actions schedule.

- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.

(cherry picked from commit 97292da960)

Conflicts:
	modules/actions/github.go
	routers/web/repo/setting/default_branch.go
	routers/web/repo/setting/setting.go
	services/repository/branch.go
	services/repository/setting.go
	tests/integration/actions_trigger_test.go
2024-03-25 16:25:02 +01:00
Michael Jerger 828e7a76f6 use new table to populate settings 2024-03-25 09:15:32 +01:00
Michael Jerger a9d18e5327 fixed issues, store now works 2024-03-23 17:01:25 +01:00
Michael Jerger 950dcd959e implement storage of federated_repo 2024-03-22 20:14:20 +01:00
erik 6b767684a7 Add discussion ToDo 2024-03-22 17:51:20 +01:00
erik 36c0c1c3c1 Add DB functionality for federated repos 2024-03-22 17:41:59 +01:00
Michael Jerger 508b4deac8 add test & fix compile 2024-03-22 08:37:06 +01:00
Michael Jerger 9ccad50b05 review 2024-03-22 07:52:03 +01:00
erik 0c6c43003c Implement getting APAPIURL for repo and user 2024-03-21 16:27:35 +01:00
Michael Jerger b4bb41e0e3 introduce federated repo 2024-03-21 08:25:40 +01:00
Lunny Xiao d996c5d517
Some performance optimization on dashboard and issues page (#29010)
This PR do some loading speed optimization for feeds user interface
pages.
- Load action users batchly but not one by one.
- Load action repositories batchly but not one by one.
- Load action's Repo Owners batchly but not one by one.
- Load action's possible issues batchly but not one by one.
- Load action's possible comments batchly but not one by one.

(cherry picked from commit aed3b53abdd02a3ffbf9e8eb90272ff567333073)
2024-03-20 08:46:28 +01:00
erik 884e38bdab WIP Implement proper saving of federated repo urls
Added ToDos where relevant
2024-03-19 15:29:37 +01:00
Michael Jerger 9dcdf8d828 Locales, field & action 2024-03-16 12:46:43 +01:00
6543 e2371743d5
remove util.OptionalBool and related functions (#29513)
and migrate affected code

_last refactoring bits to replace **util.OptionalBool** with
**optional.Option[bool]**_

(cherry picked from commit a3f05d0d98408bb47333b19f505b21afcefa9e7c)

Conflicts:
	services/repository/branch.go
	trivial context conflict
2024-03-06 12:10:46 +08:00
wxiaoguang 68099f2f00
Refactor some Str2html code (#29397)
This PR touches the most interesting part of the "template refactoring".

1. Unclear variable type. Especially for "web/feed/convert.go":
sometimes it uses text, sometimes it uses HTML.
2. Assign text content to "RenderedContent" field, for example: `
project.RenderedContent = project.Description` in web/org/projects.go
3. Assign rendered content to text field, for example: `r.Note =
rendered content` in web/repo/release.go
4. (possible) Incorrectly calling `{{Str2html
.PackageDescriptor.Metadata.ReleaseNotes}}` in
package/content/nuget.tmpl, I guess the name Str2html misleads
developers to use it to "render string to html", but it only sanitizes.
if ReleaseNotes really contains HTML, then this is not a problem.

(cherry picked from commit e71eb8930a5d0f60874b038c223498b41ad65592)

Conflicts:
	modules/templates/util_string.go
	trivial context conflict
2024-03-06 12:10:44 +08:00
6543 d3d70198b0
migrate some more "OptionalBool" to "Option[bool]" (#29479)
just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit f6656181e4a07d6c415927220efa2077d509f7c6)

Conflicts:
	models/repo/repo_list_test.go
	trivial shared fixture count conflicts
2024-03-06 12:10:44 +08:00
6543 7b23949f29
Let ctx.FormOptionalBool() return optional.Option[bool] (#29461)
just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

(cherry picked from commit 274c0aea2e88db9bc41690c90e13e8aedf6193d4)
2024-03-06 12:10:43 +08:00
Lunny Xiao 003a358949
Users with read permission of pull requests can be assigned too (#27263)
This PR will also keep the consistent between list assigned users and
check assigned users.

(cherry picked from commit 98ab9445d1020c515c3c789f0b27d952903a2978)
2024-02-26 22:30:27 +01:00
Zettat123 77c56e29de
Allow non-admin users to delete review requests (#29057)
Fix #14459

The following users can add/remove review requests of a PR
- the poster of the PR
- the owner or collaborators of the repository
- members with read permission on the pull requests unit

(cherry picked from commit c42083a33950be6ee9f822c6d0de3c3a79d1f51b)

Conflicts:
	models/repo/repo_list_test.go
	tests/integration/api_nodeinfo_test.go
	tests/integration/api_repo_test.go
	shared fixture counts
2024-02-26 22:30:27 +01:00