Commit graph

4182 commits

Author SHA1 Message Date
erik
8579b7f7bb Use optional.Some 2024-04-09 11:21:57 +02:00
erik
97343470bc Merge branch 'forgejo' into forgejo-federated-star 2024-04-09 10:42:42 +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
Michael Jerger
7a142c876e remove federated user in case of user deletion 2024-04-02 18:36:22 +02:00
Clemens
2ad685fd2c fix like target 2024-03-28 15:41:43 +01: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
Clemens
97b5e0da91 revise NewForgeLike
Also added new test, which still fails since time.Now() does not match
2024-03-27 16:20:33 +01:00
erik
84f73d9db8 Add ToDo 2024-03-26 16:56:06 +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
e9bbdc678b Not using object URL 2024-03-26 16:21:09 +01:00
erik
32d457f9a3 StarRepo Wrapper 2024-03-26 15:28:36 +01:00
erik
0b8aa3105c Create object manually 2024-03-26 15:28:11 +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
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
erik
ed256ca540 Implement NewForgeLike 2024-03-21 16:27:08 +01:00
Michael Jerger
b4bb41e0e3 introduce federated repo 2024-03-21 08:25:40 +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
Gusted
331fa44956
[BUG] Ensure HasIssueContentHistory takes into account comment_id
- The content history table contains the content history of issues and
comments. For issues they are saved with an comment id of zero.
- If you want to check if the issue has an content history, it should
take into account that SQL has `comment_id = 0`, as it otherwise could
return incorrect results when for example the issue already has an
comment that has an content history.
- Fix the code of `HasIssueContentHistory` to take this into account, it
relied on XORM to generate the SQL from the non-default values of the
struct, this wouldn't generate the `comment_id = 0` SQL as `0` is the
default value of an integer.
- Remove an unncessary log (it's not the responsibility of `models`
code to do logging).
- Adds unit test.
- Resolves #2513
2024-02-29 18:23:06 +01:00
Gusted
fb2795b5bb
[BUG] Correct changed files for codeowners
- The CODEOWNER feature relies on the changed files to determine which
reviewers should be added according to the `CODEOWNER` file.
- The current approach was to 'diff' between the base and head branch,
which seems logical but fail in practice when the pull request is out of
date with the base branch. Therefore it should instead diff between the
head branch and the merge base of the head and base branch, so only the
actual affected files by the pull requests are used, the same approach
is used by the diff of an unmerged pull request.
- Add integration testing (for the feature as well).
- Resolves #2458
2024-02-27 23:16:00 +01:00
Jimmy Praet
f95fb8cc44 Add attachment support for code review comments (#29220)
Fixes #27960, #24411, #12183

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-27 18:35:43 +00: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
qwerty287
1608ef0ce9
Add API to get merged PR of a commit (#29243)
Adds a new API `/repos/{owner}/{repo}/commits/{sha}/pull` that allows
you to get the merged PR associated to a commit.

---------

Co-authored-by: 6543 <6543@obermui.de>
(cherry picked from commit 0a426cc575734e5eff410d6a790f40473117f753)
2024-02-26 22:30:26 +01:00
6543
8ff858b94b
Start to migrate from util.OptionalBool to optional.Option[bool] (#29329)
just create transition helper and migrate two structs

(cherry picked from commit 7fbdb60fc1152acc9a040dc04b1b0f5a3475b081)
2024-02-26 22:30:26 +01:00