aboutsummaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect comment diff hunk parsing, fix github asset ID nil panic (#35046)Lunny Xiao38 hours1-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | * Fix missing the first char when parsing diff hunk header * Fix #35040 * Fix #35049 ---- Introduced in https://github.com/go-gitea/gitea/pull/12047/files#diff-de48c2f70e24ff5603180acf8b5ce9d0356ede8a45bfbf2a485707282ace6d6aR268 Before: <img width="487" height="167" alt="image" src="https://github.com/user-attachments/assets/17524c76-a296-4b4b-a4f9-c5150c41bae5" /> After: <img width="749" height="144" alt="image" src="https://github.com/user-attachments/assets/bcb12c76-c1ae-40f1-81b7-183d15f891db" /> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix updating user visibility (#35036)Lunny Xiao3 days2-0/+13
| | | | | | | Fix #35030 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix git commit committer parsing and add some tests (#35007)Lunny Xiao3 days1-3/+3
| | | | | | | | * Fix #34991 * Fix #34882 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor OpenIDConnect to support SSH/FullName sync (#34978)wxiaoguang3 days1-1/+1
| | | | | * Fix #26585 * Fix #28327 * Fix #34932
* Make submodule link work with relative path (#35034)wxiaoguang3 days2-26/+43
| | | Fix #35033
* Fix ListWorkflowRuns OpenAPI response model. (#35026)Scion3 days1-2/+2
| | | | | | | | | Change the OpenAPI response of `ListWorkflowRuns` to `WorkflowRunsList` like it is supposed to be. --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix various problems (#35012)wxiaoguang4 days1-1/+1
| | | | | * Fix #35011 * Fix incorrect log message for "Protocol" * Remove unnecessary styles, fix "comment-header" wrap, fix label height
* Refactor mail template and support preview (#34990)wxiaoguang4 days1-10/+23
|
* Improve NuGet API Parity (#21291) (#34940)Scion6 days1-0/+3
| | | | | | | | | | Fixes #21291, allowing icons and other missing attributes to appear for NuGet packages from inside Visual Studio like they do with GitHub Nuget packages. Adds additional NuGet package information, particularly `IconURL`, to bring the Gitea NuGet API more in-line with GitHub's NuGet API. ref: https://learn.microsoft.com/en-us/nuget/api/search-query-service-resource
* Enable gocritic `equalFold` and fix issues (#34952)silverwind7 days5-8/+6
| | | | | | | Continuation of https://github.com/go-gitea/gitea/pull/34678. --------- Signed-off-by: silverwind <me@silverwind.io>
* Improve OAuth2 provider (correct Issuer, respect ENABLED) (#34966)wxiaoguang7 days2-9/+0
| | | | | | | | 1. Make "Issuer" strictly follow the spec (see comment) 2. Make "/.well-known/openid-configuration" respond 404 if the OAuth2 provider is not enabled. Then by the way, remove the JSEscape template helper because it is not needed any more.
* Refactor some trivial problems (#34959)wxiaoguang8 days2-14/+32
| | | | | | | 1. make our "route group pattern match" also update chi's RoutePattern 2. fix incorrect "NotFound" call in conda package 3. make ".flex-item .flex-item-main" has a general gap, then no need to use `tw` tricks 4. improve the "test webhook" UI
* Fix http auth header parsing (#34936)wxiaoguang10 days5-35/+111
| | | Using `strings.EqualFold` is wrong in many cases.
* Support getting last commit message using contents-ext API (#34904)RickyMa10 days1-8/+11
| | | | | | | | Fix #34870 Fix #34929 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Follow file symlinks in the UI to their target (#28835)delvh13 days14-160/+146
| | | | | | | | | | Symlinks are followed when you click on a link next to an entry, either until a file has been found or until we know that the link is dead. When the link cannot be accessed, we fall back to the current behavior of showing the document containing the target. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add support for 3D/CAD file formats preview (#34794)Kerwin Bryant13 days6-81/+103
| | | | | | | Fix #34775 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add a `login`/`login-name`/`username` disambiguation to affected endpoint ↵AlexMaryW13 days6-6/+16
| | | | | | | | | | | | parameters and response/request models (#34901) Issue: [link](https://github.com/go-gitea/gitea/issues/9637) Changes introduced: I have clarified the problematic terms (`login`, `login_name`, and `username`) in all affected endpoints. The changes were made to relevant: - HTTP endpoint parameters' descriptions - response/request models' fields
* Improve `labels-list` rendering (#34846)silverwind2025-06-274-11/+52
| | | | | | | Make labels list use consistent gap --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* enforce explanation for necessary nolints and fix bugs (#34883)TheFox0x72025-06-2719-36/+34
| | | | | | | Follows up https://github.com/go-gitea/gitea/pull/34851 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* enforce nolint scope (#34851)TheFox0x72025-06-274-7/+7
| | | | | | | | | | | | | | | enable nolintlint scope requirement add comments to new directives so it's more obvious why they are in place --- I can also toggle the mandatory comments on if that's something of interest. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Use standalone function to update repository cols (#34811)Lunny Xiao2025-06-261-4/+5
| | | | | | | | Extract `UpdateRepository` Follow up #34762 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add issue delete notifier (#34592)badhezi2025-06-251-0/+2
| | | | | | Fixes https://github.com/go-gitea/gitea/issues/34591 A reference regarding the deletion of issue webhooks on GitHub: https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=deleted#issues
* Refactor "change file" API (#34855)wxiaoguang2025-06-251-36/+26
| | | | | | | | | Follow up the "editor" refactor, use the same approach to simplify code, and fix some docs & comments --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Refactor repo contents API and add "contents-ext" API (#34822)wxiaoguang2025-06-256-28/+43
| | | See the updated swagger document for details.
* Fix SSH LFS timeout (#34838)wxiaoguang2025-06-241-0/+1
| | | Fix #34834
* Refactor template helper (#34819)wxiaoguang2025-06-244-27/+7
| | | | | | | | FIx abuses and remove unused code --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Refactor packages (#34777)wxiaoguang2025-06-222-44/+74
|
* Refactor wiki (#34805)wxiaoguang2025-06-223-6/+7
| | | Remove unclear code
* Refactor editor (#34780)wxiaoguang2025-06-211-0/+2
| | | A complete rewrite
* Improve img lazy loading (#34804)wxiaoguang2025-06-213-9/+22
| | | Related #32051 and #13526
* Fix OCI manifest parser (#34797)wxiaoguang2025-06-212-10/+26
| | | Do not parse the media type we don't know.
* Add workflow_run api + webhook (#33964)ChristopherHX2025-06-204-3/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements - https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run--code-samples - https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#get-a-job-for-a-workflow-run--code-samples - https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository - https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run - `/actions/runs` for global + user + org (Gitea only) - `/actions/jobs` for global + user + org + repository (Gitea only) - workflow_run webhook + action trigger - limitations - workflow id is assigned to a string, this may result into problems in strongly typed clients Fixes - workflow_job webhook url to no longer contain the `runs/<run>` part to align with api - workflow instance does now use it's name inside the file instead of filename if set Refactoring - Moved a lot of logic from workflows/workflow_job into a shared module used by both webhook and api TODO - [x] Verify Keda Compatibility - [x] Edit Webhook API bug is resolved Closes https://github.com/go-gitea/gitea/issues/23670 Closes https://github.com/go-gitea/gitea/issues/23796 Closes https://github.com/go-gitea/gitea/issues/24898 Replaces https://github.com/go-gitea/gitea/pull/28047 and is much more complete --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add ff_only parameter to POST /repos/{owner}/{repo}/merge-upstream (#34770)Dan Čermák2025-06-191-0/+1
| | | | | | | | | The merge-upstream route was so far performing any kind of merge, even those that would create merge commits and thus make your branch diverge from upstream, requiring manual intervention via the git cli to undo the damage. With the new optional parameter ff_only, we can instruct gitea to error out, if a non-fast-forward merge would be performed.
* Upgrade `gopls` to v0.19.0, add `make fix` (#34772)silverwind2025-06-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrade to [v0.19.0](https://github.com/golang/tools/releases/tag/gopls%2Fv0.19.0) and fix issues. Runs with new `warning` serverity setting. This likely does less checks than before. Additionally, add `make fix` which runs modernize. This is also verified on CI. For the record, here are the issues discoverd when running with `info` severity, in case we want to fix these: ``` tests/integration/repo_test.go:95:5-14: could use tagged switch on i tests/integration/api_packages_generic_test.go:149:4-64: could use tagged switch on setting.Packages.Storage.Type services/webhook/msteams_test.go:33:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:59:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:85:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:111:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:138:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:161:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:187:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:213:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:239:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:266:4-33: could use tagged switch on fact.Name services/webhook/msteams_test.go:407:4-33: could use tagged switch on fact.Name tests/integration/api_packages_conan_test.go:350:6-33: could use tagged switch on pf.Name models/issues/tracked_time_test.go:98:3-18: could use tagged switch on user.ID tests/integration/api_token_test.go:505:5-43: could use tagged switch on minRequiredLevel services/gitdiff/gitdiff.go:220:33-46: method "getLineLegacy" is unused ``` --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix remaining issues after `gopls modernize` formatting (#34771)silverwind2025-06-182-15/+3
| | | | | | | | Followup https://github.com/go-gitea/gitea/pull/34751, fix all remaining marked issues. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix some package registry problems (#34759)wxiaoguang2025-06-191-2/+1
| | | | 1. Fix #33787 2. Fix container image display
* Support annotated tags when using create release API (#31840)Kemal Zebari2025-06-181-0/+1
| | | | | | | | | | This adds a new field, "tag_message", that represents the message of the annotated tag. Resolves #31835. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Run `gopls modernize` on codebase (#34751)silverwind2025-06-1877-180/+135
| | | | Recent modernize fixes: https://github.com/golang/tools/commits/master/gopls/internal/analysis/modernize
* Refactor some file edit related code (#34744)wxiaoguang2025-06-181-0/+6
| | | | | | | Follow up #34350 --------- Co-authored-by: delvh <dev.lh@web.de>
* Improve nuget/rubygems package registries (#34741)wxiaoguang2025-06-175-68/+143
| | | | | | | | 1. Add some missing (optional) fields for nuget v2, and sort the fields to make it easier to maintain 2. Add missing "platform" for rubygems: `VERSION-PLATFORM` and `VERSION_PLATFORM` Co-authored-by: Giteabot <teabot@gitea.io>
* remove unnecessary duplicate code (#34733)Lunny Xiao2025-06-171-30/+5
|
* Refactor embedded assets and drop unnecessary dependencies (#34692)wxiaoguang2025-06-1217-143/+555
| | | | | | | | | Benefits: 1. smaller binary size (reduces more than 1MB) 2. better control of the assets details 3. fewer unmaintained dependencies 4. faster startup if the assets are not needed 5. won't hang up editors when open "bindata.go" by accident
* Improve instance wide ssh commit signing (#34341)ChristopherHX2025-06-116-4/+54
| | | | | | | | | | | | | | | | | * Signed SSH commits can look in the UI like on GitHub, just like gpg keys today in Gitea * SSH format can be added in gitea config * SSH Signing worked before with DEFAULT_TRUST_MODEL=committer `TRUSTED_SSH_KEYS` can be a list of additional ssh public key contents to trust for every user of this instance Closes #34329 Related #31392 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix commit message rendering and some UI problems (#34680)wxiaoguang2025-06-103-6/+10
| | | | | | * Fix #34679 * Fix #34676 * Fix #34674 * Fix #34526
* Update x/crypto package and make builtin SSH use default parameters (#34667)wxiaoguang2025-06-093-18/+17
|
* Fix "oras" OCI client compatibility (#34666)wxiaoguang2025-06-092-1/+10
| | | | | | Fix #25846 1. the ImageConfig can be empty, fall back to default 2. the blob size can be empty, it still needs "Content-Length" header
* Fix: skip paths check on tag push events in workflows (#34602)endo0911engineer2025-06-092-0/+26
| | | | | | | | | | | | ## Summary Fix skipping of `paths` condition in workflows triggered by tag push events. ## Details - Ensure workflows triggered by tag pushes bypass the `paths` filter check. - Prevent incorrect skipping of workflows due to `paths` conditions on tag pushes. - Added and updated unit tests to verify correct behavior.
* Fix footnote jump behavior on the issue page. (#34621)charles2025-06-095-3/+43
| | | | | | | | | | Close #34511 Close #34590 Add comment ID to the footnote item's id attribute to ensure uniqueness. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Keeping consistent between UI and API about combined commit status state and ↵Lunny Xiao2025-06-094-66/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix some bugs (#34562) Extract from #34531 ## Move Commit status state to a standalone package Move the state from `structs` to `commitstatus` package. It also introduce `CommitStatusStates` so that the combine function could be used from UI and API logic. ## Combined commit status Changed This PR will follow Github's combined commit status. Before this PR, every commit status could be a combined one. According to https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#get-the-combined-status-for-a-specific-reference > Additionally, a combined state is returned. The state is one of: > failure if any of the contexts report as error or failure > pending if there are no statuses or a context is pending > success if the latest status for all contexts is success This PR will follow that rule and remove the `NoBetterThan` logic. This also fixes the inconsistent between UI and API. In the API convert package, it has implemented this which is different from the UI. It also fixed the missing `URL` and `CommitURL` in the API. ## `CalcCommitStatus` return nil if there is no commit statuses The behavior of `CalcCommitStatus` is changed. If the parameter commit statuses is empty, it will return nil. The reference places should check the returned value themselves.
* Validate hex colors when creating/editing labels (#34623)Kemal Zebari2025-06-072-5/+19
| | | | | | | | Resolves #34618. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>