summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix get reviewers' bug (#32415) (#32616)Lunny Xiao2024-11-231-2/+2
| | | | | | | | | | This PR rewrites `GetReviewer` function and move it to service layer. Reviewers should not be watchers, so that this PR removed all watchers from reviewers. When the repository is under an organization, the pull request unit read permission will be checked to resolve the bug of Fix #32394 Backport #32415
* Fix PR creation on forked repositories (#31863) (#32591)Lunny Xiao2024-11-221-0/+27
| | | | | | Resolves #20475 Backport #31863 Co-authored-by: Job <LordChunk@users.noreply.github.com>
* Fix debian package clean up (#32351) (#32590)wxiaoguang2024-11-211-0/+35
| | | Partially backport #32351
* Refactor find forks and fix possible bugs that weak permissions check ↵Lunny Xiao2024-11-192-0/+132
| | | | | | | | | | | | | | | (#32528) (#32547) Backport #32528 - Move models/GetForks to services/FindForks - Add doer as a parameter of FindForks to check permissions - Slight performance optimization for get forks API with batch loading of repository units - Add tests for forking repository to organizations --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor push mirror find and add check for updating push mirror (#32539) ↵Lunny Xiao2024-11-182-43/+85
| | | | | | | | | (#32549) backport #32539 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix basic auth with webauthn (#32531) (#32536)Giteabot2024-11-161-0/+53
| | | | | | | | | Backport #32531 by @lunny WebAuthn should behave the same way as TOTP. When enabled, basic auth with username/password should need to WebAuthn auth, otherwise returned 401. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix artifact v4 upload above 8MB (#31664) (#32523)Giteabot2024-11-161-0/+130
|
* Fix broken releases when re-pushing tags (#32435) (#32449)Giteabot2024-11-101-0/+47
| | | | | | | | | | Backport #32435 by @Zettat123 Fix #32427 --------- Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix bug when a token is given public only (#32204) (#32218)Lunny Xiao2024-10-093-1/+57
| | | Backport #32204
* Ensure `GetCSRF` doesn't return an empty token (#32130) (#32157)Giteabot2024-10-013-11/+9
| | | | | | | | | | | | | | | | | Backport #32130 by @wolfogre Since page templates keep changing, some pages that contained forms with CSRF token no longer have them. It leads to some calls of `GetCSRF` returning an empty string, which fails the tests. Like https://github.com/go-gitea/gitea/blob/3269b04d61ffe6a7ce462cd05ee150e4491124e8/tests/integration/attachment_test.go#L62-L63 The test did try to get the CSRF token and provided it, but it was empty. Co-authored-by: Jason Song <i@wolfogre.com>
* Fix the logic of finding the latest pull review commit ID (#32139) (#32165)Giteabot2024-10-012-1/+35
| | | | | | | Backport #32139 by @Zettat123 Fix #31423 Co-authored-by: Zettat123 <zettat123@gmail.com>
* Fix bug in getting merged pull request by commit (#32079) (#32117)Zettat1232024-09-251-0/+16
| | | | | Backport #32079 Fix #32027
* Fix rename branch permission bug (#32066) (#32108)Giteabot2024-09-221-4/+4
| | | | | | | | | | Backport #32066 by @lunny The previous implementation requires admin permission to rename branches which should be write permission. Fix #31993 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add bin to Composer Metadata (#32099) (#32106)Giteabot2024-09-221-1/+7
| | | | | | | | | | | | | | | | | Backport #32099 by @maantje This PR addresses the missing `bin` field in Composer metadata, which currently causes vendor-provided binaries to not be symlinked to `vendor/bin` during installation. In the current implementation, running `composer install` does not publish the binaries, leading to issues where expected binaries are not available. By properly declaring the `bin` field, this PR ensures that binaries are correctly symlinked upon installation, as described in the [Composer documentation](https://getcomposer.org/doc/articles/vendor-binaries.md). Co-authored-by: Jamie Schouten <j4mie@hey.com>
* Fix incorrect `/tokens` api (#32085) (#32092)Giteabot2024-09-221-20/+11
| | | | | | | | | | Backport #32085 by @KN4CK3R Fixes #32078 - Add missing scopes output. - Disallow empty scope. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix: database not update release when using `git push --tags --force` ↵Giteabot2024-09-191-0/+36
| | | | | | | | | (#32040) (#32074) Backport #32040 by @ExplodingDragon link: https://codeberg.org/forgejo/forgejo/issues/4274 Co-authored-by: Exploding Dragon <explodingfkl@gmail.com>
* Refactor CSRF protector (#32057) (#32069)wxiaoguang2024-09-183-33/+8
| | | #32057 improves the CSRF handling and is worth to backport
* Add missing comment reply handling (#32050) (#32065)Giteabot2024-09-181-139/+143
| | | | | | | | | | | | | Backport #32050 by @KN4CK3R Fixes #31937 - Add missing comment reply handling - Use `onGiteaRun` in the test because the fixtures are not present otherwise (did this behaviour change?) Compare without whitespaces. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Handle invalid target when creating releases using API (#31841) (#32043)Giteabot2024-09-171-0/+18
| | | | | | | | | | | Backport #31841 by @kemzeb A 500 status code was thrown when passing a non-existent target to the create release API. This snapshot handles this error and instead throws a 404 status code. Discovered while working on #31840. Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
* Fix nuget/conan/container packages upload bugs (#31967) (#31982)Giteabot2024-09-053-70/+383
| | | | | Backport #31967 by @lunny Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add lock for parallel maven upload (#31954)Lunny Xiao2024-09-031-0/+33
| | | | Backport #31851 Fix #30171
* Prevent update pull refs manually and will not affect other refs update ↵Giteabot2024-09-022-0/+23
| | | | | | | | | | | | | | | | (#31931) (#31955) Backport #31931 by @lunny All refs under `refs/pull` should only be changed from Gitea inside but not by pushing from outside of Gitea. This PR will prevent the pull refs update but allow other refs to be updated on the same pushing with `--mirror` operations. The main changes are to add checks on `update` hook but not `pre-receive` because `update` will be invoked by every ref but `pre-receive` will revert all changes once one ref update fails. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix agit automerge (#31207) (#31881)Giteabot2024-08-203-0/+139
| | | | | | | Backport #31207 by @lunny Fix #31134 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix actions notify bug (#31866) (#31875)Giteabot2024-08-201-2/+2
| | | | | | | | Backport #31866 by @lunny Try to fix https://github.com/go-gitea/gitea/issues/31757#issuecomment-2295131062 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Show lock owner instead of repo owner on LFS setting page (#31788) (#31817)Giteabot2024-08-111-0/+62
| | | | | | | | | | | | | | | | | Backport #31788 by @wolfogre Fix #31784. Before: <img width="1648" alt="image" src="https://github.com/user-attachments/assets/03f32545-4a85-42ed-bafc-2b193a5d8023"> After: <img width="1653" alt="image" src="https://github.com/user-attachments/assets/e5bcaf93-49cb-421f-aac1-5122bc488b02"> Co-authored-by: Jason Song <i@wolfogre.com>
* Add permission check when creating PR (#31033) (#31720)yp053272024-07-292-16/+82
| | | | | Backport #31033 user should be a collaborator of the base repo to create a PR
* Fix #31185 try fix lfs download from bitbucket failed (#31201) (#31329)Giteabot2024-06-122-7/+7
| | | | | | | Backport #31201 by @Zoupers Fix #31185 Co-authored-by: Zoupers Zou <1171443643@qq.com>
* Remove sub-path from container registry realm (#31293) (#31300)Giteabot2024-06-101-3/+9
| | | | | Backport #31293 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix NuGet Package API for $filter with Id equality (#31188) (#31242)Thomas Desveaux2024-06-041-16/+86
| | | | | | | | | | | | | | | | | | | | | | Backport #31188 Fixes issue when running `choco info pkgname` where `pkgname` is also a substring of another package Id. Relates to #31168 --- This might fix the issue linked, but I'd like to test it with more choco commands before closing the issue in case I find other problems if that's ok. I'm pretty inexperienced with Go, so feel free to nitpick things. Not sure I handled [this](https://github.com/tdesveaux/gitea/blob/70f87e11b5caf1ee441ae71c7eba1831f45897d4/routers/api/packages/nuget/nuget.go#L135-L137) in the best way, so looking for feedback on if I should fix the underlying issue (`nil` might be a better default for `Value`?). Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix push multiple branches error with tests (#31151) (#31153)Giteabot2024-05-302-0/+53
| | | | | | | | | | | | | Backport #31151 by @lunny Fix #31140 The previous logic is wrong when pushing multiple branches. After first branch updated, it will ignore left other branches sync operations. As a workaround for the repositories, just push a new commit after the patch applied will fix the repositories status. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add an immutable tarball link to archive download headers for Nix (#31139) ↵Giteabot2024-05-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#31145) Backport #31139 by @Mic92 This allows `nix flake metadata` and nix in general to lock a *branch* tarball link in a manner that causes it to fetch the correct commit even if the branch is updated with a newer version. For further context, Nix flakes are a feature that, among other things, allows for "inputs" that are "github:someuser/somerepo", "https://some-tarball-service/some-tarball.tar.gz", "sourcehut:~meow/nya" or similar. This feature allows our users to fetch tarballs of git-based inputs to their builds rather than using git to fetch them, saving significant download time. There is presently no gitea or forgejo specific fetcher in Nix, and we don't particularly wish to have one. Ideally (as a developer on a Nix implementation myself) we could just use the generic tarball fetcher and not add specific forgejo support, but to do so, we need additional metadata to know which commit a given *branch* tarball represents, which is the purpose of the Link header added here. The result of this patch is that a Nix user can specify `inputs.something.url = "https://forgejo-host/some/project/archive/main.tar.gz"` in flake.nix and get a link to some concrete tarball for the actual commit in the lock file, then when they run `nix flake update` in the future, they will get the latest commit in that branch. Example of it working locally: » nix flake metadata --refresh 'http://localhost:3000/api/v1/repos/jade/cats/archive/main.tar.gz?dir=configs/nix' Resolved URL: http://localhost:3000/api/v1/repos/jade/cats/archive/main.tar.gz?dir=configs/nix Locked URL: http://localhost:3000/api/v1/repos/jade/cats/archive/804ede182b6b66469b23ea4d21eece52766b7a06.tar.gz?dir=configs /nix&narHash=sha256-yP7KkDVfuixZzs0fsqhSETXFC0y8m6nmPLw2GrAMxKQ%3D Description: Computers with the nixos Path: /nix/store/s856c6yqghyan4v0zy6jj19ksv0q22nx-source Revision: 804ede182b6b66469b23ea4d21eece52766b7a06 Last modified: 2024-05-02 00:48:32 For details on the header value, see: https://github.com/nixos/nix/blob/56763ff918eb308db23080e560ed2ea3e00c80a7/doc/manual/src/protocols/tarball-fetcher.md Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com> Co-authored-by: Jade Lovelace <software@lfcode.ca> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix wrong display of recently pushed notification (#25812) (#31043)yp053272024-05-2312-33/+226
| | | | | | | | | | | Backport #25812 ~~ps: removed some new codes in `tests/integration/pull_merge_test.go`~~ --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix automerge will not work because of some events haven't been triggered ↵Giteabot2024-05-223-21/+224
| | | | | | | | | | | | | | | | | | (#30780) (#31039) Backport #30780 by @lunny Replace #25741 Close #24445 Close #30658 Close #20646 ~Depends on #30805~ Since #25741 has been rewritten totally, to make the contribution easier, I will continue the work in this PR. Thanks @6543 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix incorrect "blob excerpt" link when comparing files (#31013) (#31026)Giteabot2024-05-201-0/+39
| | | | | Backport #31013 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Avoid 500 panic error when uploading invalid maven package file (#31014) ↵Giteabot2024-05-201-0/+10
| | | | | | | (#31027) Backport #31014 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix data-race during testing (#30999) (#31024)Giteabot2024-05-201-2/+4
| | | | | | | Backport #30999 by wxiaoguang Fix #30992 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Protected tag is no internal server error (#30962) (#30970)Giteabot2024-05-142-17/+29
| | | | | | | | | | Backport #30962 by @KN4CK3R Fixes #30959 Adds an API test for protected tags. Fix existing tag in combination with fixtures. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Restyle release list, fix branch dropdown (#30837) (#30968)Giteabot2024-05-131-4/+4
| | | | | | | | | | | | | | | | | | | Backport #30837 by @silverwind Fixes https://github.com/go-gitea/gitea/issues/30821 and restyles the release list. Desktop: <img width="1199" alt="Screenshot 2024-05-02 at 20 46 10" src="https://github.com/go-gitea/gitea/assets/115237/bee92423-d4a9-4b26-8301-3a1e09eef4cd"> Mobile: <img width="443" alt="Screenshot 2024-05-02 at 20 46 21" src="https://github.com/go-gitea/gitea/assets/115237/42ecbae5-bdb6-4b16-a0ee-9c64daede68d"> Co-authored-by: silverwind <me@silverwind.io>
* Support using label names when changing issue labels (#30943) (#30958)Giteabot2024-05-131-2/+51
| | | | | | | | | | | | | | | | Backport #30943 by @Zettat123 Resolve #30917 Make the APIs for adding labels and replacing labels support both label IDs and label names so the [`actions/labeler`](https://github.com/actions/labeler) action can work in Gitea. <img width="600px" src="https://github.com/go-gitea/gitea/assets/15528715/7835c771-f637-4c57-9ce5-e4fbf56fa0d3" /> Co-authored-by: Zettat123 <zettat123@gmail.com>
* Update issue indexer after merging a PR (#30715) (#30903)Giteabot2024-05-091-0/+61
| | | | | | | Backport #30715 by @Zettat123 Fix #30684 Co-authored-by: Zettat123 <zettat123@gmail.com>
* Fix various problems around projects board view (#30696) (#30902)Giteabot2024-05-082-3/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #30696 by @lunny # The problem The previous implementation will start multiple POST requests from the frontend when moving a column and another bug is moving the default column will never be remembered in fact. # What's changed - [x] This PR will allow the default column to move to a non-first position - [x] And it also uses one request instead of multiple requests when moving the columns - [x] Use a star instead of a pin as the icon for setting the default column action - [x] Inserted new column will be append to the end - [x] Fix #30701 the newly added issue will be append to the end of the default column - [x] Fix when deleting a column, all issues in it will be displayed from UI but database records exist. - [x] Add a limitation for columns in a project to 20. So the sorting will not be overflow because it's int8. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make sure git version&feature are always prepared (#30877) (#30879)wxiaoguang2024-05-071-1/+1
| | | Backport #30877
* Fix issue/PR title edit (#30858) (#30865)Giteabot2024-05-052-2/+2
| | | | | | | | Backport #30858 by wxiaoguang 1. "enter" doesn't work (I think it is the last enter support for #14843) 2. if a branch name contains something like `&`, then the branch selector doesn't update Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add result check in TestAPIEditUser (#29674) (#30860)Giteabot2024-05-051-2/+5
| | | | | | | | | | Backport #29674 by @yp05327 Fix #29514 there are too many usage of `NewRequestWithValues`, so there's no need to check all of them. Just one is enough I think. Co-authored-by: yp05327 <576951401@qq.com>
* Fix no edit history after editing issue's title and content (#30814) (#30845)Giteabot2024-05-032-8/+22
| | | | | | | | | Backport #30814 by @yp05327 Fix #30807 reuse functions in services Co-authored-by: yp05327 <576951401@qq.com>
* Don't only list code-enabled repositories when using repository API (#30817) ↵Giteabot2024-05-031-0/+34
| | | | | | | | | | | (#30848) Backport #30817 by kemzeb We should be listing all repositories by default. Fixes #28483. Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
* Catch and handle unallowed file type errors in issue attachment API (#30791) ↵Giteabot2024-05-032-0/+55
| | | | | | | | | | | (#30834) Backport #30791 by kemzeb Before, we would just throw 500 if a user passes an attachment that is not an allowed type. This commit catches this error and throws a 422 instead since this should be considered a validation error. Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
* Skip gzip for some well-known compressed file types (#30796) (#30813)Giteabot2024-05-021-0/+33
| | | | | | Backport #30796 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Get repo assignees and reviewers should ignore deactivated users (#30770) ↵65432024-04-301-1/+3
| | | | | | | | | | | | | (#30782) Backport #30770 If an user is deactivated, it should not be in the list of users who are suggested to be assigned or review-requested. old assignees or reviewers are not affected. --- *Sponsored by Kithara Software GmbH*
* Fix issue label rendering in the issue popup (#30763) (#30773)Giteabot2024-04-301-3/+8
| | | | | Backport #30763 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>