]> source.dussan.org Git - gitea.git/log
gitea.git
12 months agoEnable production source maps for index.js, fix CSS sourcemaps (#27291)
silverwind [Wed, 27 Sep 2023 02:05:49 +0000 (04:05 +0200)]
Enable production source maps for index.js, fix CSS sourcemaps (#27291)

Previously, the production build never output sourcemaps. Now we emit
one file for `index.js` because it is the most likely one where we need
to be able to better debug reported issues like
https://github.com/go-gitea/gitea/issues/27213. This will currently
increase the binary size of gitea by around 700kB which is what the
gzipped source map file has.

Also, I fixed the CSS sourcemap generation which was broken since the
introduction of lightningcss.

12 months agoFix some animation bugs (#27287)
wxiaoguang [Wed, 27 Sep 2023 01:15:58 +0000 (09:15 +0800)]
Fix some animation bugs (#27287)

Fix #27286
Replace #27279

12 months agoAdd missed return to actions view fetch (#27289)
silverwind [Wed, 27 Sep 2023 00:34:52 +0000 (02:34 +0200)]
Add missed return to actions view fetch (#27289)

Should fix: #27213

12 months agoFix more yaml lint errors (#27284)
Lunny Xiao [Tue, 26 Sep 2023 16:56:42 +0000 (00:56 +0800)]
Fix more yaml lint errors (#27284)

Fix #27268

12 months agoFix incorrect change from #27231 (#27275)
delvh [Tue, 26 Sep 2023 13:10:29 +0000 (15:10 +0200)]
Fix incorrect change from #27231 (#27275)

12 months agoAdd missing IconHTML size (#27269)
wxiaoguang [Tue, 26 Sep 2023 11:59:04 +0000 (19:59 +0800)]
Add missing IconHTML size (#27269)

Fix #27223

Regression of #27122

12 months agoDocument the queue item's marshaling behavior (#27271)
wxiaoguang [Tue, 26 Sep 2023 05:58:57 +0000 (13:58 +0800)]
Document the queue item's marshaling behavior (#27271)

Close #26843

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 26 Sep 2023 00:23:08 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoAnother round of `db.DefaultContext` refactor (#27103)
JakobDev [Mon, 25 Sep 2023 13:17:37 +0000 (15:17 +0200)]
Another round of `db.DefaultContext` refactor (#27103)

Part of #27065

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
12 months agoFix more "locale" usages (#27259)
wxiaoguang [Mon, 25 Sep 2023 12:42:40 +0000 (20:42 +0800)]
Fix more "locale" usages (#27259)

12 months agoAlways use `ctx.Locale.Tr` inside templates (#27231)
delvh [Mon, 25 Sep 2023 08:56:50 +0000 (10:56 +0200)]
Always use `ctx.Locale.Tr` inside templates (#27231)

12 months agoDisable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211)
Yarden Shoham [Mon, 25 Sep 2023 07:33:00 +0000 (10:33 +0300)]
Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211)

These buttons are now disabled when the webhook is not active.

The buttons were always enabled before this change.

- Fixes #26824
- Replaces #26814

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/e783d0d8-b433-440e-b95f-50d7c42613d3)

![image](https://github.com/go-gitea/gitea/assets/20454870/b4886151-9f32-4e83-8001-dd3f20c23d70)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/74b76a72-0818-4143-8548-5d42c4119a05)

![image](https://github.com/go-gitea/gitea/assets/20454870/d5ae4e5c-c1ac-4751-a072-e6f7511b1e07)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
12 months agoAdd missing public user visibility in user details page (#27246)
yp05327 [Mon, 25 Sep 2023 06:27:03 +0000 (15:27 +0900)]
Add missing public user visibility in user details page (#27246)

It seems that `Public` user visibility is missing in the template.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/a8e7f3e0-1b77-41a0-921a-10adba90211e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/b0bffe13-0ca6-453e-95d7-0794528d5733)

12 months agoUse mask-based fade-out effect for `.new-menu` (#27181)
silverwind [Mon, 25 Sep 2023 01:03:00 +0000 (03:03 +0200)]
Use mask-based fade-out effect for `.new-menu` (#27181)

The `.new-menu` was using a pseudo-element based fade-out effect.
Replace this with a more modern mask-based effect which in this case
required a child element to avoid fading out the background as well, so
I applied it to child `new-menu-inner` which was present on all these
menus except explore where I added it.

There is no visual difference except that the items on the explore page
have no `gap` between them any longer, making it consistent with other
menus. Before and after:

<img width="221" alt="Screenshot 2023-09-21 at 21 13 19"
src="https://github.com/go-gitea/gitea/assets/115237/b4a38ce2-cee1-4c54-84a5-e1d0bfd79e29">
<img width="222" alt="Screenshot 2023-09-21 at 21 32 36"
src="https://github.com/go-gitea/gitea/assets/115237/bb6b1335-d935-4ad4-bb85-3b0fc3027c2b">

Also, this cleans up the related CSS vars:

- `--color-header-wrapper-transparent` is removed, no longer needed
- `--color-header-wrapper` is defined in base theme as well, was
previously unset and therefor transparent.

[no whitespace
diff](https://github.com/go-gitea/gitea/pull/27181/files?diff=unified&w=1)
[demo of mask fade](https://jsfiddle.net/silverwind/tsfadb3u/)

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 25 Sep 2023 00:24:48 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoFix z-index on markdown completion (#27237)
silverwind [Sun, 24 Sep 2023 23:29:36 +0000 (01:29 +0200)]
Fix z-index on markdown completion (#27237)

Fixes: https://github.com/go-gitea/gitea/issues/27230
12 months agoUpdate database-preparation and add note re: MariaDB (#27232)
techknowlogick [Sun, 24 Sep 2023 21:24:17 +0000 (17:24 -0400)]
Update database-preparation and add note re: MariaDB (#27232)

update DB docs per feedback.
https://gitea.com/gitea/gitea-docusaurus/issues/69

12 months agocleanup locale function usage (#27227)
Denys Konovalov [Sun, 24 Sep 2023 20:31:58 +0000 (22:31 +0200)]
cleanup locale function usage (#27227)

12 months agoFix EOL handling in web editor (#27141)
silverwind [Sun, 24 Sep 2023 19:51:02 +0000 (21:51 +0200)]
Fix EOL handling in web editor (#27141)

Fixes https://github.com/go-gitea/gitea/issues/27136.

This does the following for Monaco's EOL setting:

1. Use editorconfig setting if present
2. Use the file's dominant line ending as detected by monaco, which uses
LF for empty file

12 months agoFix PushEvent NullPointerException jenkinsci/github-plugin (#27203)
Nabapadma-sarker [Sun, 24 Sep 2023 19:02:47 +0000 (04:02 +0900)]
Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203)

Fixes #27202

12 months agofix issues on action runners page (#27226)
Denys Konovalov [Sun, 24 Sep 2023 18:12:21 +0000 (20:12 +0200)]
fix issues on action runners page (#27226)

- switch from some weird status badge to label
- translate untranslated `Reset registration token` string
- change documentation link from act_runner README to Gitea Docs site
- fix "No runners available" message width
- use `ctx.Locale.Tr` where possible

![grafik](https://github.com/go-gitea/gitea/assets/47871822/65547228-f9ed-4f80-9cfd-df5e55513a44)

12 months agoFix Fomantic UI dropdown icon bug when there is a search input in menu (#27225)
wxiaoguang [Sun, 24 Sep 2023 13:07:57 +0000 (21:07 +0800)]
Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225)

Fix #27224

And add the case to the devtest page.

12 months agoUpdate go-enry to 2.8.5 (#27215)
delvh [Sat, 23 Sep 2023 17:09:01 +0000 (19:09 +0200)]
Update go-enry to 2.8.5 (#27215)

Fixes #27214

12 months agoUpdate nodejs installation method in release container (#27207)
silverwind [Sat, 23 Sep 2023 13:18:47 +0000 (15:18 +0200)]
Update nodejs installation method in release container (#27207)

12 months agoQuote table `release` in sql queries (#27205)
KN4CK3R [Sat, 23 Sep 2023 12:57:39 +0000 (14:57 +0200)]
Quote table `release` in sql queries (#27205)

Fixes #27174

`release` is a reserved keyword in MySql. I can't reproduce the issue on
my setup and we have a test for that code but it seems there can be
setups where it fails.

https://github.com/go-gitea/gitea/blob/a101dbaa7952e359843c6d8303ca24a0e63c865c/tests/integration/repo_activity_test.go#L45-L46

12 months agoFix push mirror, wrong timestamp format (#27153)
Daniel Kilimnik [Sat, 23 Sep 2023 12:15:05 +0000 (14:15 +0200)]
Fix push mirror, wrong timestamp format (#27153)

I noticed, that the push mirrors endpoint, is the only endpoint which
returns the times in long format rather than as time.Time().

I think the behavior should be consistent across the project.

----

## ⚠️ BREAKING ⚠️

This PR changes the time format used in API responses for all
push_mirror endpoints which return a push mirror.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoAllow copying issue comment link on archived repos and when not logged in (#27193)
JakobDev [Sat, 23 Sep 2023 11:31:54 +0000 (13:31 +0200)]
Allow copying issue comment link on archived repos and when not logged in (#27193)

Fixes https://codeberg.org/Codeberg/Community/issues/1303

12 months agofix: text decorator on issue sidebar menu label (#27206)
metiftikci [Sat, 23 Sep 2023 10:51:23 +0000 (13:51 +0300)]
fix: text decorator on issue sidebar menu label (#27206)

fix underline for label on issue sidebar

12 months agoUpdate JS and Poetry dependencies and eslint (#27200)
silverwind [Fri, 22 Sep 2023 20:51:48 +0000 (22:51 +0200)]
Update JS and Poetry dependencies and eslint (#27200)

- Update all JS and Poetry dependencies
- Remove deprecated `eslint-plugin-custom-elements` and replace it with
rules from `eslint-plugin-wc`
- Add a convenience `make update` to update both js and py dependencies
- Tested markdown toolbar, swagger and citation

12 months agoRemove some dead code (#27196)
wxiaoguang [Fri, 22 Sep 2023 15:30:31 +0000 (23:30 +0800)]
Remove some dead code (#27196)

Some code is not in use any more, remove them.

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 22 Sep 2023 00:22:57 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoUpdates to the API for archived repos (#27149)
JakobDev [Thu, 21 Sep 2023 23:43:29 +0000 (01:43 +0200)]
Updates to the API for archived repos (#27149)

12 months agoFix release URL in webhooks (#27182)
John Olheiser [Thu, 21 Sep 2023 22:55:09 +0000 (17:55 -0500)]
Fix release URL in webhooks (#27182)

12 months agoFix dropdown icon position (#27175)
wxiaoguang [Thu, 21 Sep 2023 15:54:26 +0000 (23:54 +0800)]
Fix dropdown icon position (#27175)

According to https://fomantic-ui.com/modules/dropdown.html and our
"devtest" page, many dropdown elements has incorrect "icon" position.

This PR fixes all of them. Fix #27173

12 months agoFix repo sub menu (#27169)
wxiaoguang [Thu, 21 Sep 2023 13:16:14 +0000 (21:16 +0800)]
Fix repo sub menu (#27169)

Fix #27166

12 months agoFix review request number and add more tests (#27104)
Nanguan Lin [Thu, 21 Sep 2023 11:59:50 +0000 (19:59 +0800)]
Fix review request number and add more tests (#27104)

fix #27019
## testfixture yml
1. add issue20(a pr issue) in repo 23, org 17
2. add user15 to team 9
3. add four reviews about issue20
## test case
add two tests that are described with code comments
the code before pr #26784 failed the first test
<img width="479" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/1d9b5787-11b4-4c4d-931f-6a9869547f35">
current code failed the second test(as mentioned in #27019)
<img width="484" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/05608055-7587-43d1-bae1-92c688270819">
Any advice is appreciated.

---------

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoFix the variable regexp pattern on web page (#27161)
Nanguan Lin [Thu, 21 Sep 2023 09:03:13 +0000 (17:03 +0800)]
Fix the variable regexp pattern on web page (#27161)

same as (https://github.com/go-gitea/gitea/pull/26910)

12 months agoFix organization field being null in POST /orgs/{orgid}/teams (#27150)
Dionysios Kakouris [Thu, 21 Sep 2023 08:09:59 +0000 (10:09 +0200)]
Fix organization field being null in POST /orgs/{orgid}/teams (#27150)

Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694,
this addresses the team creation not returning the organization
information in the response.

This fix is connected to the
[issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27)
discovered in the terraform provider.
Moreover, the
[documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam)
suggests that the response body should include the `organization` field
(currently being `null`).

12 months agoAdd index to `issue_user.issue_id` (#27154)
JakobDev [Thu, 21 Sep 2023 01:30:48 +0000 (03:30 +0200)]
Add index to `issue_user.issue_id` (#27154)

This fixes a performance bottleneck. It was discovered by Codeberg.
Every where query on that table (which has grown big over time) uses
this column, but there is no index on it.

See this part of the log which was posted on Matrix:
```
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1446:ViewIssue() [W] [Slow SQL Query] UPDATE `issue_user` SET is_read=? WHERE uid=? AND issue_id=? [true x y] - 51.395434887s
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1447:ViewIssue() [E] ReadBy: Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
2023/09/10 00:52:01 ...eb/routing/logger.go:102:func1() [I] router: completed GET /Codeberg/Community/issues/1201 for [::ffff:xxx]:0, 500 Internal Server Error in 52384.2ms @ repo/issue.go:1256(repo.ViewIssue)
```

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 21 Sep 2023 00:22:27 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoStart development on Gitea 1.22 (#27155) v1.22.0-dev
delvh [Wed, 20 Sep 2023 21:18:53 +0000 (23:18 +0200)]
Start development on Gitea 1.22 (#27155)

12 months agoFix successful return value for `SyncAndGetUserSpecificDiff` (#27152) v1.21.0-rc0
delvh [Wed, 20 Sep 2023 20:28:17 +0000 (22:28 +0200)]
Fix successful return value for `SyncAndGetUserSpecificDiff` (#27152)

A function should not return an error when it is successful.
Otherwise, things like https://discord.com/channels/322538954119184384/322538954119184384/1153705341620600833 happen…

12 months agoImprove actions docs related to `pull_request` event (#27126)
Zettat123 [Wed, 20 Sep 2023 06:28:35 +0000 (14:28 +0800)]
Improve actions docs related to `pull_request` event (#27126)

Related to #27039

The `ref` property in Gitea Actions is different from GitHub Actions.
This PR improves the documentation to explain the difference.

12 months agoRemove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)
delvh [Wed, 20 Sep 2023 03:02:58 +0000 (05:02 +0200)]
Remove outdated paragraphs when comparing Gitea Actions to GitHub Actions (#27119)

No backport needed as this new state only applies to 1.21+

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months agoFix: treat tab "overview" as "repositories" in user profiles without readme (#27124)
hazy [Wed, 20 Sep 2023 01:48:44 +0000 (20:48 -0500)]
Fix: treat tab "overview" as "repositories" in user profiles without readme (#27124)

Beginning since 2af30f715e64dbb0a3900168e3768ffb36c06392, Gitea has a
500 error when visiting a user profile with `?tab=overview` in the URL
when the user doesn't have a `.profile/README.md`, because the backend
code assumes that if the tab is overview a profile repository must
exist, and checks that the repository is nil aren't done.

In this PR I treat `?tab=overview` the same as if no tab is set in the
URL, which corrects this behaviour- Now, when visiting `?tab=overview`,
if `.profile/README.md` exists on that user's profile it'll show that as
it should, otherwise it'll show the repositories tab.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoFix incorrect test code for error handling (#27139)
wxiaoguang [Wed, 20 Sep 2023 00:51:36 +0000 (08:51 +0800)]
Fix incorrect test code for error handling (#27139)

If `assert.NoError` fails, it should return. Otherwise the code could
still execute even if the error occurs.

12 months agoIncrease auth provider icon size on login page (#27122)
silverwind [Tue, 19 Sep 2023 21:47:13 +0000 (23:47 +0200)]
Increase auth provider icon size on login page (#27122)

Before, 20px:
<img width="474" alt="Screenshot 2023-09-19 at 00 10 05"
src="https://github.com/go-gitea/gitea/assets/115237/4bed4edb-219d-4844-9d3c-0d747033b09f">

After, 28px:
<img width="576" alt="Screenshot 2023-09-19 at 00 20 40"
src="https://github.com/go-gitea/gitea/assets/115237/f482ac09-38ae-4c84-80d9-0bd39b7f9772">

Dropdown in account settings is unchanged at 20px:
<img width="157" alt="Screenshot 2023-09-19 at 00 09 11"
src="https://github.com/go-gitea/gitea/assets/115237/9c998cdf-eeed-4118-9262-664faaa56092">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
12 months agofix pagination for followers and following (#27127)
Earl Warren [Tue, 19 Sep 2023 15:24:54 +0000 (17:24 +0200)]
fix pagination for followers and following (#27127)

- Use the correct total amount for pagination. Thereby correctly show
the pagination bare when there's more than one page of
followers/followings.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1477

(cherry picked from commit c1a136318be3bf72511bed108f2d67f2cf34e1b8)

Co-authored-by: Gusted <postmaster@gusted.xyz>
12 months agoservices/wiki: Close() after error handling (#27129)
Earl Warren [Tue, 19 Sep 2023 14:45:44 +0000 (16:45 +0200)]
services/wiki: Close() after error handling (#27129)

Refs: https://codeberg.org/forgejo/forgejo/pulls/1385

Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
(cherry picked from commit 589e7d346f51de4a0e2c461b220c8cad34133b2f)

Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
13 months agoUse fetch helpers instead of fetch (#27026)
silverwind [Tue, 19 Sep 2023 00:50:30 +0000 (02:50 +0200)]
Use fetch helpers instead of fetch (#27026)

WIP because:

- [x] Some calls set a `content-type` but send no body, can likely
remove the header
- [x] Need to check whether `charset=utf-8` has any significance on the
webauthn calls, I assume not as it is the default for json content.
- [x] Maybe `no-restricted-globals` is better for eslint, but will
require a lot of duplication in the yaml or moving eslint config to a
`.js` extension.
- [x] Maybe export `request` as `fetch`, shadowing the global.

13 months agoChange green buttons to primary color (#27099)
silverwind [Mon, 18 Sep 2023 22:05:31 +0000 (00:05 +0200)]
Change green buttons to primary color (#27099)

I think it's better if the primary actions have primary color instead of
green which fits better into the overall single-color UI design. This PR
currently replaces every green button with primary:

<img width="141" alt="Screenshot 2023-09-16 at 14 07 59"
src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe">
<img width="161" alt="Screenshot 2023-09-16 at 14 07 51"
src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1">

Modal actions now use uncolored/primary instead of previous green/red
colors. I also removed the box-shadow on all basic buttons:

<img width="259" alt="Screenshot 2023-09-16 at 14 16 39"
src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490">
<img width="261" alt="Screenshot 2023-09-16 at 14 17 42"
src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88">

The change currently includes the "Merge PR" button, for which we might
want to make an exception to match the icon color there:

<img width="442" alt="Screenshot 2023-09-16 at 14 33 53"
src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">

13 months agoFix wrong xorm get usage on migration (#27111)
Lunny Xiao [Mon, 18 Sep 2023 19:59:19 +0000 (03:59 +0800)]
Fix wrong xorm get usage on migration (#27111)

Fix the bug on try.gitea.io

```log
2023/09/18 01:48:41 ...ations/migrations.go:635:Migrate() [I] Migration[276]: Add RemoteAddress to mirrors
2023/09/18 01:48:41 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: migrate: migration[276]: Add RemoteAddress to mirrors failed: exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
```

Caused by #26952

---------

Co-authored-by: Jason Song <i@wolfogre.com>
13 months agoFix the incorrect route path in the user edit page. (#27007)
CaiCandong [Mon, 18 Sep 2023 12:08:09 +0000 (20:08 +0800)]
Fix the incorrect route path in the user edit page. (#27007)

Regression of #26713

After #26713 , the base path of user edit has been changed to
`/admin/users/{userid}/edit`
## Before

https://github.com/go-gitea/gitea/assets/50507092/5f4a3f64-fe2b-4499-b110-e01c9d87ea19

13 months agoRefactor lfs requests (#26783)
Chongyi Zheng [Mon, 18 Sep 2023 08:40:50 +0000 (04:40 -0400)]
Refactor lfs requests (#26783)

- Refactor lfs request code
- The original code uses `performRequest` function to create the
request, uses a callback to modify the request, and then send the
request.
- Now it's replaced with `createRequest` that only creates request and
`performRequest` that only sends the request.
- Reuse `createRequest` and `performRequest` in `http_client.go` and
`transferadapter.go`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoDisplay archived labels specially when listing labels (#26820)
puni9869 [Mon, 18 Sep 2023 04:54:05 +0000 (10:24 +0530)]
Display archived labels specially when listing labels (#26820)

Follow up https://github.com/go-gitea/gitea/pull/26741

Changes:
Added archived label for org labels and added into issue filter list.

Part of https://github.com/go-gitea/gitea/issues/25237

---------

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
13 months agoRemove a `gt-float-right` and some unnecessary helpers (#27110)
wxiaoguang [Mon, 18 Sep 2023 04:25:36 +0000 (12:25 +0800)]
Remove a `gt-float-right` and some unnecessary helpers (#27110)

Follow  Remove polluted .ui.right #26825

Remove more `gt-float-right`, remove unnecessary helpers, remove
negative margin tricks.

![image](https://github.com/go-gitea/gitea/assets/2114189/2785c6e6-7823-4699-a4f3-184eef50ceda)

13 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 18 Sep 2023 00:23:39 +0000 (00:23 +0000)]
[skip ci] Updated licenses and gitignores

13 months agoFix token endpoints ignore specified account (#27080)
CaiCandong [Mon, 18 Sep 2023 00:21:15 +0000 (08:21 +0800)]
Fix token endpoints ignore specified account (#27080)

Fix #26234
close #26323
close #27040

---------

Co-authored-by: silverwind <me@silverwind.io>
13 months agoMake SSPI auth mockable (#27036)
wxiaoguang [Sun, 17 Sep 2023 23:32:56 +0000 (07:32 +0800)]
Make SSPI auth mockable (#27036)

Before, the SSPI auth is only complied for Windows, it's difficult to
test and it breaks a lot.

Now, make the SSPI auth mockable and testable.

13 months agoSearch branches (#27055)
Lunny Xiao [Sun, 17 Sep 2023 08:24:40 +0000 (16:24 +0800)]
Search branches (#27055)

Resolve #25233

<img width="1315" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/3ba59b58-471a-4e1b-985c-87edac2268c0">

<img width="1297" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/b6caa12f-323b-4f70-9c44-ef91cb71a26c">

13 months agoFix wrong migration for email address (#27106)
Lunny Xiao [Sun, 17 Sep 2023 03:15:04 +0000 (11:15 +0800)]
Fix wrong migration for email address (#27106)

On Iterate, `sess` should not be used in the closure function body.

Caused by #26952

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 17 Sep 2023 00:24:27 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoSupport `.git-blame-ignore-revs` file (#26395)
KN4CK3R [Sat, 16 Sep 2023 17:42:34 +0000 (19:42 +0200)]
Support `.git-blame-ignore-revs` file (#26395)

Closes #26329

This PR adds the ability to ignore revisions specified in the
`.git-blame-ignore-revs` file in the root of the repository.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/9e91be0c-6e9c-431c-bbe9-5f80154251c8)

The banner is displayed in this case. I intentionally did not add a UI
way to bypass the ignore file (same behaviour as Github) but you can add
`?bypass-blame-ignore=true` to the url manually.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoAdd `RemoteAddress` to mirrors (#26952)
KN4CK3R [Sat, 16 Sep 2023 16:03:02 +0000 (18:03 +0200)]
Add `RemoteAddress` to mirrors (#26952)

This PR adds a new field `RemoteAddress` to both mirror types which
contains the sanitized remote address for easier (database) access to
that information. Will be used in the audit PR if merged.

13 months agoUpgrading the actions/checkout@4 (#27096)
puni9869 [Sat, 16 Sep 2023 15:06:27 +0000 (20:36 +0530)]
Upgrading the actions/checkout@4 (#27096)

as title
..Upgrading the actions/checkout@4

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
13 months agoNext round of `db.DefaultContext` refactor (#27089)
JakobDev [Sat, 16 Sep 2023 14:39:12 +0000 (16:39 +0200)]
Next round of `db.DefaultContext` refactor (#27089)

Part of #27065

13 months agoUi correction in mobile view nav bar left aligned items. (#27046)
puni9869 [Sat, 16 Sep 2023 14:09:25 +0000 (19:39 +0530)]
Ui correction in mobile view nav bar left aligned items. (#27046)

As title
From the long time I was looking for this UI, Now its the time to fix
it.

Before
<img width="252" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/963f2cb4-5cfd-4a14-ab85-88e25c3daef5">

<img width="502" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/58453ef1-2555-4568-95d0-5293055b33b8">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
13 months agoAdd missing deps to files-changed (#27100)
silverwind [Sat, 16 Sep 2023 13:23:06 +0000 (15:23 +0200)]
Add missing deps to files-changed (#27100)

The `docs` and `yaml` actions categories need to run when the
dependencies `markdownlin-cli` or `yamllint` change, so add those to the
list of dependencies for these actions.

Fixes: https://github.com/go-gitea/gitea/issues/27098
13 months agoUse db.WithTx for AddTeamMember to avoid ctx abuse (#27095)
wxiaoguang [Sat, 16 Sep 2023 12:54:23 +0000 (20:54 +0800)]
Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095)

Compare with ignoring spaces:
https://github.com/go-gitea/gitea/pull/27095/files?diff=split&w=1

13 months agoDrop Node.js 16 and update js dependencies (#27094)
Chongyi Zheng [Sat, 16 Sep 2023 11:36:35 +0000 (07:36 -0400)]
Drop Node.js 16 and update js dependencies (#27094)

- Drop Node.js 16 since it reached EOL
- Upgrade js dependencies
- Two packages have major version bump
  - `updates`: require node 18
- `eslint-plugin-array-func`: require `eslint` 8.40.0, which is
satisfied
- Run `make svg` for `@primer/octicons` update

13 months agoFix NPE when editing OAuth2 applications (#27078) 26212/head
JakobDev [Sat, 16 Sep 2023 09:13:26 +0000 (11:13 +0200)]
Fix NPE when editing OAuth2 applications (#27078)

Fixes #27072

It looks like there are some cases where `ContextUser` is not set here

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
13 months agoUse `print` instead of `printf` (#27093)
KN4CK3R [Sat, 16 Sep 2023 03:51:54 +0000 (05:51 +0200)]
Use `print` instead of `printf` (#27093)

A bit more performant when we only use it for appending strings.

13 months agoAdd tests for db indexer in indexer_test.go (#27087)
Nanguan Lin [Sat, 16 Sep 2023 03:15:21 +0000 (11:15 +0800)]
Add tests for db indexer in indexer_test.go (#27087)

As described in the title.
Some points:
1. Why need those tests?
Because `buildIssueOverview` is not well tested, there are several
continuous bugs in the issue overview webpage.
2. Why in indexer_test.go?
It's hard to put those tests in `./modules/indexer/issue/db/db_test.go`
because those tests need 'real' data in db mocked by fixtures instead of
random data in `./modules/indexer/issue/internal/tests`. When using
'real' data(`unittest.PrepareTestDatabase`), `InitIssueIndexer` and the
package `init()` function of `indexer` are required to init indexer.
3. Why only db?
The other three indexer engines are well tested by random data and it's
okay to also test them with 'real' data in db mocked by fixtures. Any
follow-up PR is welcome.
4. Those tests are really basic, any more complicated tests are welcome.
5. I think it's also necessary to add tests in `TestAPISearchIssues`
in`api_test_issue.go` and `TestIssues` in `home_test.go`

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 16 Sep 2023 00:21:59 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoAllow empty Conan files (#27092)
KN4CK3R [Fri, 15 Sep 2023 23:14:36 +0000 (01:14 +0200)]
Allow empty Conan files (#27092)

Fixes #27090

Looks like the Conan upload process has changed since last year. The
empty uploads don't occur anymore.

13 months agoActions are no longer experimental, so enable them by default (#27054)
Lunny Xiao [Fri, 15 Sep 2023 06:43:39 +0000 (14:43 +0800)]
Actions are no longer experimental, so enable them by default (#27054)

This PR makes the actions enabled by default, so people will find it
easier to enable actions in repository setting.

13 months agoUpdate brew installation documentation since gitea moved to brew core package (#27070)
Lunny Xiao [Fri, 15 Sep 2023 06:14:24 +0000 (14:14 +0800)]
Update brew installation documentation since gitea moved to brew core package (#27070)

ref: https://gitea.com/gitea/homebrew-gitea/pulls/178

13 months agoMore refactoring of `db.DefaultContext` (#27083)
JakobDev [Fri, 15 Sep 2023 06:13:19 +0000 (08:13 +0200)]
More refactoring of `db.DefaultContext` (#27083)

Next step of #27065

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 15 Sep 2023 00:22:32 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoReduce usage of `db.DefaultContext` (#27073)
JakobDev [Thu, 14 Sep 2023 17:09:32 +0000 (19:09 +0200)]
Reduce usage of `db.DefaultContext` (#27073)

Part of #27065

This reduces the usage of `db.DefaultContext`. I think I've got enough
files for the first PR. When this is merged, I will continue working on
this.

Considering how many files this PR affect, I hope it won't take to long
to merge, so I don't end up in the merge conflict hell.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoRemove the useless function `GetUserIssueStats` and move relevant tests to `indexer_t...
Nanguan Lin [Thu, 14 Sep 2023 16:35:53 +0000 (00:35 +0800)]
Remove the useless function `GetUserIssueStats` and move relevant tests to `indexer_test.go` (#27067)

Since the issue indexer has been refactored, the issue overview webpage
is built by the `buildIssueOverview` function and underlying
`indexer.Search` function and `GetIssueStats` instead of
`GetUserIssueStats`. So the function is no longer used.
I moved the relevant tests to `indexer_test.go` and since the search
option changed from `IssueOptions` to `SearchOptions`, most of the tests
are useless now.
We need more tests about the db indexer because those tests are highly
connected with the issue overview webpage and now this page has several
bugs.
Any advice about those test cases is appreciated.

---------

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
13 months agoFix issue templates when blank isses are disabled (#27061)
JakobDev [Thu, 14 Sep 2023 14:20:16 +0000 (16:20 +0200)]
Fix issue templates when blank isses are disabled (#27061)

Fixes #27060

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
13 months agoDisplay all user types and org types on admin management UI (#27050)
Lunny Xiao [Thu, 14 Sep 2023 06:53:36 +0000 (14:53 +0800)]
Display all user types and org types on admin management UI (#27050)

Follow #24026

<img width="1049" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/d3fc5159-b5e7-411a-b6f8-4a111a027e6b">

---------

Co-authored-by: delvh <dev.lh@web.de>
13 months agoApply lng2020 to maintainers (#27068)
Nanguan Lin [Thu, 14 Sep 2023 04:10:12 +0000 (12:10 +0800)]
Apply lng2020 to maintainers (#27068)

Hi all,

I've very much enjoyed working on Gitea and was hoping to make it
official by requesting maintainership.

My [merged PRs
list](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+sort%3Aupdated-desc+author%3Alng2020+is%3Amerged)

13 months agoFix incorrect default branch label while switching between branches (#27053)
yp05327 [Thu, 14 Sep 2023 03:54:25 +0000 (12:54 +0900)]
Fix incorrect default branch label while switching between branches (#27053)

Fix #27008

13 months agoset version in snapcraft yaml
techknowlogick [Thu, 14 Sep 2023 03:20:46 +0000 (23:20 -0400)]
set version in snapcraft yaml

13 months agoReplace 'userxx' with 'orgxx' in all test files when the user type is org (#27052)
Nanguan Lin [Thu, 14 Sep 2023 02:59:53 +0000 (10:59 +0800)]
Replace 'userxx' with 'orgxx' in all test files when the user type is org  (#27052)

Currently 'userxx' and 'orgxx' are both used as username in test files
when the user type is org, which is confusing. This PR replaces all
'userxx' with 'orgxx' when the user type is org(`user.type==1`).
Some non-trivial changes
1. Rename `user3` dir to `org3` in `tests/git-repositories-meta`
2. Change `end` in `issue reference` because 'org3' is one char shorter
than 'user3'

![ksnip_20230913-112819](https://github.com/go-gitea/gitea/assets/70063547/442988c5-4cf4-49b8-aa01-4dd6bf0ca954)
3. Change the search result number of `user/repo2` because
`user3/repo21` can't be searched now

![ksnip_20230913-112931](https://github.com/go-gitea/gitea/assets/70063547/d9ebeba4-479f-4110-9a85-825efbc981fd)
4. Change the first org name getting from API because the result is
ordered by alphabet asc and now `org 17` is before `org25`
![JW8U7NIO(J$H
_YCRB36H)T](https://github.com/go-gitea/gitea/assets/70063547/f55a685c-cf24-40e5-a87f-3a2327319548)
![)KFD411O4I8RB5ZOH7E0
Z3](https://github.com/go-gitea/gitea/assets/70063547/a0dc3299-249c-46f6-91cb-d15d4ee88dd5)

Other modifications are just find all and replace all.
Unit tests with SQLite are all passed.

---------

Co-authored-by: caicandong <1290147055@qq.com>
13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 14 Sep 2023 00:22:27 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

13 months agoLoad reviewer before sending notification (#27063)
sebastian-sauer [Wed, 13 Sep 2023 19:48:36 +0000 (21:48 +0200)]
Load reviewer before sending notification (#27063)

The
[template](https://github.com/go-gitea/gitea/blob/main/templates/mail/issue/default.tmpl#L51)
uses the Reviewer.Name property - this was not loaded.

Fixes #27035

13 months agobump all nightly builds to 16gb
techknowlogick [Wed, 13 Sep 2023 14:43:03 +0000 (10:43 -0400)]
bump all nightly builds to 16gb

13 months agoShow the repo count in code tab on both user profile and org page. (#27048)
puni9869 [Wed, 13 Sep 2023 10:47:35 +0000 (16:17 +0530)]
Show the repo count in code tab on both user profile and org page. (#27048)

as title

Screenshot before
User Profile page
<img width="1367" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/24e79689-ba2f-4c85-b591-fe5621746965">

after
<img width="1346" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/754a7ee8-c2f0-424d-9ba8-be38a48140aa">

Org page
<img width="1354" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c96178d8-664f-45c5-a162-f4df5690d9d0">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
13 months agoFix Fomantic's line-height causing vertical scrollbars to appear (#26961)
Kerwin Bryant [Wed, 13 Sep 2023 09:08:45 +0000 (17:08 +0800)]
Fix Fomantic's line-height causing vertical scrollbars to appear (#26961)

Before:

![before](https://github.com/go-gitea/gitea/assets/3371163/bc5a3b20-3490-4e14-ab1d-2fcfbc4a2e20)

After:

![after](https://github.com/go-gitea/gitea/assets/3371163/70e8be6a-11a2-46af-9e1e-78ac153cd2a4)

---

1. **Remove the scroll bar exception that in the a tag**
2. **Reduce the actual width of the a tag to the actual width of the
content**

![c363a5b5883e105a0c65d7337893b50](https://github.com/go-gitea/gitea/assets/3371163/789d9b83-ad14-46d2-8a1b-df551a063f6a)
As shown in the screenshot, the red box area should not be clickable

13 months agoDashboard context dropdown position fix on landing page in mobile view. (#27047)
puni9869 [Wed, 13 Sep 2023 07:15:36 +0000 (12:45 +0530)]
Dashboard context dropdown position fix on landing page in mobile view. (#27047)

as title.

Screensots

before

![image](https://github.com/go-gitea/gitea/assets/80308335/d72da379-1fb1-4d75-9f3e-f70e06ad4065)

after

![image](https://github.com/go-gitea/gitea/assets/80308335/110ea806-feed-4947-bf56-2985b1e1ec5f)

13 months agofix media description render for orgmode (#26895)
Earl Warren [Wed, 13 Sep 2023 05:44:59 +0000 (07:44 +0200)]
fix media description render for orgmode (#26895)

- In org mode you can specify an description for media via the following
syntax `[[description][media link]]`. The description is then used as
title or alt.
- This patch fixes the rendering of the description by seperating the
description and non-description cases and using `org.String()`.
- Added unit tests.
- Inspired by
https://github.com/niklasfasching/go-org/blob/6eb20dbda93cb88c3503f7508dc78cbbc639378f/org/html_writer.go#L406-L427
- Resolves https://codeberg.org/Codeberg/Community/issues/848

(cherry picked from commit 8b8aab83113b34bade61964e2097ed497abc39e9)

Co-authored-by: Gusted <postmaster@gusted.xyz>
13 months agoShow OpenID Connect and OAuth on signup page (#20242)
Dmitry Sharshakov [Wed, 13 Sep 2023 05:14:21 +0000 (08:14 +0300)]
Show OpenID Connect and OAuth on signup page (#20242)

Fix #19809

---------

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
Co-authored-by: jackHay22 <jack@allspice.io>
13 months agoUpdate status and code index after changing the default branch (#27018)
Nanguan Lin [Wed, 13 Sep 2023 04:43:31 +0000 (12:43 +0800)]
Update status and code index after changing the default branch (#27018)

Fix #26723
Add `ChangeDefaultBranch` to the `notifier` interface and implement it
in `indexerNotifier`. So when changing the default branch,
`indexerNotifier` sends a message to the `indexer queue` to update the
index.

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
13 months agoadd sparse url in cargo package guide (#26937)
merlleu [Wed, 13 Sep 2023 04:14:10 +0000 (06:14 +0200)]
add sparse url in cargo package guide (#26937)

Hello,

The current package guide for cargo gives you only the git index, with
the HTTP Index stabilized being used as default for crates.io and being
better for most use-cases.

However, it's not documented that gitea supports the sparse spec, and it
does not require the _crates-index git repo for the sparse api.

I personally think we should push users to use the sparse instead of the
git repository. (Even let users disable crates-index repos if they only
want to use sparse)

13 months agoAdd missing 404 response to Swagger (#27038)
JakobDev [Wed, 13 Sep 2023 02:37:54 +0000 (04:37 +0200)]
Add missing 404 response to Swagger (#27038)

Most middleware throw a 404 in case something is not found e.g. a Repo
that is not existing. But most API endpoints don't include the 404
response in their documentation. This PR changes this.

13 months agoFix object storage path handling (#27024)
wxiaoguang [Wed, 13 Sep 2023 01:18:52 +0000 (09:18 +0800)]
Fix object storage path handling (#27024)

Object storage path rules:

* No single `/` or `.`, use empty string for root path
* Need to use trailing `/` for a list prefix to distinguish a "dir/"

13 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 13 Sep 2023 00:22:36 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin