Skip to content

Commit cf1c57b

Browse files
author
Earl Warren
committed
Merge pull request 'Forgejo hard fork' (go-gitea#2319) from earl-warren/forgejo:wip-forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2319
2 parents 3c31c92 + beff445 commit cf1c57b

File tree

13 files changed

+298
-43
lines changed

13 files changed

+298
-43
lines changed

.forgejo/workflows/testing.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- 'v*/forgejo*'
99

1010
jobs:
11-
lint-backend:
11+
backend-checks:
1212
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
1313
runs-on: docker
1414
container:
@@ -20,26 +20,13 @@ jobs:
2020
go-version: "1.21"
2121
check-latest: true
2222
- run: make deps-backend deps-tools
23-
- run: make lint-backend
23+
- run: make --always-make -j$(nproc) lint-backend checks-backend # ensure the "go-licenses" make target runs
2424
env:
2525
TAGS: bindata sqlite sqlite_unlock_notify
26-
checks-backend:
27-
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
28-
runs-on: docker
29-
container:
30-
image: 'docker.io/node:20-bookworm'
31-
steps:
32-
- uses: https://code.forgejo.org/actions/checkout@v3
33-
- uses: https://code.forgejo.org/actions/setup-go@v4
34-
with:
35-
go-version: "1.21"
36-
check-latest: true
37-
- run: make deps-backend deps-tools
38-
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
3926
test-unit:
4027
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
4128
runs-on: docker
42-
needs: [lint-backend, checks-backend]
29+
needs: [backend-checks]
4330
container:
4431
image: 'docker.io/node:20-bookworm'
4532
services:
@@ -80,7 +67,7 @@ jobs:
8067
test-mysql:
8168
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
8269
runs-on: docker
83-
needs: [lint-backend, checks-backend]
70+
needs: [backend-checks]
8471
container:
8572
image: 'docker.io/node:20-bookworm'
8673
services:
@@ -126,7 +113,7 @@ jobs:
126113
test-pgsql:
127114
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
128115
runs-on: docker
129-
needs: [lint-backend, checks-backend]
116+
needs: [backend-checks]
130117
container:
131118
image: 'docker.io/node:20-bookworm'
132119
services:
@@ -174,7 +161,7 @@ jobs:
174161
test-sqlite:
175162
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
176163
runs-on: docker
177-
needs: [lint-backend, checks-backend]
164+
needs: [backend-checks]
178165
container:
179166
image: 'docker.io/node:20-bookworm'
180167
steps:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "manual-testing"]
2+
path = manual-testing
3+
url = https://codeberg.org/forgejo/forgejo-manual-testing

manual-testing

Submodule manual-testing added at 877d11b

options/locale/locale_en-US.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ activate_email.text = Please click the following link to verify your email addre
448448

449449
admin.new_user.subject = New user %s just signed up
450450
admin.new_user.user_info = User Information
451-
admin.new_user.text = Please <a href="%s">click here</a> to manage the user from the admin panel.
451+
admin.new_user.text = Please <a href="%s">click here</a> to manage this user from the admin panel.
452452

453453
register_notify = Welcome to Forgejo
454454
register_notify.title = %[1]s, welcome to %[2]s
@@ -633,7 +633,7 @@ settings = User Settings
633633

634634
form.name_reserved = The username "%s" is reserved.
635635
form.name_pattern_not_allowed = The pattern "%s" is not allowed in a username.
636-
form.name_chars_not_allowed = User name "%s" contains invalid characters.
636+
form.name_chars_not_allowed = Username "%s" contains invalid characters.
637637

638638
[settings]
639639
profile = Profile
@@ -658,7 +658,7 @@ blocked_users = Blocked Users
658658
public_profile = Public Profile
659659
biography_placeholder = Tell us a little bit about yourself! (You can use Markdown)
660660
location_placeholder = Share your approximate location with others
661-
profile_desc = Control how your profile is show to other users. Your primary email address will be used for notifications, password recovery and web-based Git operations.
661+
profile_desc = Control how your profile is shown to other users. Your primary email address will be used for notifications, password recovery and web-based Git operations.
662662
password_username_disabled = Non-local users are not allowed to change their username. Please contact your site administrator for more details.
663663
full_name = Full Name
664664
website = Website
@@ -988,7 +988,7 @@ all_branches = All branches
988988
fork_no_valid_owners = This repository can not be forked because there are no valid owners.
989989
use_template = Use this template
990990
clone_in_vsc = Clone in VS Code
991-
clone_in_vscodium = Clone in VS Codium
991+
clone_in_vscodium = Clone in VSCodium
992992
download_zip = Download ZIP
993993
download_tar = Download TAR.GZ
994994
download_bundle = Download BUNDLE
@@ -1027,7 +1027,7 @@ mirror_sync = synced
10271027
mirror_sync_on_commit = Sync when commits are pushed
10281028
mirror_address = Clone From URL
10291029
mirror_address_desc = Put any required credentials in the Authorization section.
1030-
mirror_address_url_invalid = The provided URL is invalid. You must escape all components of the url correctly.
1030+
mirror_address_url_invalid = The provided URL is invalid. You must escape all components of the URL correctly.
10311031
mirror_address_protocol_invalid = The provided URL is invalid. Only http(s):// or git:// locations can be used for mirroring.
10321032
mirror_lfs = Large File Storage (LFS)
10331033
mirror_lfs_desc = Activate mirroring of LFS data.
@@ -1789,7 +1789,7 @@ pulls.required_status_check_missing = Some required checks are missing.
17891789
pulls.required_status_check_administrator = As an administrator, you may still merge this pull request.
17901790
pulls.blocked_by_approvals = "This pull request doesn't have enough approvals yet. %d of %d approvals granted."
17911791
pulls.blocked_by_rejection = "This pull request has changes requested by an official reviewer."
1792-
pulls.blocked_by_official_review_requests = "This pull request has official review requests."
1792+
pulls.blocked_by_official_review_requests = "This pull request is blocked because it is missing approval from one or more official reviewers."
17931793
pulls.blocked_by_outdated_branch = "This pull request is blocked because it's outdated."
17941794
pulls.blocked_by_changed_protected_files_1= "This pull request is blocked because it changes a protected file:"
17951795
pulls.blocked_by_changed_protected_files_n= "This pull request is blocked because it changes protected files:"

