Commit Graph

18826 Commits

Author SHA1 Message Date
Lunny Xiao
54b22555ea Merge branch 'main' into lunny/add_last_commit_when 2024-12-23 22:54:45 -08:00
Lunny Xiao
5f34fac3b7
Fix test 2024-12-23 22:54:38 -08:00
Lunny Xiao
b8b690feb9
Refactor getpatch/getdiff functions and remove unnecessary fallback (#32817)
Extract from #32786 

`git diff a..b` is equal to `git diff a b` which is different from `git
diff a...b`. For pull request, we should always 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-24 14:29:34 +08:00
wxiaoguang
6d5aa9218e
Refactor request context (#32956)
Introduce RequestContext: is a short-lived context that is used to store
request-specific data.

RequestContext could be used to clean form tmp files, close context git
repo, and do some tracing in the future.

Then a lot of legacy code could be removed or improved. For example:
most `ctx.Repo.GitRepo.Close()` could be removed because the git repo
could be closed when the request is done.
2024-12-24 11:43:57 +08:00
wxiaoguang
781c6df40f
Add sub issue list support (#32940)
Just like GitHub, show issue icon/title when the issue number is in a list
2024-12-24 01:54:19 +00:00
GiteaBot
02c64e48b7 [skip ci] Updated translations via Crowdin 2024-12-24 00:31:53 +00:00
wxiaoguang
7553ae1a57
Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946)
Fix #23703

When Gitea starts, it reads GITEA_RUNNER_REGISTRATION_TOKEN
or GITEA_RUNNER_REGISTRATION_TOKEN_FILE to add registration token.
2024-12-23 09:59:16 +00:00
wxiaoguang
bd5d1341d4
Fix commit range paging (#32944) 2024-12-23 07:07:12 +00:00
wxiaoguang
89f31f79fd
Fix outdated tmpl code (#32953)
Some PRs were before tmpl ctx refactoring and used outdated code
2024-12-23 11:21:11 +08:00
wxiaoguang
462ce31530
Fix repo avatar conflict (#32958)
Continue even if the avatar deleting fails
2024-12-23 02:52:25 +00:00
GiteaBot
b5f9a2d7c0 [skip ci] Updated licenses and gitignores 2024-12-23 00:32:58 +00:00
katsu
fb75151fb1
fix trailing comma not matched in the case of alphanumeric issue (#32945)
Fix #32428.

Patch the regex to match `,`besides `.` `"` `'` `:` and space.
2024-12-22 21:32:28 +00:00
bytedream
6279646ee4
Add auto-expanding running actions step (#30058)
Auto-expands the currently running action step.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-22 18:57:17 +00:00
Illya Marchenko
daf2776db7
Fix #32954 (#32955)
`/bin/s6-svscan` is actuall located at `/usr/bin/s6-svscan`
2024-12-23 02:31:53 +08:00
techknowlogick
a09ea2f483
Use Alpine 3.21 for the docker images (#32924) 2024-12-22 15:44:50 +00:00
wxiaoguang
a163c53a60
Refactor template & test related code (#32938)
Move some legacy code from "base" package to proper packages.
2024-12-22 15:33:19 +00:00
wxiaoguang
afe314fa77
Use primary as button color (#32949)
* Fix #32871
* Fix #32948
2024-12-22 23:03:39 +08:00
GiteaBot
35c86af164 [skip ci] Updated translations via Crowdin 2024-12-22 00:35:14 +00:00
bytedream
5d6d62493b
Add action auto-scroll (#30057)
Adds an auto-scroll/follow feature to running actions (fix #25186, fix
#28535).

When new log lines are appended and the bottom of the logs container
(`.action-view-right`) is visible at this time, the page automatically
scrolls down to the bottom of the logs.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-21 14:49:26 -08:00
wxiaoguang
143946834a
Fix locale (#32937)
Fix #32936
2024-12-21 19:24:43 +00:00
silverwind
c0e80dbe26
Enable Typescript strictFunctionTypes (#32911)
1. Enable
[strictFunctionTypes](https://www.typescriptlang.org/tsconfig/#strictFunctionTypes)
2. Introduce `DOMEvent` helper type which sets `e.target`. Surely not
totally correct with that `Partial` but seems to work.
3. Various type-related refactors, change objects in
`eventsource.sharedworker.ts` to `Map`.
2024-12-22 02:59:25 +08:00
wxiaoguang
09a0041965
Fix areYouSure confirm (#32941)
See the comment
2024-12-21 12:11:22 -05:00
Aindriú Mac Giolla Eoin
23687a0a71
Update i18n.go - Language Picker (#32933) 2024-12-21 04:56:08 +00:00
Lunny Xiao
751fe8b714
Move some errors to their own sub packages (#32880) 2024-12-20 18:05:29 +00:00
wxiaoguang
4774151e53
Improve navbar: add "admin" tip, add "active" style (#32927)
By the way, remove all "tw-" patches and unused styles.
2024-12-20 16:38:56 +00:00
wxiaoguang
1c9b022c4d
Refactor db package and remove unnecessary DumpTables (#32930) 2024-12-20 16:11:38 +00:00
Tim
7580bd98c1
show warning on navigation if currently editing comment or title (#32920)
This PR fixes the issue https://github.com/go-gitea/gitea/issues/32223

Make the browser to show the confirm popup, as it does with other forms.

---------

Co-authored-by: Tim Wundenberg <tim@wundenbergs.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-20 23:39:19 +08:00
wxiaoguang
52b319bc00
Refactor pprof labels and process desc (#32909)
* Deprecate "gopid" in log, it is not useful and requires very hacky
approach
* Remove "git.Command.SetDescription" because it is not useful and only
makes the logs too flexible
2024-12-20 12:17:14 +08:00
Lunny Xiao
ae4a882223
Fix test 2024-12-19 16:32:24 -08:00
GiteaBot
c66de245c4 [skip ci] Updated translations via Crowdin 2024-12-20 00:31:51 +00:00
Lunny Xiao
abe1cf3ff7
Add test 2024-12-19 16:04:05 -08:00
Lunny Xiao
6f5bc5923e
Add last commit when for contents API 2024-12-19 15:53:34 -08:00
silverwind
f47fb4fbaf
Update JS dependencies (#32914)
Result of `make update-js`. Tested Monaco and Math.
2024-12-19 20:05:16 +00:00
silverwind
626b27bea5
Update go tool dependencies (#32916)
Update all go tool dependencies to latest version. WIP because I think
there are new gopls errors, would like to confirm them on CI first. Here
is from a local run:

```
modules/markup/markdown/goldmark.go:115:37-53: unnecessary type arguments
modules/markup/html.go:45:32-49: unnecessary type arguments
modules/markup/internal/renderinternal.go:20:33-49: unnecessary type arguments
modules/markup/common/linkify.go:27:32-49: unnecessary type arguments
modules/util/time_str.go:28:39-63: unnecessary type arguments
routers/web/repo/pull.go:704:19: impossible condition: non-nil == nil
modules/util/util_test.go:248:14-23: unused parameter: other
```

~~Backport because the `gxz` update might have security benefits.~~
2024-12-19 19:17:55 +01:00
Exploding Dragon
581e52b3e7
Relax the version checking for Arch packages (#32908)
It is mentioned in https://man.archlinux.org/man/PKGBUILD.5: 'The
variable is not allowed to contain colons, forward slashes, hyphens, or
whitespace.'

`_` is also an allowed character, and some software in the Arch Linux
AUR uses this naming convention.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-19 09:41:23 +00:00
silverwind
141d782c1a
Refactor repo-projects.ts (#32892)
- Remove jQuery
- Add types to all functions
- Tested all modified functionality

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-12-19 08:37:12 +00:00
Lunny Xiao
dc8f59baa5
Add more load functions to make sure the reference object loaded (#32901)
Fix #32897
2024-12-19 14:10:08 +08:00
GiteaBot
5ec8df02f6 [skip ci] Updated translations via Crowdin 2024-12-19 00:33:27 +00:00
techknowlogick
420cda18e6
bump x/net (#32896) 2024-12-18 22:40:04 +00:00
silverwind
857abed3a9
Move RepoBranchTagSelector init outside the SFC (#32890)
SFCs shouldn't export anything besides their component, and this
eliminates one issue with tsc, while apparently also solving a hack. It
seems to work as before, also when multiples are on the same page.
2024-12-18 21:26:17 +01:00
Exploding Dragon
2beaedc417
Fix Arch package metadata introduced incorrect field (#32881)
Incorrect content was introduced while generating the index, which has
now been removed, and the missing fields have been added.

![](https://github.com/user-attachments/assets/4fbb8884-337e-43b1-939f-a5ba687f7ffd)
2024-12-18 15:25:05 +08:00
Lunny Xiao
f9f62b4c4c
Move delete deploy keys into service layer (#32201) 2024-12-18 04:10:38 +00:00
Lunny Xiao
e4c4629465
Move RepoTransfer from models to models/repo sub package (#32506)
`RepoTransfer` now is at models, but if we want to move it into `repo`
model, it will depend on `Team`. So this PR also makes repo model depend
on org model to make it possible. Just refactor, no code change.

- [x] Move `DeleteOrganization` from `models/organization` to service
layer
- [x] Move `AccessibleTeamReposEnv` to `models/repo`
- [x] Move `RepoTransfer` from `models` to `models/repo`
- [x] Merge `getUserTeamIDs` and `GetUserTeamIDs`, Merge `GetUserTeams`
and `getUserTeams`.
- [x] Remove `Team`'s `Repos []*repo_model.Repository` to avoid dependency recycle.
2024-12-18 11:44:16 +08:00
TheFox0x7
b945742293
Change pprof labels to be prometheus compatible (#32865)
Enables scrapping pprof endpoint for continuous profiling

Closes: https://github.com/go-gitea/gitea/issues/32854
2024-12-18 11:08:04 +08:00
silverwind
195fccd617
Move eslint config to javascript (#32869)
In preparation for migrating to eslint flat config, move the config file
to javascript. Additional changes:

- `no-undef` is now disabled as it's no longer needed with typescript
- `no-restricted-globals` config is simplified
2024-12-18 00:51:11 +00:00
GiteaBot
e6186bc447 [skip ci] Updated translations via Crowdin 2024-12-18 00:33:18 +00:00
wxiaoguang
2d7e6e9482
Fix various trivial problems (#32861)
1. add/improve comments to help future readers could understand the
problem more easily.
2. add an error log to LDAP with username fallback
3. use `or` instead of `Iif` for "repo/branch_dropdown" (`Iif` was a
mistake, but it doesn't really affect the UI)
4. add `tw-font-mono` style to container digest to match dockerhub
5. fix a bug in RepoBranchTagSelector: the form is not updated when
there is no click to an item

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-12-17 01:15:18 +00:00
GiteaBot
9f9bff0f04 [skip ci] Updated translations via Crowdin 2024-12-17 00:45:49 +00:00
wxiaoguang
22c4599542
Improve Actions status aggregations (#32860)
Make the result the same as GitHub:

* all skipped, then result is skipped
* any cancelled, then result cancelled
2024-12-16 21:49:53 +08:00
wxiaoguang
d28a4843b8
Fix incomplete Actions status aggregations (#32859)
fix #32857
2024-12-16 11:18:00 +08:00