1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-10-10 19:32:02 +00:00

Merge remote-tracking branch 'origin/forgejo' into fix-context-timeout

This commit is contained in:
Michael Jerger 2025-07-24 08:07:18 +02:00
commit 7421bbe01d
3 changed files with 62 additions and 21 deletions

View file

@ -49,7 +49,7 @@ jobs:
LOG_LEVEL: debug LOG_LEVEL: debug
RENOVATE_BASE_DIR: ${{ github.workspace }}/.tmp RENOVATE_BASE_DIR: ${{ github.workspace }}/.tmp
RENOVATE_ENDPOINT: ${{ github.server_url }} RENOVATE_ENDPOINT: ${{ github.server_url }}
RENOVATE_PLATFORM: gitea RENOVATE_PLATFORM: forgejo
RENOVATE_REPOSITORY_CACHE: 'enabled' RENOVATE_REPOSITORY_CACHE: 'enabled'
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
RENOVATE_GIT_AUTHOR: 'Renovate Bot <forgejo-renovate-action@forgejo.org>' RENOVATE_GIT_AUTHOR: 'Renovate Bot <forgejo-renovate-action@forgejo.org>'

View file

@ -721,18 +721,18 @@
<li> <li>
<span class="badge tw-bg-green tw-text-white">{{svg "octicon-dot-fill"}}</span> <span class="badge tw-bg-green tw-text-white">{{svg "octicon-dot-fill"}}</span>
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
{{ctx.Locale.Tr "repo.pulls.reopened_at" "" ""}} {{ctx.Locale.Tr "repo.pulls.reopened_at" ""}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.reopened_at" "" ""}} {{ctx.Locale.Tr "repo.issues.reopened_at" ""}}
{{end}} {{end}}
</li> </li>
{{else if and (not .Aggregator.PrevClosed) .Aggregator.IsClosed}} {{else if and (not .Aggregator.PrevClosed) .Aggregator.IsClosed}}
<span class="badge tw-bg-red tw-text-white">{{svg "octicon-circle-slash"}}</span> <span class="badge tw-bg-red tw-text-white">{{svg "octicon-circle-slash"}}</span>
<li> <li>
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
{{ctx.Locale.Tr "repo.pulls.closed_at" "" ""}} {{ctx.Locale.Tr "repo.pulls.closed_at" ""}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.closed_at" "" ""}} {{ctx.Locale.Tr "repo.issues.closed_at" ""}}
{{end}} {{end}}
</li> </li>
{{end}} {{end}}

View file

@ -1141,26 +1141,67 @@ func TestRebaseWhenNecessary(t *testing.T) {
onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) {
session := loginUser(t, "user1") session := loginUser(t, "user1")
testRepoFork(t, session, "user2", "repo1", "user1", "repo1") testRepoFork(t, session, "user2", "repo1", "user1", "repo1")
testEditFile(t, session, "user1", "repo1", "master", "README.md", "Hello, World (Edited)\n")
resp := testPullCreate(t, session, "user1", "repo1", false, "master", "master", "This is a pull title") t.Run("No rebase needed", func(t *testing.T) {
pullLink := test.RedirectURL(resp) defer tests.PrintCurrentTest(t)()
resp = session.MakeRequest(t, NewRequest(t, "GET", test.RedirectURL(resp)+"/commits"), http.StatusOK) testEditFile(t, session, "user1", "repo1", "master", "README.md", "Hello, World (Edited)\n")
htmlDoc := NewHTMLParser(t, resp.Body)
commitLinkBefore, ok := htmlDoc.Find("a.sha").Attr("href")
assert.True(t, ok)
commitBefore := commitLinkBefore[strings.LastIndexByte(commitLinkBefore, '/'):]
elem := strings.Split(pullLink, "/") resp := testPullCreate(t, session, "user1", "repo1", false, "master", "master", "This is a pull title")
testPullMerge(t, session, elem[1], elem[2], elem[4], repo_model.MergeStyleRebase, false) pullLink := test.RedirectURL(resp)
resp = session.MakeRequest(t, NewRequest(t, "GET", "/user2/repo1"), http.StatusOK) resp = session.MakeRequest(t, NewRequest(t, "GET", test.RedirectURL(resp)+"/commits"), http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
commitLinkAfter, ok := htmlDoc.Find(".latest-commit a.sha").Attr("href") commitLinkBefore, ok := htmlDoc.Find("a.sha").Attr("href")
assert.True(t, ok) assert.True(t, ok)
commitAfter := commitLinkAfter[strings.LastIndexByte(commitLinkAfter, '/'):] commitBefore := commitLinkBefore[strings.LastIndexByte(commitLinkBefore, '/'):]
assert.Equal(t, commitBefore, commitAfter) elem := strings.Split(pullLink, "/")
testPullMerge(t, session, elem[1], elem[2], elem[4], repo_model.MergeStyleRebase, false)
resp = session.MakeRequest(t, NewRequest(t, "GET", "/user2/repo1"), http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
commitLinkAfter, ok := htmlDoc.Find(".latest-commit a.sha").Attr("href")
assert.True(t, ok)
commitAfter := commitLinkAfter[strings.LastIndexByte(commitLinkAfter, '/'):]
assert.Equal(t, commitBefore, commitAfter)
})
t.Run("Rebase needed", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
// Make user2/repo1 ahead of user1/repo1
testEditFile(t, session, "user2", "repo1", "master", "README.md", "Hello, World (Edited 2x)\n")
// To avoid conflicts, create a new file on /user/repo1.
session.MakeRequest(t, NewRequestWithValues(t, "POST", "/user1/repo1/_new/master", map[string]string{
"_csrf": GetCSRF(t, session, "/user/settings"),
"commit_choice": "direct",
"tree_path": "test-file.md",
"content": "newly-added-test-file",
"commit_mail_id": "-1",
}), http.StatusSeeOther)
resp := testPullCreate(t, session, "user1", "repo1", false, "master", "master", "This is another pull")
pullLink := test.RedirectURL(resp)
resp = session.MakeRequest(t, NewRequest(t, "GET", test.RedirectURL(resp)+"/commits"), http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
commitLinkBefore, ok := htmlDoc.Find("a.sha").Attr("href")
assert.True(t, ok)
commitBefore := commitLinkBefore[strings.LastIndexByte(commitLinkBefore, '/'):]
elem := strings.Split(pullLink, "/")
testPullMerge(t, session, elem[1], elem[2], elem[4], repo_model.MergeStyleRebase, false)
resp = session.MakeRequest(t, NewRequest(t, "GET", "/user2/repo1"), http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
commitLinkAfter, ok := htmlDoc.Find(".latest-commit a.sha").Attr("href")
assert.True(t, ok)
commitAfter := commitLinkAfter[strings.LastIndexByte(commitLinkAfter, '/'):]
assert.NotEqual(t, commitBefore, commitAfter)
})
}) })
} }