routers/api/v1/repo/repo.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,11 +1174,7 @@ func GetIssueTemplates(ctx *context.APIContext) {
11741174
// "$ref": "#/responses/IssueTemplates"
11751175
// "404":
11761176
// "$ref": "#/responses/notFound"
1177-
ret, err := issue.GetTemplatesFromDefaultBranch(ctx.Repo.Repository, ctx.Repo.GitRepo)
1178-
if err != nil {
1179-
ctx.Error(http.StatusInternalServerError, "GetTemplatesFromDefaultBranch", err)
1180-
return
1181-
}
1177+
ret, _ := issue.GetTemplatesFromDefaultBranch(ctx.Repo.Repository, ctx.Repo.GitRepo)
11821178
ctx.JSON(http.StatusOK, ret)
11831179
}
11841180

routers/web/repo/issue.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ var IssueTemplateCandidates = []string{
7777
"issue_template.md",
7878
"issue_template.yaml",
7979
"issue_template.yml",
80+
".forgejo/ISSUE_TEMPLATE.md",
81+
".forgejo/ISSUE_TEMPLATE.yaml",
82+
".forgejo/ISSUE_TEMPLATE.yml",
83+
".forgejo/issue_template.md",
84+
".forgejo/issue_template.yaml",
85+
".forgejo/issue_template.yml",
8086
".gitea/ISSUE_TEMPLATE.md",
8187
".gitea/ISSUE_TEMPLATE.yaml",
8288
".gitea/ISSUE_TEMPLATE.yml",

routers/web/repo/pull.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ var pullRequestTemplateCandidates = []string{
6565
"pull_request_template.md",
6666
"pull_request_template.yaml",
6767
"pull_request_template.yml",
68+
".forgejo/PULL_REQUEST_TEMPLATE.md",
69+
".forgejo/PULL_REQUEST_TEMPLATE.yaml",
70+
".forgejo/PULL_REQUEST_TEMPLATE.yml",
71+
".forgejo/pull_request_template.md",
72+
".forgejo/pull_request_template.yaml",
73+
".forgejo/pull_request_template.yml",
6874
".gitea/PULL_REQUEST_TEMPLATE.md",
6975
".gitea/PULL_REQUEST_TEMPLATE.yaml",
7076
".gitea/PULL_REQUEST_TEMPLATE.yml",

routers/web/repo/view.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ func findReadmeFileInEntries(ctx *context.Context, entries []*git.TreeEntry, try
9494
if entry.Name() == "docs" || docsEntries[0] == nil {
9595
docsEntries[0] = entry
9696
}
97+
case ".forgejo":
98+
if entry.Name() == ".forgejo" || docsEntries[1] == nil {
99+
docsEntries[1] = entry
100+
}
97101
case ".gitea":
98102
if entry.Name() == ".gitea" || docsEntries[1] == nil {
99103
docsEntries[1] = entry

services/issue/template.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323
var templateDirCandidates = []string{
2424
"ISSUE_TEMPLATE",
2525
"issue_template",
26+
".forgejo/ISSUE_TEMPLATE",
27+
".forgejo/issue_template",
2628
".gitea/ISSUE_TEMPLATE",
2729
".gitea/issue_template",
2830
".github/ISSUE_TEMPLATE",
@@ -32,6 +34,8 @@ var templateDirCandidates = []string{
3234
}
3335

3436
var templateConfigCandidates = []string{
37+
".forgejo/ISSUE_TEMPLATE/config",
38+
".forgejo/issue_template/config",
3539
".gitea/ISSUE_TEMPLATE/config",
3640
".gitea/issue_template/config",
3741
".github/ISSUE_TEMPLATE/config",

services/pull/merge.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,18 @@ func getMergeMessage(ctx context.Context, baseGitRepo *git.Repository, pr *issue
5555
}
5656

5757
if mergeStyle != "" {
58-
templateFilepath := fmt.Sprintf(".gitea/default_merge_message/%s_TEMPLATE.md", strings.ToUpper(string(mergeStyle)))
5958
commit, err := baseGitRepo.GetBranchCommit(pr.BaseRepo.DefaultBranch)
6059
if err != nil {
6160
return "", "", err
6261
}
63-
templateContent, err := commit.GetFileContent(templateFilepath, setting.Repository.PullRequest.DefaultMergeMessageSize)
62+
63+
templateFilepathForgejo := fmt.Sprintf(".forgejo/default_merge_message/%s_TEMPLATE.md", strings.ToUpper(string(mergeStyle)))
64+
templateFilepathGitea := fmt.Sprintf(".gitea/default_merge_message/%s_TEMPLATE.md", strings.ToUpper(string(mergeStyle)))
65+
66+
templateContent, err := commit.GetFileContent(templateFilepathForgejo, setting.Repository.PullRequest.DefaultMergeMessageSize)
67+
if _, ok := err.(git.ErrNotExist); ok {
68+
templateContent, err = commit.GetFileContent(templateFilepathGitea, setting.Repository.PullRequest.DefaultMergeMessageSize)
69+
}
6470
if err != nil {
6571
if !git.IsErrNotExist(err) {
6672
return "", "", err

0 commit comments

Comments
 (0)