Skip to content

Commit 649d058

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Improve the list header in milestone page (go-gitea#27302) Fix poster is not loaded in get default merge message (go-gitea#27657) Hide archived labels by default from the suggestions when assigning labels for an issue (go-gitea#27451) actions/setup-go use go-version-file (go-gitea#27651) Update agit-support.en-us.md (go-gitea#27652)
2 parents ac6db5e + 8abc1aa commit 649d058

23 files changed

+331
-294
lines changed

.github/workflows/cron-licenses.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-go@v4
1515
with:
16-
go-version: "~1.21"
16+
go-version-file: go.mod
1717
check-latest: true
1818
- run: make generate-license generate-gitignore
1919
timeout-minutes: 40

.github/workflows/pull-compliance.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- uses: actions/setup-go@v4
2121
with:
22-
go-version: "~1.21"
22+
go-version-file: go.mod
2323
check-latest: true
2424
- run: make deps-backend deps-tools
2525
- run: make lint-backend
@@ -72,7 +72,7 @@ jobs:
7272
- uses: actions/checkout@v4
7373
- uses: actions/setup-go@v4
7474
with:
75-
go-version: "~1.21"
75+
go-version-file: go.mod
7676
check-latest: true
7777
- run: make deps-backend deps-tools
7878
- run: make lint-go-windows lint-go-vet
@@ -89,7 +89,7 @@ jobs:
8989
- uses: actions/checkout@v4
9090
- uses: actions/setup-go@v4
9191
with:
92-
go-version: "~1.21"
92+
go-version-file: go.mod
9393
check-latest: true
9494
- run: make deps-backend deps-tools
9595
- run: make lint-go
@@ -104,7 +104,7 @@ jobs:
104104
- uses: actions/checkout@v4
105105
- uses: actions/setup-go@v4
106106
with:
107-
go-version: "~1.21"
107+
go-version-file: go.mod
108108
check-latest: true
109109
- run: make deps-backend deps-tools
110110
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
@@ -132,7 +132,7 @@ jobs:
132132
- uses: actions/checkout@v4
133133
- uses: actions/setup-go@v4
134134
with:
135-
go-version: "~1.21"
135+
go-version-file: go.mod
136136
check-latest: true
137137
# no frontend build here as backend should be able to build
138138
# even without any frontend files
@@ -176,4 +176,7 @@ jobs:
176176
steps:
177177
- uses: actions/checkout@v4
178178
- uses: actions/setup-go@v4
179+
with:
180+
go-version-file: go.mod
181+
check-latest: true
179182
- run: make lint-actions

.github/workflows/pull-db-tests.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v4
4242
- uses: actions/setup-go@v4
4343
with:
44-
go-version: "~1.21"
44+
go-version-file: go.mod
4545
check-latest: true
4646
- name: Add hosts to /etc/hosts
4747
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
@@ -66,7 +66,7 @@ jobs:
6666
- uses: actions/checkout@v4
6767
- uses: actions/setup-go@v4
6868
with:
69-
go-version: "~1.21"
69+
go-version-file: go.mod
7070
check-latest: true
7171
- run: make deps-backend
7272
- run: make backend
@@ -117,7 +117,7 @@ jobs:
117117
- uses: actions/checkout@v4
118118
- uses: actions/setup-go@v4
119119
with:
120-
go-version: "~1.21"
120+
go-version-file: go.mod
121121
check-latest: true
122122
- name: Add hosts to /etc/hosts
123123
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
@@ -167,7 +167,7 @@ jobs:
167167
- uses: actions/checkout@v4
168168
- uses: actions/setup-go@v4
169169
with:
170-
go-version: "~1.21"
170+
go-version-file: go.mod
171171
check-latest: true
172172
- name: Add hosts to /etc/hosts
173173
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
@@ -200,7 +200,7 @@ jobs:
200200
- uses: actions/checkout@v4
201201
- uses: actions/setup-go@v4
202202
with:
203-
go-version: "~1.21"
203+
go-version-file: go.mod
204204
check-latest: true
205205
- name: Add hosts to /etc/hosts
206206
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'

.github/workflows/pull-e2e-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- uses: actions/setup-go@v4
2121
with:
22-
go-version: "~1.21"
22+
go-version-file: go.mod
2323
check-latest: true
2424
- uses: actions/setup-node@v3
2525
with:

.github/workflows/release-nightly.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- run: git fetch --unshallow --quiet --tags --force
2121
- uses: actions/setup-go@v4
2222
with:
23-
go-version: "~1.21"
23+
go-version-file: go.mod
2424
check-latest: true
2525
- uses: actions/setup-node@v3
2626
with:
@@ -66,7 +66,7 @@ jobs:
6666
- run: git fetch --unshallow --quiet --tags --force
6767
- uses: actions/setup-go@v4
6868
with:
69-
go-version: "~1.21"
69+
go-version-file: go.mod
7070
check-latest: true
7171
- uses: docker/setup-qemu-action@v2
7272
- uses: docker/setup-buildx-action@v2
@@ -103,7 +103,7 @@ jobs:
103103
- run: git fetch --unshallow --quiet --tags --force
104104
- uses: actions/setup-go@v4
105105
with:
106-
go-version: "~1.21"
106+
go-version-file: go.mod
107107
check-latest: true
108108
- uses: docker/setup-qemu-action@v2
109109
- uses: docker/setup-buildx-action@v2

.github/workflows/release-tag-rc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- run: git fetch --unshallow --quiet --tags --force
2020
- uses: actions/setup-go@v4
2121
with:
22-
go-version: "~1.21"
22+
go-version-file: go.mod
2323
check-latest: true
2424
- uses: actions/setup-node@v3
2525
with:

.github/workflows/release-tag-version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- run: git fetch --unshallow --quiet --tags --force
2222
- uses: actions/setup-go@v4
2323
with:
24-
go-version: "~1.21"
24+
go-version-file: go.mod
2525
check-latest: true
2626
- uses: actions/setup-node@v3
2727
with:

docs/content/usage/agit-support.en-us.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ menu:
1818
# Agit Setup
1919

2020
In Gitea `1.13`, support for [agit](https://git-repo.info/en/2020/03/agit-flow-and-git-repo/) was added.
21+
**Note**: git version 2.29 or higher is required on the server side for this to work.
2122

2223
## Creating PRs with Agit
2324

@@ -32,14 +33,16 @@ git push origin HEAD:refs/for/main
3233
The command has the following structure:
3334

3435
- `HEAD`: The target branch
35-
- `refs/<for|draft|for-review>/<branch>`: The target PR type
36+
- `origin`: The target repository (not a fork!)
37+
- `HEAD`: The local branch containing the changes you are proposing
38+
- `refs/<for|draft|for-review>/<branch>`: The target PR type and configuration
3639
- `for`: Create a normal PR with `<branch>` as the target branch
37-
- `draft`/ `for-review`: Currently ignored silently
38-
- `<branch>/<session>`: The target branch to open the PR
40+
- `draft`/`for-review`: Currently ignored silently
41+
- `<branch>/`: The branch you want your changes to be merged into
3942
- `-o <topic|title|description>`: Options for the PR
40-
- `title`: The PR title
41-
- `topic`: The branch name the PR should be opened for
42-
- `description`: The PR description
43+
- `topic`: The topic of this change. It will become the name of the branch holding the changes waiting for review. This is REQUIRED to trigger a pull request.
44+
- `title`: The PR title (optional but recommended), only used for topics not already having an associated PR.
45+
- `description`: The PR description (optional but recommended), only used for topics not already having an associated PR.
4346
- `force-push`: confirm force update the target branch
4447

4548
Here's another advanced example for creating a new PR targeting `main` with `topic`, `title`, and `description`:

routers/web/repo/issue.go

+13-4
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
246246
isShowClosed = true
247247
}
248248

249+
archived := ctx.FormBool("archived")
250+
249251
page := ctx.FormInt("page")
250252
if page <= 1 {
251253
page = 1
@@ -417,6 +419,15 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
417419
ctx.Data["PinnedIssues"] = pinned
418420
ctx.Data["IsRepoAdmin"] = ctx.IsSigned && (ctx.Repo.IsAdmin() || ctx.Doer.IsAdmin)
419421
ctx.Data["IssueStats"] = issueStats
422+
ctx.Data["OpenCount"] = issueStats.OpenCount
423+
ctx.Data["ClosedCount"] = issueStats.ClosedCount
424+
linkStr := "%s?q=%s&type=%s&sort=%s&state=%s&labels=%s&milestone=%d&project=%d&assignee=%d&poster=%d&archived=%t"
425+
ctx.Data["OpenLink"] = fmt.Sprintf(linkStr, ctx.Link,
426+
url.QueryEscape(keyword), url.QueryEscape(viewType), url.QueryEscape(sortType), "open", url.QueryEscape(selectLabels),
427+
mentionedID, projectID, assigneeID, posterID, archived)
428+
ctx.Data["ClosedLink"] = fmt.Sprintf(linkStr, ctx.Link,
429+
url.QueryEscape(keyword), url.QueryEscape(viewType), url.QueryEscape(sortType), "closed", url.QueryEscape(selectLabels),
430+
mentionedID, projectID, assigneeID, posterID, archived)
420431
ctx.Data["SelLabelIDs"] = labelIDs
421432
ctx.Data["SelectLabels"] = selectLabels
422433
ctx.Data["ViewType"] = viewType
@@ -432,6 +443,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
432443
} else {
433444
ctx.Data["State"] = "open"
434445
}
446+
ctx.Data["ShowArchivedLabels"] = archived
435447

436448
pager.AddParam(ctx, "q", "Keyword")
437449
pager.AddParam(ctx, "type", "ViewType")
@@ -442,11 +454,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
442454
pager.AddParam(ctx, "project", "ProjectID")
443455
pager.AddParam(ctx, "assignee", "AssigneeID")
444456
pager.AddParam(ctx, "poster", "PosterID")
457+
pager.AddParam(ctx, "archived", "ShowArchivedLabels")
445458

446-
if ctx.FormBool("archived") {
447-
ctx.Data["ShowArchivedLabels"] = true
448-
pager.AddParam(ctx, "archived", "ShowArchivedLabels")
449-
}
450459
ctx.Data["Page"] = pager
451460
}
452461

