summaryrefslogtreecommitdiffstats
path: root/tests/integration
Commit message (Collapse)AuthorAgeFilesLines
* 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-021-0/+22
| | | | | | | | | | | | | | | | (#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-201-0/+130
| | | | | | | 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>
* Prevent allow/reject reviews on merged/closed PRs (#30686)Kemal Zebari2024-04-271-0/+82
| | | Resolves #30675.
* Update misspell to 0.5.1 and add `misspellings.csv` (#30573)silverwind2024-04-272-5/+5
| | | | | | Misspell 0.5.0 supports passing a csv file to extend the list of misspellings, so I added some common ones from the codebase. There is at least one typo in a API response so we need to decided whether to revert that and then likely remove the dict entry.
* feat(api): enhance Actions Secrets Management API for repository (#30656)Bo-Yi Wu2024-04-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | - Add endpoint to list repository action secrets in API routes - Implement `ListActionsSecrets` function to retrieve action secrets from the database - Update Swagger documentation to include the new `/repos/{owner}/{repo}/actions/secrets` endpoint - Add `actions` package import and define new routes for actions, secrets, variables, and runners in `api.go`. - Refactor action-related API functions into `Action` struct methods in `org/action.go` and `repo/action.go`. - Remove `actionAPI` struct and related functions, replacing them with `NewAction()` calls. - Rename `variables.go` to `action.go` in `org` directory. - Delete `runners.go` and `secrets.go` in both `org` and `repo` directories, consolidating their content into `action.go`. - Update copyright year and add new imports in `org/action.go`. - Implement `API` interface in `services/actions/interface.go` for action-related methods. - Remove individual action-related functions and replace them with methods on the `Action` struct in `repo/action.go`. --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Signed-off-by: appleboy <appleboy.tw@gmail.com>
* Improve test for TestPullCompare (#30699)Lunny Xiao2024-04-261-5/+10
|
* Add test for #30674 (#30679)Lunny Xiao2024-04-241-0/+35
|
* Enable more `revive` linter rules (#30608)silverwind2024-04-222-6/+5
| | | | | | | | | | | Noteable additions: - `redefines-builtin-id` forbid variable names that shadow go builtins - `empty-lines` remove unnecessary empty lines that `gofumpt` does not remove for some reason - `superfluous-else` eliminate more superfluous `else` branches Rules are also sorted alphabetically and I cleaned up various parts of `.golangci.yml`.
* Fix repo home UI when there is no repo description (#30552)wxiaoguang2024-04-211-29/+3
| | | | | | Fix #30502 by a new approach. ![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76)
* Clarify permission "HasAccess" behavior (#30585)wxiaoguang2024-04-201-1/+1
| | | | | | | | | | | | | | | Follow #30495 "HasAccess" behavior wasn't clear, to make it clear: * Use a new name `HasAnyUnitAccess`, it will be easier to review related code and permission problems. * Separate everyone access mode to a separate field, then all calls to HasAccess are reverted to old behavior before #30495. * Add new tests. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix links in PyPI Simple Repository API page (#30594)wxiaoguang2024-04-201-1/+1
| | | | | | | | | | | | | | | Thanks to @Zottelchen for looking into problem and proposing the fix. Ref: https://github.com/astral-sh/uv/issues/3017 , https://peps.python.org/pep-0503/ This PR's change is from Zottelchen's work. And I by the way rename the `$p` to `$pd` because `p` is used as "package" in code, while `pd` is used as "package description". ---- Co-authored-by: Zottelchen
* Add an api test for updating user (#30539)Lunny Xiao2024-04-181-0/+25
| | | Fix #30518
* Allow everyone to read or write a wiki by a repo unit setting (#30495)wxiaoguang2024-04-171-2/+2
| | | | | Replace #6312 Help #5833 Wiki solution for #639
* Support nuspec manifest download for nuget packages (#28921)Michael Kriese2024-04-171-24/+53
| | | | | | | | | | | | | | | | Support downloading nuget nuspec manifest[^1]. This is useful for renovate because it uses this api to find the corresponding repository - Store nuspec along with nupkg on upload - allow downloading nuspec - add doctor command to add missing nuspec files [^1]: https://learn.microsoft.com/en-us/nuget/api/package-base-address-resource#download-package-manifest-nuspec --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Run `go generate` and `go vet` on all packages (#30529)silverwind2024-04-175-8/+7
| | | | | | | | | | Fixes: https://github.com/go-gitea/gitea/issues/30512 I think this does mean those tools would run on a potential `vendor` directory, but I'm not sure we really support vendoring of dependencies anymore. `release` has a `vendor` prerequisite so likely the source tarballs contain vendor files?
* feat(api): implement branch/commit comparison API (#30349)Bo-Yi Wu2024-04-161-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | - Add new `Compare` struct to represent comparison between two commits - Introduce new API endpoint `/compare/*` to get commit comparison information - Create new file `repo_compare.go` with the `Compare` struct definition - Add new file `compare.go` in `routers/api/v1/repo` to handle comparison logic - Add new file `compare.go` in `routers/common` to define `CompareInfo` struct - Refactor `ParseCompareInfo` function to use `common.CompareInfo` struct - Update Swagger documentation to include the new API endpoint for commit comparison - Remove duplicate `CompareInfo` struct from `routers/web/repo/compare.go` - Adjust base path in Swagger template to be relative (`/api/v1`) GitHub API https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix code owners will not be mentioned when a pull request comes from a ↵Lunny Xiao2024-04-152-1/+34
| | | | | | forked repository (#30476) Fix #30277 Caused by #29783
* Fix rename branch 500 when the target branch is deleted but exist in ↵Lunny Xiao2024-04-121-5/+75
| | | | | database (#30430) Fix #30428
* Add commit status summary table to reduce query from commit status table ↵Lunny Xiao2024-04-121-0/+7
| | | | | | | | | | | | (#30223) This PR adds a new table named commit status summary to reduce queries from the commit status table. After this change, commit status summary table will be used for the final result, commit status table will be for details. --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Use raw Wiki links for non-renderable Wiki files (#30273)Rafael2024-04-101-0/+1
| | | | | | | | | | | | | | | | | | | In Wiki pages, short-links created to local Wiki files were always expanded as regular Wiki Links. In particular, if a link wanted to point to a file that Gitea doesn't know how to render (e.g, a .zip file), a user following the link would be silently redirected to the Wiki's home page. This change makes short-links* in Wiki pages be expanded to raw wiki links, so these local wiki files may be accessed without manually accessing their URL. * only short-links ending in a file extension that isn't renderable are affected. Closes #27121. Signed-off-by: Rafael Girão <rafael.s.girao@tecnico.ulisboa.pt> Co-authored-by: silverwind <me@silverwind.io>
* Performance optimization for git push (#30104)Lunny Xiao2024-04-091-0/+11
| | | | | Agit returned result should be from `ProcReceive` hook but not `PostReceive` hook. Then for all non-agit pull requests, it will not check the pull requests for every pushing `refs/pull/%d/head`.