Skip to content

Commit 764a683

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Add fix incorrect can_create_org_repo for org owner team (go-gitea#26683) [skip ci] Updated translations via Crowdin Improve modal dialog UI (go-gitea#26764) Improve the "bug report" template and "support options" document (go-gitea#26753) Unify `border-radius` behavior (go-gitea#26770) Reduce some allocations in type conversion (go-gitea#26772) Refactor some CSS styles and simplify code (go-gitea#26771) Add auth-required to config.json for Cargo http registry (go-gitea#26729) refactor(API): refactor secret creation and update functionality (go-gitea#26751)
2 parents bc79ffa + 60ca3d0 commit 764a683

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+493
-331
lines changed

.github/ISSUE_TEMPLATE/bug-report.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug Report
22
description: Found something you weren't expecting? Report it here!
3-
labels: kind/bug
3+
labels: ["kind/bug"]
44
body:
55
- type: markdown
66
attributes:
@@ -15,11 +15,8 @@ body:
1515
3. Make sure you are using the latest release and
1616
take a moment to check that your issue hasn't been reported before.
1717
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
18-
5. Please give all relevant information below for bug reports, because
18+
5. It's really important to provide pertinent details and logs (https://docs.gitea.com/help/support),
1919
incomplete details will be handled as an invalid report.
20-
6. In particular it's really important to provide pertinent logs. You must give us DEBUG level logs.
21-
Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help
22-
In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini
2320
- type: textarea
2421
id: description
2522
attributes:
@@ -89,6 +86,6 @@ body:
8986
description: What database system are you running?
9087
options:
9188
- PostgreSQL
92-
- MySQL
89+
- MySQL/MariaDB
9390
- MSSQL
9491
- SQLite

docs/content/help/support.en-us.md

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,57 @@ menu:
2222
- [Discourse Forum](https://discourse.gitea.io/)
2323
- [Matrix](https://matrix.to/#/#gitea-space:matrix.org)
2424
- NOTE: Most of the Matrix channels are bridged with their counterpart in Discord and may experience some degree of flakiness with the bridge process.
25+
- Chinese Support
26+
- [Discourse Chinese Category](https://discourse.gitea.io/c/5-category/5)
27+
- QQ Group 328432459
28+
29+
# Bug Report
30+
31+
If you found a bug, please [create an issue on GitHub](https://github.com/go-gitea/gitea/issues).
2532

2633
**NOTE:** When asking for support, it may be a good idea to have the following available so that the person helping has all the info they need:
2734

2835
1. Your `app.ini` (with any sensitive data scrubbed as necessary).
29-
2. The Gitea logs, and any other appropriate log files for the situation.
30-
- When using systemd, use `journalctl --lines 1000 --unit gitea` to collect logs.
31-
- When using docker, use `docker logs --tail 1000 <gitea-container>` to collect logs.
32-
- By default, the logs are outputted to console. If you need to collect logs from files,
33-
you could copy the following config into your `app.ini` (remove all other `[log]` sections),
34-
then you can find the `*.log` files in Gitea's log directory (default: `%(GITEA_WORK_DIR)/log`).
35-
36-
```ini
37-
; To show all SQL logs, you can also set LOG_SQL=true in the [database] section
38-
[log]
39-
LEVEL=debug
40-
MODE=console,file
41-
```
42-
43-
3. Any error messages you are seeing.
44-
4. When possible, try to replicate the issue on [try.gitea.io](https://try.gitea.io) and include steps so that others can reproduce the issue.
45-
- This will greatly improve the chance that the root of the issue can be quickly discovered and resolved.
46-
5. If you encounter slow/hanging/deadlock problems, please report the stack trace when the problem occurs.
36+
2. Any error messages you are seeing.
37+
3. The Gitea logs, and all other related logs for the situation.
38+
- It's more useful to collect `trace` / `debug` level logs (see the next section).
39+
- When using systemd, use `journalctl --lines 1000 --unit gitea` to collect logs.
40+
- When using docker, use `docker logs --tail 1000 <gitea-container>` to collect logs.
41+
4. Reproducible steps so that others could reproduce and understand the problem more quickly and easily.
42+
- [try.gitea.io](https://try.gitea.io) could be used to reproduce the problem.
43+
5. If you encounter slow/hanging/deadlock problems, please report the stacktrace when the problem occurs.
4744
Go to the "Site Admin" -> "Monitoring" -> "Stacktrace" -> "Download diagnosis report".
4845

49-
## Bugs
46+
# Advanced Bug Report Tips
47+
48+
## More Config Options for Logs
49+
50+
By default, the logs are outputted to console with `info` level.
51+
If you need to set log level and/or collect logs from files,
52+
you could just copy the following config into your `app.ini` (remove all other `[log]` sections),
53+
then you will find the `*.log` files in Gitea's log directory (default: `%(GITEA_WORK_DIR)/log`).
54+
55+
```ini
56+
; To show all SQL logs, you can also set LOG_SQL=true in the [database] section
57+
[log]
58+
LEVEL=debug
59+
MODE=console,file
60+
```
5061

51-
If you found a bug, please create an [issue on GitHub](https://github.com/go-gitea/gitea/issues).
62+
## Collecting Stacktrace by Command Line
63+
64+
Gitea could use Golang's pprof handler and toolchain to collect stacktrace and other runtime information.
65+
66+
If the web UI stops working, you could try to collect the stacktrace by command line:
67+
68+
1. Set `app.ini`:
69+
70+
```
71+
[server]
72+
ENABLE_PPROF = true
73+
```
5274
53-
## Chinese Support
75+
2. Restart Gitea
5476
55-
Support for the Chinese language is provided at [Our discourse](https://discourse.gitea.io/c/5-category/5) or QQ Group 328432459.
77+
3. Try to trigger the bug, when the requests get stuck for a while,
78+
use `curl` or browser to visit: `http://127.0.0.1:6060/debug/pprof/goroutine?debug=1` to get the stacktrace.

modules/doctor/fix8312.go

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright 2023 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package doctor
5+
6+
import (
7+
"context"
8+
9+
"code.gitea.io/gitea/models"
10+
"code.gitea.io/gitea/models/db"
11+
org_model "code.gitea.io/gitea/models/organization"
12+
"code.gitea.io/gitea/models/perm"
13+
"code.gitea.io/gitea/modules/log"
14+
15+
"xorm.io/builder"
16+
)
17+
18+
func fixOwnerTeamCreateOrgRepo(ctx context.Context, logger log.Logger, autofix bool) error {
19+
count := 0
20+
21+
err := db.Iterate(
22+
ctx,
23+
builder.Eq{"authorize": perm.AccessModeOwner, "can_create_org_repo": false},
24+
func(ctx context.Context, team *org_model.Team) error {
25+
team.CanCreateOrgRepo = true
26+
count++
27+
28+
if !autofix {
29+
return nil
30+
}
31+
32+
return models.UpdateTeam(team, false, false)
33+
},
34+
)
35+
if err != nil {
36+
logger.Critical("Unable to iterate across repounits to fix incorrect can_create_org_repo: Error %v", err)
37+
return err
38+
}
39+
40+
if !autofix {
41+
if count == 0 {
42+
logger.Info("Found no team with incorrect can_create_org_repo")
43+
} else {
44+
logger.Warn("Found %d teams with incorrect can_create_org_repo", count)
45+
}
46+
return nil
47+
}
48+
logger.Info("Fixed %d teams with incorrect can_create_org_repo", count)
49+
50+
return nil
51+
}
52+
53+
func init() {
54+
Register(&Check{
55+
Title: "Check for incorrect can_create_org_repo for org owner teams",
56+
Name: "fix-owner-team-create-org-repo",
57+
IsDefault: false,
58+
Run: fixOwnerTeamCreateOrgRepo,
59+
Priority: 7,
60+
})
61+
}

modules/log/event_writer_base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (b *EventWriterBaseImpl) Run(ctx context.Context) {
9090

9191
if exprRegexp != nil {
9292
fileLineCaller := fmt.Sprintf("%s:%d:%s", event.Origin.Filename, event.Origin.Line, event.Origin.Caller)
93-
matched := exprRegexp.Match([]byte(fileLineCaller)) || exprRegexp.Match([]byte(event.Origin.MsgSimpleText))
93+
matched := exprRegexp.MatchString(fileLineCaller) || exprRegexp.MatchString(event.Origin.MsgSimpleText)
9494
if !matched {
9595
continue
9696
}

modules/structs/secret.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,9 @@ type Secret struct {
1414
Created time.Time `json:"created_at"`
1515
}
1616

17-
// CreateSecretOption options when creating secret
17+
// CreateOrUpdateSecretOption options when creating or updating secret
1818
// swagger:model
19-
type CreateSecretOption struct {
20-
// Name of the secret to create
21-
//
22-
// required: true
23-
// unique: true
24-
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
25-
// Data of the secret to create
26-
Data string `json:"data" binding:"Required"`
27-
}
28-
29-
// UpdateSecretOption options when updating secret
30-
// swagger:model
31-
type UpdateSecretOption struct {
19+
type CreateOrUpdateSecretOption struct {
3220
// Data of the secret to update
3321
//
3422
// required: true

0 commit comments

Comments
 (0)