routers/web/repo/milestone.go

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package repo
55

66
import (
7+
"fmt"
78
"net/http"
89
"net/url"
910
"time"
@@ -72,6 +73,11 @@ func Milestones(ctx *context.Context) {
7273
}
7374
ctx.Data["OpenCount"] = stats.OpenCount
7475
ctx.Data["ClosedCount"] = stats.ClosedCount
76+
linkStr := "%s/milestones?state=%s&q=%s&sort=%s"
77+
ctx.Data["OpenLink"] = fmt.Sprintf(linkStr, ctx.Repo.RepoLink, "open",
78+
url.QueryEscape(keyword), url.QueryEscape(sortType))
79+
ctx.Data["ClosedLink"] = fmt.Sprintf(linkStr, ctx.Repo.RepoLink, "closed",
80+
url.QueryEscape(keyword), url.QueryEscape(sortType))
7581

7682
if ctx.Repo.Repository.IsTimetrackerEnabled(ctx) {
7783
if err := miles.LoadTotalTrackedTimes(ctx); err != nil {

services/pull/merge.go

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ func getMergeMessage(ctx context.Context, baseGitRepo *git.Repository, pr *issue
4444
if err := pr.LoadIssue(ctx); err != nil {
4545
return "", "", err
4646
}
47+
if err := pr.Issue.LoadPoster(ctx); err != nil {
48+
return "", "", err
49+
}
4750

4851
isExternalTracker := pr.BaseRepo.UnitEnabled(ctx, unit.TypeExternalTracker)
4952
issueReference := "#"

templates/repo/issue/filter_actions.tmpl

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@
2929
<div class="divider"></div>
3030
{{end}}
3131
{{$previousExclusiveScope = $exclusiveScope}}
32-
<div class="item issue-action gt-df gt-items-start" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
32+
<div class="item issue-action gt-df gt-sb" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
3333
{{if SliceUtils.Contains $.SelLabelIDs .ID}}{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}{{end}} {{RenderLabel $.Context .}}
34-
{{if .IsArchived}}
35-
<i data-tooltip-content={{ctx.Locale.Tr "archived"}}>{{svg "octicon-info"}}</i>
36-
{{end}}
34+
{{template "repo/issue/labels/label_archived" .}}
3735
</div>
3836
{{end}}
3937
</div>

0 commit comments

Comments
 (0)