aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration
Commit message (Collapse)AuthorAgeFilesLines
...
* Add API to support link package to repository and unlink it (#33481)Lunny Xiao2025-02-161-9/+33
| | | | | | | Fix #21062 --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
* Artifacts download api for artifact actions v4 (#33510)ChristopherHX2025-02-161-0/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | * download endpoint has to use 302 redirect * fake blob download used if direct download not possible * downloading v3 artifacts not possible New repo apis based on GitHub Rest V3 - GET /runs/{run}/artifacts (Cannot use run index of url due to not being unique) - GET /artifacts - GET + DELETE /artifacts/{artifact_id} - GET /artifacts/{artifact_id}/zip - (GET /artifacts/{artifact_id}/zip/raw this is a workaround for a http 302 assertion in actions/toolkit) - api docs removed this is protected by a signed url like the internal artifacts api and no longer usable with any token or swagger - returns http 401 if the signature is invalid - or change the artifact id - or expired after 1 hour Closes #33353 Closes #32124 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve commits list performance to reduce unnecessary database queries (#33528)Lunny Xiao2025-02-141-0/+41
| | | | | | When listing commits, Gitea attempts to retrieve the actual user based on the commit email. Querying users one by one from the database is inefficient. This PR optimizes the process by batch querying users by email, reducing the number of database queries.
* Only show the latest version in the Arch index (#33262)Exploding Dragon2025-02-131-29/+63
| | | | | | | | | | Only show the latest version of the package in the arch repo. closes #33534 --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enhance routers for the Actions runner operations (#33549)Jason Song2025-02-111-0/+151
| | | | | | | | | - Find the runner before deleting - Move the main logic from `routers/web/repo/setting/runners.go` to `routers/web/shared/actions/runners.go`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enhance routers for the Actions variable operations (#33547)Jason Song2025-02-111-0/+149
| | | | | | | | | | - Find the variable before updating or deleting - Move the main logic from `routers/web/repo/setting/variables.go` to `routers/web/shared/actions/variables.go`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Feature: Support workflow event dispatch via API (#33545)wxiaoguang2025-02-111-12/+729
| | | | | | | | | Fix: https://github.com/go-gitea/gitea/issues/31765 (Re-open #32059) --------- Co-authored-by: Bence Santha <git@santha.eu> Co-authored-by: Bence Sántha <7604637+bencurio@users.noreply.github.com> Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Revert "Feature: Support workflow event dispatch via API (#32059)" (#33541)wxiaoguang2025-02-101-624/+0
| | | This reverts commit 523751dc82bbb9d3f8d413f232e23ab0476eb4d4.
* Feature: Support workflow event dispatch via API (#32059)Bence Sántha2025-02-101-0/+624
| | | | | | | | | ref: https://github.com/go-gitea/gitea/issues/31765 --------- Signed-off-by: Bence Santha <git@santha.eu> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Add "No data available" display when list is empty (#33517)Kerwin Bryant2025-02-091-1/+1
| | | | | | | | | Add a "No data available" message to be displayed when the list has no data. This improves the user experience by providing clear feedback in an empty state. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Reject star-related requests if stars are disabled (#33208)Henrique Corrêa2025-02-041-0/+64
| | | | | | | | | | | | | This PR fixes #33205. If stars are disabled: * The `.../repo/stars` page returns a 403 Forbidden error * Star-related API endpoints return a 403 Forbidden error saying `Stars are disabled.` * Same for action endpoints --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix commit status events (#33320)Lunny Xiao2025-02-041-0/+39
| | | | | | | | | | Fix #32873 Fix #33201 ~Fix #33244~ ~Fix #33302~ depends on ~#33396~ A part of this PR should be backported to v1.23 manually.
* chore: fix some trivial problems and TODOs (#33473)wxiaoguang2025-02-021-69/+0
| | | | | | | | | | | 1. Fix incorrect `MentionCount` (actually it seems to be deadcode, affects nothing) 2. Remove fallback sha1 support for time limit token 3. Use route middleware `reqRepoActionsWriter` for `ArtifactsDeleteView` 4. Use clearer message "Failed to authenticate user" instead of "Verify" when auth fails 5. `tests/integration/benchmarks_test.go` is not quite right, actually it is never used, so delete it. 6. Remove or update TODO comments
* Worktime tracking for the organization level (#19808)K Kovacs2025-02-031-0/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dear Gitea team, first of all, thanks for the great work you're doing with this project. I'm planning to introduce Gitea at a client site, and noticed that while there is time recording, there are no project-manager-friendly reports to actually make use of that data, as were also mentioned by others in #4870 #8684 and #13531. Since I had a little time last weekend, I had put together something that I hope to be a useful contribution to this great project (while of course useful for me too). This PR adds a new "Worktime" tab to the Organisation level. There is a date range selector (by default set to the current month), and there are three possible views: - by repository, - by milestone, and - by team member. Happy to receive any feedback! There are several possible future improvements of course (predefined date ranges, charts, a member time sheet, matrix of repos/members, etc) but I hope that even in this relatively simple state this would be useful to lots of people. <img width="1161" alt="Screen Shot 2022-05-25 at 22 12 58" src="https://user-images.githubusercontent.com/118010/170366976-af00c7af-c4f3-4117-86d7-00356d6797a5.png"> Keep up the good work! Kristof --------- Co-authored-by: user <user@kk-git1> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Inclusion of rename organization api (#33303)Bruno Sofiato2025-02-011-137/+139
| | | | | | | | | | | | | | | | | | This adds an endpoint (`/orgs/{org}/rename`) to rename organizations. I've modeled the endpoint using the rename user endpoint -- `/admin/users/{username}/rename` -- as base. It is the 1st time I wrote a new API endpoint (I've tried to follow the rename users endpoint code while writing it). So feel free to ping me if there is something wrong or missing. Resolves #32995 --------- Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support choose email when creating a commit via web UI (more) (#33445)wxiaoguang2025-01-313-111/+127
| | | Follow #33432
* Fix "redirect link" handling (#33440)wxiaoguang2025-01-312-18/+20
| | | | | | | `a%2fb` should not redirect to `a/b` --------- Co-authored-by: delvh <dev.lh@web.de>
* Add tests for webhook and fix some webhook bugs (#33396)Lunny Xiao2025-01-304-16/+548
| | | | | | This PR created a mock webhook server in the tests and added integration tests for generic webhooks. It also fixes bugs in package webhooks and pull request comment webhooks.
* Support choose email when creating a commit via web UI (#33432)wxiaoguang2025-01-304-46/+152
| | | Initial PR for #24469
* Fix `GetCommitBranchStart` bug (#33298)Zettat1232025-01-281-25/+44
| | | | | | Fix #33265 Fix #33370 This PR also fixes some bugs in `TestGitGeneral`.
* Fix system admin cannot fork or get private fork with API (#33401)Lunny Xiao2025-01-272-3/+33
| | | Fix #33368
* Add pubdate for repository rss and add some tests (#33411)Lunny Xiao2025-01-272-1/+59
| | | Fix #33291
* Use ProtonMail/go-crypto to replace keybase/go-crypto (#33402)wxiaoguang2025-01-271-6/+3
| | | | | | Fix #33400 The keybase/go-crypto is no longer maintained and it generates malformed signatures, ProtonMail/go-crypto is the actively maintained fork.
* Refactor context flash msg and global variables (#33375)wxiaoguang2025-01-256-30/+33
| | | | | | 1. add `GetSiteCookieFlashMessage` to help to parse flash message 2. clarify `handleRepoHomeFeed` logic 3. remove unnecessary global variables, use `sync.OnceValue` instead 4. add some tests for `IsUsableUsername` and `IsUsableRepoName`
* Support disable passkey auth (#33348)yp053272025-01-221-1/+19
| | | | | | | Fix #33314 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve sync fork behavior (#33319)wxiaoguang2025-01-201-11/+40
| | | | | | | | Fix #33271 Suppose there is a `branch-a` in fork repo: 1. if `branch-a` exists in base repo: try to sync `base:branch-a` to `fork:branch-a` 2. if `branch-a` doesn't exist in base repo: try to sync `base:main` to `fork:branch-a`
* Fix Account linking page (#33325)CrimsonEdgeHope2025-01-191-0/+20
| | | | | | | | | | | Fix password form missing whilst linking account even with `ENABLE_PASSWORD_SIGNIN_FORM = true`. Remove redundant empty box in account linking sign up page when `LinkAccountMode` is true. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix push message behavior (#33215)Chai-Shi2025-01-171-66/+50
| | | | | | | Fixes #32769 by the logic from pr #33192 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Only allow admins to rename default/protected branches (#33276)Kemal Zebari2025-01-152-9/+42
| | | | | | | | | | | | | Currently, anyone with write permissions to a repo are able to rename default or protected branches. This change follows [GitHub's](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch) design by only allowing repo/site admins to change these branches. However, it also follows are current design for protected branches and only allows admins to modify branch names == branch protection rule names. Glob-based rules cannot be renamed by anyone (as was already the case, but we now catch `ErrBranchIsProtected` which we previously did not catch, throwing a 500).
* Move some Actions related functions from `routers` to `services` (#33280)Zettat1232025-01-151-0/+91
| | | | | | | | | | | | Move the main logic of `generateTaskContext` and `findTaskNeeds` to the `services` layer. This is a part of #32751, since we need the git context and `needs` to parse the concurrency expressions. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix incorrect TagName/BranchName usages (#33279)wxiaoguang2025-01-151-9/+17
| | | Add add a new test
* Refactor ref type (#33242)Lunny Xiao2025-01-141-0/+25
| | | | | | | | | | | | Major changes: 1. do not sync ".keep" file during tests 2. fix incorrect route handler and empty repo handling (backported as #33253 with tests) 3. do not use `RepoRef`: most of the calls are abuses. 4. Use `git.RefType` instead of a new type definition `RepoRefType` on `context`. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix 500 error when error occurred in migration page (#33256)yp053272025-01-141-1/+5
| | | | | | | | | | The template should be `repo/migrate/{service type}` But input element `service` is not in the form. Related: #33081 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Validate that the tag doesn't exist when creating a tag via the web (#33241)Kemal Zebari2025-01-141-1/+1
| | | | | | | | | | | | | | | | Found while investigating #33210. This line no longer makes sense because the form field "TagName" is required, so this would mean that this code path would never be covered. Because it isn't covered, we end up going down the "update release" logic where we eventually set `Release.IsTag` to false (meaning it will now be treated as a release instead of a tag). This snapshot rewrites the condition to ensure that we aren't trying to create a tag that already exists. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor context RefName and RepoAssignment (#33226)wxiaoguang2025-01-131-1/+3
| | | | | | | The `ctx.Repo.RefName` was used to be a "short name", it causes a lot of ambiguity. This PR does some refactoring and use `RefFullName` to replace the legacy `RefName`, and simplify RepoAssignment
* Fix sync fork for consistency (#33147)Chai-Shi2025-01-101-0/+122
| | | | | | | | | Fixes #33145 An integration test could be added. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix raw file API ref handling (#33172)wxiaoguang2025-01-101-24/+34
| | | Fix #33164 and add more tests
* Automerge supports deleting branch automatically after merging (#32343)Lunny Xiao2025-01-102-7/+9
| | | | | | | | | | | | Resolve #32341 ~Depends on #27151~ - [x] It will display a checkbox of deleting the head branch on the pull request view page when starting an auto-merge task. - [x] Add permission check before deleting the branch - [x] Add delete branch comment for those closing pull requests because of head branch or base branch was deleted. - [x] Merge `RetargetChildrenOnMerge` and `AddDeletePRBranchComment` into `service.DeleteBranch`.
* Refactor older tests to use testify (#33140)TheFox0x72025-01-095-58/+36
| | | | | Refactor checks to use assert/require Use require.Eventually for waiting in elastic and meilisearch tests Use require to exit early instead of assert
* Update status check for all supported on.pull_request.types in Gitea (#33117)yp053272025-01-081-22/+222
| | | | | | | | | | | | | | | | | | | | | | | Thanks @Zettat123 Follow #33116 Fix #33051 on.pull_request.types doc: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request on.pull_request.types added in this PR: ``` assigned, unassigned, review_requested, review_request_removed, milestoned, demilestoned, labeled, unlabeled ``` unsupported types in Gitea: ``` // Unsupported activity types: // converted_to_draft, ready_for_review, locked, unlocked, auto_merge_enabled, auto_merge_disabled, enqueued, dequeued ``` TODO: - [x] add test
* Make git clone URL could use current signed-in user (#33091)wxiaoguang2025-01-071-2/+2
| | | | | | | | | | | | | | close #33086 * Add a special value for "SSH_USER" setting: `(DOER_USERNAME)` * Improve parseRepositoryURL and add tests (now it doesn't have hard dependency on some setting values) Many changes are just adding "ctx" and "doer" argument to functions. By the way, improve app.example.ini, remove all `%(key)s` syntax, it only makes messy and no user really cares about it. Document: https://gitea.com/gitea/docs/pulls/138
* Refactor package (routes and error handling, npm peer dependency) (#33111)wxiaoguang2025-01-061-18/+29
|
* Fix repo empty guide (#33114)wxiaoguang2025-01-061-1/+5
|
* Use `Project-URL` metadata field to get a PyPI package's homepage URL (#33089)Kemal Zebari2025-01-031-6/+63
| | | Resolves #33085.
* Refactor env var related code (#33075)wxiaoguang2025-01-021-12/+0
| | | And add more comments
* Refactor pull-request compare&create page (#33071)wxiaoguang2025-01-021-2/+2
| | | The old code is unnecessarily complex.
* Remove some unnecessary template helpers (#33069)wxiaoguang2025-01-011-169/+174
| | | | DisableGitHooks and DisableImportLocal are only used when editing a user, so only set them in `editUserCommon`
* Refactor maven package registry (#33049)wxiaoguang2024-12-311-38/+70
| | | Close #33036
* [Feature] Private README.md for organization (#32872)Chai-Shi2024-12-311-0/+132
| | | | | | | | Implemented #29503 --------- Co-authored-by: Ben Chang <ben_chang@htc.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix templating in pull request comparison (#33025)TheFox0x72024-12-291-0/+68
| | | | | Adds test for expected behavior Closes: https://github.com/go-gitea/gitea/issues/33013