aboutsummaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR web route permission check (#33636)wxiaoguang2025-02-192-5/+32
| | | | | | | | | | | See the FIXME comment in code. Otherwise, if a repo's issue unit is disabled, then the PRs can't be edited anymore. By the way, make the permission log output look slightly better. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: metiftikci <metiftikci@hotmail.com>
* Refactor error system (#33626)wxiaoguang2025-02-171-6/+9
|
* Fix project issues list and counting (#33594)Lunny Xiao2025-02-171-2/+2
| | | | Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* enable literal string for code search (#33590)Darren Hoo2025-02-167-15/+147
| | | | | | | | Close: #33588 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Artifacts download api for artifact actions v4 (#33510)ChristopherHX2025-02-162-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix various problems (artifact order, api empty slice, assignee check, fuzzy ↵wxiaoguang2025-02-131-0/+7
| | | | | | | | | | prompt, mirror proxy, adopt git) (#33569) * Make artifact list output a stable order * Fix #33506 * Fix #33521 * Fix #33288 * Fix #33196 * Fix #33561
* Feature: Support workflow event dispatch via API (#33545)wxiaoguang2025-02-112-0/+62
| | | | | | | | | 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-33/+0
| | | This reverts commit 523751dc82bbb9d3f8d413f232e23ab0476eb4d4.
* Feature: Support workflow event dispatch via API (#32059)Bence Sántha2025-02-101-0/+33
| | | | | | | | | 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>
* refactor: decouple context from migration structs (#33399)TheFox0x72025-02-074-60/+51
| | | | | | | Use context as much as possible. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move gitgraph from modules to services layer (#33527)Lunny Xiao2025-02-074-1429/+0
| | | Just move, no code change.
* Add go wrapper around git diff-tree --raw -r -M (#33369)Alexander McRae2025-02-072-14/+29
| | | | | * Implemented calling git diff-tree * Ensures wrapper function is called with valid arguments * Parses output into go struct, using strong typing when possible
* Fix unnecessary comment when moving issue on the same project column (#33496)Lunny Xiao2025-02-051-1/+6
| | | Fix #33482
* chore: fix some trivial problems and TODOs (#33473)wxiaoguang2025-02-024-17/+7
| | | | | | | | | | | 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-033-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+9
| | | | | | | | | | | | | | | | | | 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>
* Fix SSH LFS memory usage (#33455)wxiaoguang2025-01-3112-102/+74
| | | Fix #33448
* Revert empty lfs ref name (#33454)wxiaoguang2025-01-311-2/+6
| | | Fix #33453
* Add tests for webhook and fix some webhook bugs (#33396)Lunny Xiao2025-01-301-58/+2
| | | | | | 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.
* Link to tree views of submodules if possible (#33424)Rowan Bohde2025-01-302-4/+4
| | | | | | | | | | | | | | This is a follow-up to https://github.com/go-gitea/gitea/pull/33097. When linking a submodule at a commit in either the repo view, or a diff when adding a new submodule, link to the tree view of that submodules intead of the individual commit. This shows the user the full tree, instead of the diff of the commit. This makes the assumption that the tree for a given SHA is at `<repo_url>/tree/<sha>`. This URL format is supported by both Github & Gitlab, but not Gitea. To fix this, add a redirect from `<username>/<repo>/tree/<ref>` to `<username>/<repo>/src/<ref>`, so that Gitea can support this URL structure.
* Refactor user & avatar (#33433)wxiaoguang2025-01-301-2/+2
| | | | | 1. better GetPossibleUserByID logic 2. fix some function name & comment typos 3. do not re-generate avatar if one exists
* Fix `GetCommitBranchStart` bug (#33298)Zettat1232025-01-282-5/+5
| | | | | | Fix #33265 Fix #33370 This PR also fixes some bugs in `TestGitGeneral`.
* Refactor context flash msg and global variables (#33375)wxiaoguang2025-01-258-487/+506
| | | | | | 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`
* Refactor webhook events (#33337)Lunny Xiao2025-01-233-55/+57
| | | | | | | Extract from #33320 This PR uses a map instead of a struct to store webhook event information. It removes many duplicated functions and makes the logic clearer.
* Support disable passkey auth (#33348)yp053272025-01-221-0/+2
| | | | | | | Fix #33314 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support performance trace (#32973)wxiaoguang2025-01-219-7/+506
| | | | | | | | | | | | | 1. Add a OpenTelemetry-like shim-layer to collect traces 2. Add a simple builtin trace collector and exporter, end users could download the diagnosis report to get the traces. This PR's design is quite lightweight, no hard-dependency, and it is easy to improve or remove. We can try it on gitea.com first to see whether it works well, and fine tune the details. --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix typo in documentation of GetBranchNames() (#33330)Michael Vetter2025-01-191-1/+1
|
* Fix parentCommit invalid memory address or nil pointer dereference. (#33204)hiifong2025-01-191-2/+8
| | | | | | | | | When the parent Commit does not exist on gitea, an error will be reported when opening the Commit details page: invalid memory address or nil pointer dereference. ![image](https://github.com/user-attachments/assets/4c2a9802-935f-41e9-b5b9-a4f0d745f709) ![image](https://github.com/user-attachments/assets/7b0bc15e-7f5f-4d58-8d24-fee667a799fa)
* Make tracked time representation display as hours (#33315)Vladimir Sysoev2025-01-193-65/+17
| | | | | | | | | | Estimated time represented in hours it might be convenient to have tracked time represented in the same way to be compared and managed. --------- Co-authored-by: Sysoev, Vladimir <i@vsysoev.ru> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Trivial fixes (#33304)wxiaoguang2025-01-171-4/+0
| | | | | | | 1. the error check was added for go-git, it was caused by the empty `.keep` file in the test fixtures. 2. use `PostFormValue` instead of `PostForm.Get` (`Get` needs to parse the form ahead) 3. fix incorrect container text (it should show "Images" in the header but not "OS/Arch") 4. align maven xml 5. fix closed PR color&icon
* Prepare for support performance trace (#33286)wxiaoguang2025-01-152-11/+13
| | | For #32973
* Refactor RefName (#33234)wxiaoguang2025-01-133-29/+38
| | | And fix some FIXMEs
* Refactor context RefName and RepoAssignment (#33226)wxiaoguang2025-01-133-19/+53
| | | | | | | 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 mirror bug (#33224)Lunny Xiao2025-01-121-0/+2
| | | | | Fix #33200 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor context repository (#33202)wxiaoguang2025-01-122-3/+3
|
* fix(cache): cache test triggered by non memory cache (#33220)TheFox0x72025-01-122-3/+9
| | | | | | | Change SlowCacheThreshold to 30 milliseconds so it doesn't trigger on non memory cache Closes: https://github.com/go-gitea/gitea/issues/33190 Closes: https://github.com/go-gitea/gitea/issues/32657
* Fix sync fork for consistency (#33147)Chai-Shi2025-01-101-0/+8
| | | | | | | | | Fixes #33145 An integration test could be added. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix pam auth test regression (#33169)TheFox0x72025-01-091-1/+1
| | | fixes: https://github.com/go-gitea/gitea/issues/33168
* Refactor older tests to use testify (#33140)TheFox0x72025-01-0923-197/+117
| | | | | Refactor checks to use assert/require Use require.Eventually for waiting in elastic and meilisearch tests Use require to exit early instead of assert
* Refactor HTMLFormat, update chroma render, fix js error (#33136)wxiaoguang2025-01-087-10/+25
| | | | | | A small refactor to improve HTMLFormat, to help to prevent low-level mistakes. And fix #33141, fix #33139
* add submodule diff links (#33097)Rowan Bohde2025-01-089-130/+259
| | | | | | | | | | | | This adds links to submodules in diffs, similar to the existing link when viewing a repo at a specific commit. It does this by expanding diff parsing to recognize changes to submodules, and find the specific refs that are added, deleted or changed. Related #25888 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update status check for all supported on.pull_request.types in Gitea (#33117)yp053272025-01-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | 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
* Support the new exit code for `git remote` subcommands for git version ↵yp053272025-01-071-0/+9
| | | | | | | | | >=2.30.0 (#33129) Fix #32889 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make git clone URL could use current signed-in user (#33091)wxiaoguang2025-01-075-7/+17
| | | | | | | | | | | | | | 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-063-1/+16
|
* Trivial fixes (#33103)wxiaoguang2025-01-041-11/+22
| | | | 1. remove `gock` dependency, it is not needed 2. fix a regression from org private profile readme
* Make Gitea always use its internal config, ignore `/etc/gitconfig` (#33076)wxiaoguang2025-01-023-8/+12
| | | | | | | | | | | | | | | | | | | In history, Gitea could use the system config `/etc/gitconfig` because some users said that "they might put certNonceSeed in it" Actually, we shouldn't not use it, because it also causes conflicts (there are already some fixes like #28848) To make the system clear, I think it's worth to introduce the breaking change: add `GIT_CONFIG_NOSYSTEM=1` to all git commands. ## :warning: BREAKING :warning: For most users, nothing need to do. If you have made changes to `/etc/gitconfig` to affect Gitea's behavior, you need to move these config options to Gitea's internal git config file, it is usually in Gitea's `{AppDataPath}/home/.git` directory.
* Fix "stop time tracking button" on navbar (#33084)wxiaoguang2025-01-031-1/+1
| | | | | | | | Fix #33083 By the way (something I was working on): 1. relax color/background-color for more markup elements 2. fix a command line sentence error
* Fix bleve fuzziness search (#33078)wxiaoguang2025-01-035-8/+18
| | | Close #31565
* Refactor env var related code (#33075)wxiaoguang2025-01-021-2/+16
| | | And add more comments