aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Give organisation members access to organisation feeds (#33508)Job7 days3-20/+6
| | | | | | | | | | | | | | | | | | | | | | | | Currently the organisation feed only includes items for public repositories (for non-administrators). This pull requests adds notifications from private repositories to the organisation-feed (for accounts that have access to the organisation). Feed-items only get shown for repositories where the users team(s) should have access to, this filtering seems to get done by some existing code. Needs some tests, but am unsure where/how to add them. Before: ![image](https://github.com/user-attachments/assets/8b63f430-227a-4b19-ad1a-f6f5175de301) After: ![image](https://github.com/user-attachments/assets/b439ce0e-4946-421c-a399-421806c7a6d8) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Feature: Ephemeral action runners (#33570)ChristopherHX8 days4-12/+165
| | | | | | | | * This includes a runner mock test for hardend PickTask behavior like described in my proposal * Runner register ephemeral flag introduced in https://gitea.com/gitea/act_runner/pulls/649 Closes #32461
* Improve repo commit view (#33877)wxiaoguang8 days8-42/+90
| | | | | | | | | | | | | | | | | Fix #24623 Major changes: 1. Redirect `/owner/repo/blob/*` requests to `/owner/repo/src/commit/*` (like GitHub) 2. Add a "view file diff" link (see screenshot below) 3. Refactor "AssertHTMLElement" to generic, now we can accurately assert existence or number. 4. Add more tests --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de>
* Pull request updates will also trigger code owners review requests (#33744)Lunny Xiao8 days1-3/+39
| | | | | | | | | | Fix #33490 It will only read the changed file on the pushed commits but not all the files of this PR. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add workflow_job webhook (#33694)ChristopherHX11 days1-0/+146
| | | | | | | | | Provide external Integration information about the Queue lossly based on https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_job Naming conflicts between GitHub & Gitea are here, Blocked => Waiting, Waiting => Queued Rationale Enhancement for ephemeral runners management #33570
* Fix test code (#33829)wxiaoguang12 days6-135/+107
| | | Do not use onGiteaRun if there is no git operation
* Fix LFS URL (#33840)wxiaoguang12 days5-1/+10
| | | Fix #33839
* Add material icons for file list (#33837)wxiaoguang12 days1-1/+1
|
* Full-file syntax highlighting for diff pages (#33766)Dustin Firebaugh13 days1-17/+20
| | | | | | | | | | | | Fix #33358, fix #21970 This adds a step in the `GitDiffForRender` that does syntax highlighting for the entire file and then only references lines from that syntax highlighted code. This allows things like multi-line comments to be syntax highlighted correctly. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Decouple diff stats query from actual diffing (#33810)wxiaoguang2025-03-082-23/+24
| | | | | | | | | The diff stats are no longer part of the diff generation. Use `GetDiffShortStat` instead to get the total number of changed files, added lines, and deleted lines. As such, `gitdiff.GetDiff` can be simplified: It should not do more than expected. And do not run "git diff --shortstat" for pull list. Fix #31492
* Add global lock for migrations to make upgrade more safe with multiple ↵Lunny Xiao2025-03-071-3/+4
| | | | replications (#33706)
* Remove context from git struct (#33793)TheFox0x72025-03-049-52/+52
| | | | Argument is moved from struct init in command run, which lets us remove context from struct.
* Webhook add X-Gitea-Hook-Installation-Target-Type Header (#33752)ChristopherHX2025-03-011-0/+2
| | | | | | | | | | | | This is a X-GitHub Header port * repository for repository webhooks (matches GitHub) * organization for organization webhooks (matches GitHub) * user for user webhooks (Gitea specific) * system for system webhooks (Gitea specific) * default for default hooks needs testing (Gitea specific) - `X-Gitea-Hook-Installation-Target-Type` - `X-GitHub-Hook-Installation-Target-Type`
* Add composor source field (#33502)Lunny Xiao2025-02-281-0/+35
| | | Fix #33066
* Improve "generate new access token" form (#33730)Guillaume2025-02-276-48/+16
| | | | | | | | | | | | | | | | | | | | | Fix: https://github.com/go-gitea/gitea/issues/33519 As discussed in [PR #33614](https://github.com/go-gitea/gitea/pull/33614), the ScopedAccessTokenSelector Vue component is not particularly useful. This PR removes the component and reverts to using HTML templates. It also introduces some (hopefully) useful refactoring. The Vue component was causing the UX bug reported in the linked issue. Required form fields are now properly working, as expected (see screenshot). ![Screenshot from 2025-02-25 22-00-28](https://github.com/user-attachments/assets/41167854-0718-48b0-a3ee-75ca3a7b8b20) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Clone repository with Tea CLI (#33725)Quentin2025-02-271-0/+10
| | | | | | | | | | | | This PR adds "Tea CLI" as a clone method. <img width="350" alt="Capture d’écran 2025-02-25 à 23 38 47" src="https://github.com/user-attachments/assets/8e86e54a-998b-45d1-9f20-167b449e79b6" /> --------- Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix git empty check and HEAD request (#33690)wxiaoguang2025-02-242-15/+30
|
* Fix some user name usages (#33689)wxiaoguang2025-02-231-88/+100
| | | | | | | 1. GetUserOrgsList should "order by" lower_name 2. GetIssuePostersWithSearch should search in-case-sensitive-ly 3. LoginName should not be used as username By the way, remove unnecessary "onGiteaRun"
* Fix for Maven Package Naming Convention Handling (#33678)Diana2025-02-221-0/+14
| | | | | | | | Make legacy package names could be listed and add tests --------- Co-authored-by: diana.strebkova@t-systems.com <diana.strebkova@t-systems.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Upgrade golangci-lint to v1.64.5 (#33654)wxiaoguang2025-02-211-6/+2
| | | | | Use `usetesting` instead of deprecated `tenv`. 1. Follow up #33648 2. Make lint pass and add some comments
* Use test context in tests and new loop system in benchmarks (#33648)TheFox0x72025-02-2026-83/+61
| | | | | | | | Replace all contexts in tests with go1.24 t.Context() --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix project issues list and counting (#33594)Lunny Xiao2025-02-171-1/+1
| | | | Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* 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-319-124/+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-308-16/+572
| | | | | | 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>
* Enable Typescript `noImplicitAny` (#33322)silverwind2025-01-221-5/+6
| | | | | | | Enable `noImplicitAny` and fix all issues. --------- 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>