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:
commit
7421bbe01d
3 changed files with 62 additions and 21 deletions
|
@ -49,7 +49,7 @@ jobs:
|
|||
LOG_LEVEL: debug
|
||||
RENOVATE_BASE_DIR: ${{ github.workspace }}/.tmp
|
||||
RENOVATE_ENDPOINT: ${{ github.server_url }}
|
||||
RENOVATE_PLATFORM: gitea
|
||||
RENOVATE_PLATFORM: forgejo
|
||||
RENOVATE_REPOSITORY_CACHE: 'enabled'
|
||||
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
||||
RENOVATE_GIT_AUTHOR: 'Renovate Bot <forgejo-renovate-action@forgejo.org>'
|
||||
|
|
|
@ -721,18 +721,18 @@
|
|||
<li>
|
||||
<span class="badge tw-bg-green tw-text-white">{{svg "octicon-dot-fill"}}</span>
|
||||
{{if .Issue.IsPull}}
|
||||
{{ctx.Locale.Tr "repo.pulls.reopened_at" "" ""}}
|
||||
{{ctx.Locale.Tr "repo.pulls.reopened_at" ""}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.issues.reopened_at" "" ""}}
|
||||
{{ctx.Locale.Tr "repo.issues.reopened_at" ""}}
|
||||
{{end}}
|
||||
</li>
|
||||
{{else if and (not .Aggregator.PrevClosed) .Aggregator.IsClosed}}
|
||||
<span class="badge tw-bg-red tw-text-white">{{svg "octicon-circle-slash"}}</span>
|
||||
<li>
|
||||
{{if .Issue.IsPull}}
|
||||
{{ctx.Locale.Tr "repo.pulls.closed_at" "" ""}}
|
||||
{{ctx.Locale.Tr "repo.pulls.closed_at" ""}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "repo.issues.closed_at" "" ""}}
|
||||
{{ctx.Locale.Tr "repo.issues.closed_at" ""}}
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
|
|
|
@ -1141,26 +1141,67 @@ func TestRebaseWhenNecessary(t *testing.T) {
|
|||
onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) {
|
||||
session := loginUser(t, "user1")
|
||||
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")
|
||||
pullLink := test.RedirectURL(resp)
|
||||
t.Run("No rebase needed", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
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, '/'):]
|
||||
testEditFile(t, session, "user1", "repo1", "master", "README.md", "Hello, World (Edited)\n")
|
||||
|
||||
elem := strings.Split(pullLink, "/")
|
||||
testPullMerge(t, session, elem[1], elem[2], elem[4], repo_model.MergeStyleRebase, false)
|
||||
resp := testPullCreate(t, session, "user1", "repo1", false, "master", "master", "This is a pull title")
|
||||
pullLink := test.RedirectURL(resp)
|
||||
|
||||
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, '/'):]
|
||||
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, '/'):]
|
||||
|
||||
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)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue