loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request '[gitea] week 2024-50 cherry pick (gitea/main -> forgejo)' (#6200) from earl-warren/wcp/2024-50 into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6200
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>

+142 -232
-1
.deadcode-out
··· 15 15 ErrUpdateTaskNotExist.Unwrap 16 16 IsErrSHANotFound 17 17 IsErrMergeDivergingFastForwardOnly 18 - GetYamlFixturesAccess 19 18 20 19 code.gitea.io/gitea/models/actions 21 20 ScheduleList.GetUserIDs
-80
contrib/fixtures/fixture_generation.go
··· 1 - // Copyright 2020 The Gitea Authors. All rights reserved. 2 - // SPDX-License-Identifier: MIT 3 - 4 - //nolint:forbidigo 5 - package main 6 - 7 - import ( 8 - "context" 9 - "fmt" 10 - "os" 11 - "path/filepath" 12 - 13 - "code.gitea.io/gitea/models" 14 - "code.gitea.io/gitea/models/unittest" 15 - ) 16 - 17 - // To generate derivative fixtures, execute the following from Gitea's repository base dir: 18 - // go run -tags 'sqlite sqlite_unlock_notify' contrib/fixtures/fixture_generation.go [fixture...] 19 - 20 - var ( 21 - generators = []struct { 22 - gen func(ctx context.Context) (string, error) 23 - name string 24 - }{ 25 - { 26 - models.GetYamlFixturesAccess, "access", 27 - }, 28 - } 29 - fixturesDir string 30 - ) 31 - 32 - func main() { 33 - pathToGiteaRoot := "." 34 - fixturesDir = filepath.Join(pathToGiteaRoot, "models", "fixtures") 35 - if err := unittest.CreateTestEngine(unittest.FixturesOptions{ 36 - Dir: fixturesDir, 37 - }); err != nil { 38 - fmt.Printf("CreateTestEngine: %+v", err) 39 - os.Exit(1) 40 - } 41 - if err := unittest.PrepareTestDatabase(); err != nil { 42 - fmt.Printf("PrepareTestDatabase: %+v\n", err) 43 - os.Exit(1) 44 - } 45 - ctx := context.Background() 46 - if len(os.Args) == 0 { 47 - for _, r := range os.Args { 48 - if err := generate(ctx, r); err != nil { 49 - fmt.Printf("generate '%s': %+v\n", r, err) 50 - os.Exit(1) 51 - } 52 - } 53 - } else { 54 - for _, g := range generators { 55 - if err := generate(ctx, g.name); err != nil { 56 - fmt.Printf("generate '%s': %+v\n", g.name, err) 57 - os.Exit(1) 58 - } 59 - } 60 - } 61 - } 62 - 63 - func generate(ctx context.Context, name string) error { 64 - for _, g := range generators { 65 - if g.name == name { 66 - data, err := g.gen(ctx) 67 - if err != nil { 68 - return err 69 - } 70 - path := filepath.Join(fixturesDir, name+".yml") 71 - if err := os.WriteFile(path, []byte(data), 0o644); err != nil { 72 - return fmt.Errorf("%s: %+v", path, err) 73 - } 74 - fmt.Printf("%s created.\n", path) 75 - return nil 76 - } 77 - } 78 - 79 - return fmt.Errorf("generator not found") 80 - }
-50
models/fixture_generation.go
··· 1 - // Copyright 2020 The Gitea Authors. All rights reserved. 2 - // SPDX-License-Identifier: MIT 3 - 4 - package models 5 - 6 - import ( 7 - "context" 8 - "fmt" 9 - "strings" 10 - 11 - "code.gitea.io/gitea/models/db" 12 - access_model "code.gitea.io/gitea/models/perm/access" 13 - repo_model "code.gitea.io/gitea/models/repo" 14 - ) 15 - 16 - // GetYamlFixturesAccess returns a string containing the contents 17 - // for the access table, as recalculated using repo.RecalculateAccesses() 18 - func GetYamlFixturesAccess(ctx context.Context) (string, error) { 19 - repos := make([]*repo_model.Repository, 0, 50) 20 - if err := db.GetEngine(ctx).Find(&repos); err != nil { 21 - return "", err 22 - } 23 - 24 - for _, repo := range repos { 25 - repo.MustOwner(ctx) 26 - if err := access_model.RecalculateAccesses(ctx, repo); err != nil { 27 - return "", err 28 - } 29 - } 30 - 31 - var b strings.Builder 32 - 33 - accesses := make([]*access_model.Access, 0, 200) 34 - if err := db.GetEngine(ctx).OrderBy("user_id, repo_id").Find(&accesses); err != nil { 35 - return "", err 36 - } 37 - 38 - for i, a := range accesses { 39 - fmt.Fprintf(&b, "-\n") 40 - fmt.Fprintf(&b, " id: %d\n", i+1) 41 - fmt.Fprintf(&b, " user_id: %d\n", a.UserID) 42 - fmt.Fprintf(&b, " repo_id: %d\n", a.RepoID) 43 - fmt.Fprintf(&b, " mode: %d\n", a.Mode) 44 - if i < len(accesses)-1 { 45 - fmt.Fprintf(&b, "\n") 46 - } 47 - } 48 - 49 - return b.String(), nil 50 - }
-36
models/fixture_test.go
··· 1 - // Copyright 2020 The Gitea Authors. All rights reserved. 2 - // SPDX-License-Identifier: MIT 3 - 4 - package models 5 - 6 - import ( 7 - "context" 8 - "os" 9 - "path/filepath" 10 - "testing" 11 - 12 - "code.gitea.io/gitea/models/db" 13 - "code.gitea.io/gitea/models/unittest" 14 - "code.gitea.io/gitea/modules/util" 15 - 16 - "github.com/stretchr/testify/assert" 17 - "github.com/stretchr/testify/require" 18 - ) 19 - 20 - func TestFixtureGeneration(t *testing.T) { 21 - require.NoError(t, unittest.PrepareTestDatabase()) 22 - 23 - test := func(ctx context.Context, gen func(ctx context.Context) (string, error), name string) { 24 - expected, err := gen(ctx) 25 - require.NoError(t, err) 26 - 27 - p := filepath.Join(unittest.FixturesDir(), name+".yml") 28 - bytes, err := os.ReadFile(p) 29 - require.NoError(t, err) 30 - 31 - data := string(util.NormalizeEOL(bytes)) 32 - assert.EqualValues(t, expected, data, "Differences detected for %s", p) 33 - } 34 - 35 - test(db.DefaultContext, GetYamlFixturesAccess, "access") 36 - }
+1
release-notes/6200.md
··· 1 + feat: [commit](https://codeberg.org/forgejo/forgejo/commit/0786ddc5de37a01d1c3e3bf99b794665341b3c12) Add Swift login endpoint
+36 -30
routers/api/packages/api.go
··· 637 637 }, reqPackageAccess(perm.AccessModeWrite)) 638 638 }, reqPackageAccess(perm.AccessModeRead)) 639 639 r.Group("/swift", func() { 640 - r.Group("/{scope}/{name}", func() { 641 - r.Group("", func() { 642 - r.Get("", swift.EnumeratePackageVersions) 643 - r.Get(".json", swift.EnumeratePackageVersions) 644 - }, swift.CheckAcceptMediaType(swift.AcceptJSON)) 645 - r.Group("/{version}", func() { 646 - r.Get("/Package.swift", swift.CheckAcceptMediaType(swift.AcceptSwift), swift.DownloadManifest) 647 - r.Put("", reqPackageAccess(perm.AccessModeWrite), swift.CheckAcceptMediaType(swift.AcceptJSON), enforcePackagesQuota(), swift.UploadPackageFile) 648 - r.Get("", func(ctx *context.Context) { 649 - // Can't use normal routes here: https://github.com/go-chi/chi/issues/781 640 + r.Group("", func() { // Needs to be unauthenticated. 641 + r.Post("", swift.CheckAuthenticate) 642 + r.Post("/login", swift.CheckAuthenticate) 643 + }) 644 + r.Group("", func() { 645 + r.Group("/{scope}/{name}", func() { 646 + r.Group("", func() { 647 + r.Get("", swift.EnumeratePackageVersions) 648 + r.Get(".json", swift.EnumeratePackageVersions) 649 + }, swift.CheckAcceptMediaType(swift.AcceptJSON)) 650 + r.Group("/{version}", func() { 651 + r.Get("/Package.swift", swift.CheckAcceptMediaType(swift.AcceptSwift), swift.DownloadManifest) 652 + r.Put("", reqPackageAccess(perm.AccessModeWrite), swift.CheckAcceptMediaType(swift.AcceptJSON), enforcePackagesQuota(), swift.UploadPackageFile) 653 + r.Get("", func(ctx *context.Context) { 654 + // Can't use normal routes here: https://github.com/go-chi/chi/issues/781 650 655 651 - version := ctx.Params("version") 652 - if strings.HasSuffix(version, ".zip") { 653 - swift.CheckAcceptMediaType(swift.AcceptZip)(ctx) 654 - if ctx.Written() { 655 - return 656 - } 657 - ctx.SetParams("version", version[:len(version)-4]) 658 - swift.DownloadPackageFile(ctx) 659 - } else { 660 - swift.CheckAcceptMediaType(swift.AcceptJSON)(ctx) 661 - if ctx.Written() { 662 - return 656 + version := ctx.Params("version") 657 + if strings.HasSuffix(version, ".zip") { 658 + swift.CheckAcceptMediaType(swift.AcceptZip)(ctx) 659 + if ctx.Written() { 660 + return 661 + } 662 + ctx.SetParams("version", version[:len(version)-4]) 663 + swift.DownloadPackageFile(ctx) 664 + } else { 665 + swift.CheckAcceptMediaType(swift.AcceptJSON)(ctx) 666 + if ctx.Written() { 667 + return 668 + } 669 + if strings.HasSuffix(version, ".json") { 670 + ctx.SetParams("version", version[:len(version)-5]) 671 + } 672 + swift.PackageVersionMetadata(ctx) 663 673 } 664 - if strings.HasSuffix(version, ".json") { 665 - ctx.SetParams("version", version[:len(version)-5]) 666 - } 667 - swift.PackageVersionMetadata(ctx) 668 - } 674 + }) 669 675 }) 670 676 }) 671 - }) 672 - r.Get("/identifiers", swift.CheckAcceptMediaType(swift.AcceptJSON), swift.LookupPackageIdentifiers) 673 - }, reqPackageAccess(perm.AccessModeRead)) 677 + r.Get("/identifiers", swift.CheckAcceptMediaType(swift.AcceptJSON), swift.LookupPackageIdentifiers) 678 + }, reqPackageAccess(perm.AccessModeRead)) 679 + }) 674 680 r.Group("/vagrant", func() { 675 681 r.Group("/authenticate", func() { 676 682 r.Get("", vagrant.CheckAuthenticate)
+22 -12
routers/api/packages/swift/swift.go
··· 27 27 "github.com/hashicorp/go-version" 28 28 ) 29 29 30 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#35-api-versioning 30 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#35-api-versioning 31 31 const ( 32 32 AcceptJSON = "application/vnd.swift.registry.v1+json" 33 33 AcceptSwift = "application/vnd.swift.registry.v1+swift" ··· 35 35 ) 36 36 37 37 var ( 38 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#361-package-scope 38 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#361-package-scope 39 39 scopePattern = regexp.MustCompile(`\A[a-zA-Z0-9][a-zA-Z0-9-]{0,38}\z`) 40 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#362-package-name 40 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#362-package-name 41 41 namePattern = regexp.MustCompile(`\A[a-zA-Z0-9][a-zA-Z0-9-_]{0,99}\z`) 42 42 ) 43 43 ··· 49 49 Link string 50 50 } 51 51 52 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#35-api-versioning 52 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#35-api-versioning 53 53 func setResponseHeaders(resp http.ResponseWriter, h *headers) { 54 54 if h.ContentType != "" { 55 55 resp.Header().Set("Content-Type", h.ContentType) ··· 69 69 } 70 70 } 71 71 72 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#33-error-handling 72 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#33-error-handling 73 73 func apiError(ctx *context.Context, status int, obj any) { 74 74 // https://www.rfc-editor.org/rfc/rfc7807 75 75 type Problem struct { ··· 91 91 }) 92 92 } 93 93 94 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#35-api-versioning 94 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#35-api-versioning 95 95 func CheckAcceptMediaType(requiredAcceptHeader string) func(ctx *context.Context) { 96 96 return func(ctx *context.Context) { 97 97 accept := ctx.Req.Header.Get("Accept") ··· 101 101 } 102 102 } 103 103 104 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/PackageRegistryUsage.md#registry-authentication 105 + func CheckAuthenticate(ctx *context.Context) { 106 + if ctx.Doer == nil { 107 + apiError(ctx, http.StatusUnauthorized, nil) 108 + return 109 + } 110 + 111 + ctx.Status(http.StatusOK) 112 + } 113 + 104 114 func buildPackageID(scope, name string) string { 105 115 return scope + "." + name 106 116 } ··· 113 123 Releases map[string]Release `json:"releases"` 114 124 } 115 125 116 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#41-list-package-releases 126 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#41-list-package-releases 117 127 func EnumeratePackageVersions(ctx *context.Context) { 118 128 packageScope := ctx.Params("scope") 119 129 packageName := ctx.Params("name") ··· 170 180 Metadata *swift_module.SoftwareSourceCode `json:"metadata"` 171 181 } 172 182 173 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#endpoint-2 183 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#endpoint-2 174 184 func PackageVersionMetadata(ctx *context.Context) { 175 185 id := buildPackageID(ctx.Params("scope"), ctx.Params("name")) 176 186 ··· 228 238 }) 229 239 } 230 240 231 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#43-fetch-manifest-for-a-package-release 241 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#43-fetch-manifest-for-a-package-release 232 242 func DownloadManifest(ctx *context.Context) { 233 243 packageScope := ctx.Params("scope") 234 244 packageName := ctx.Params("name") ··· 280 290 }) 281 291 } 282 292 283 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#endpoint-6 293 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#endpoint-6 284 294 func UploadPackageFile(ctx *context.Context) { 285 295 packageScope := ctx.Params("scope") 286 296 packageName := ctx.Params("name") ··· 379 389 ctx.Status(http.StatusCreated) 380 390 } 381 391 382 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#endpoint-4 392 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#endpoint-4 383 393 func DownloadPackageFile(ctx *context.Context) { 384 394 pv, err := packages_model.GetVersionByNameAndVersion(ctx, ctx.Package.Owner.ID, packages_model.TypeSwift, buildPackageID(ctx.Params("scope"), ctx.Params("name")), ctx.Params("version")) 385 395 if err != nil { ··· 420 430 Identifiers []string `json:"identifiers"` 421 431 } 422 432 423 - // https://github.com/apple/swift-package-manager/blob/main/Documentation/Registry.md#endpoint-5 433 + // https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/PackageRegistry/Registry.md#endpoint-5 424 434 func LookupPackageIdentifiers(ctx *context.Context) { 425 435 url := ctx.FormTrim("url") 426 436 if url == "" {
+16 -10
routers/web/repo/actions/view.go
··· 10 10 "context" 11 11 "errors" 12 12 "fmt" 13 + "html/template" 13 14 "io" 14 15 "net/http" 15 16 "net/url" ··· 25 26 "code.gitea.io/gitea/modules/base" 26 27 "code.gitea.io/gitea/modules/setting" 27 28 "code.gitea.io/gitea/modules/storage" 29 + "code.gitea.io/gitea/modules/templates" 28 30 "code.gitea.io/gitea/modules/timeutil" 29 31 "code.gitea.io/gitea/modules/util" 30 32 "code.gitea.io/gitea/modules/web" ··· 108 110 type ViewResponse struct { 109 111 State struct { 110 112 Run struct { 111 - Link string `json:"link"` 112 - Title string `json:"title"` 113 - Status string `json:"status"` 114 - CanCancel bool `json:"canCancel"` 115 - CanApprove bool `json:"canApprove"` // the run needs an approval and the doer has permission to approve 116 - CanRerun bool `json:"canRerun"` 117 - CanDeleteArtifact bool `json:"canDeleteArtifact"` 118 - Done bool `json:"done"` 119 - Jobs []*ViewJob `json:"jobs"` 120 - Commit ViewCommit `json:"commit"` 113 + Link string `json:"link"` 114 + Title string `json:"title"` 115 + TitleHTML template.HTML `json:"titleHTML"` 116 + Status string `json:"status"` 117 + CanCancel bool `json:"canCancel"` 118 + CanApprove bool `json:"canApprove"` // the run needs an approval and the doer has permission to approve 119 + CanRerun bool `json:"canRerun"` 120 + CanDeleteArtifact bool `json:"canDeleteArtifact"` 121 + Done bool `json:"done"` 122 + Jobs []*ViewJob `json:"jobs"` 123 + Commit ViewCommit `json:"commit"` 121 124 } `json:"run"` 122 125 CurrentJob struct { 123 126 Title string `json:"title"` ··· 194 197 195 198 resp := &ViewResponse{} 196 199 200 + metas := ctx.Repo.Repository.ComposeMetas(ctx) 201 + 197 202 resp.State.Run.Title = run.Title 203 + resp.State.Run.TitleHTML = templates.RenderCommitMessage(ctx, run.Title, metas) 198 204 resp.State.Run.Link = run.Link() 199 205 resp.State.Run.CanCancel = !run.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions) 200 206 resp.State.Run.CanApprove = run.NeedApproval && ctx.Repo.CanWrite(unit.TypeActions)
+1
routers/web/repo/projects.go
··· 363 363 return 364 364 } 365 365 366 + ctx.Data["Title"] = project.Title 366 367 ctx.Data["IsProjectsPage"] = true 367 368 ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(unit.TypeProjects) 368 369 ctx.Data["Project"] = project
+21 -10
routers/web/repo/wiki.go
··· 6 6 7 7 import ( 8 8 "bytes" 9 + gocontext "context" 9 10 "fmt" 10 11 "io" 11 12 "net/http" ··· 598 599 } 599 600 }() 600 601 601 - entries, err := commit.ListEntries() 602 + treePath := "" // To support list sub folders' pages in the future 603 + tree, err := commit.SubTree(treePath) 604 + if err != nil { 605 + ctx.ServerError("SubTree", err) 606 + return 607 + } 608 + 609 + allEntries, err := tree.ListEntries() 602 610 if err != nil { 603 611 ctx.ServerError("ListEntries", err) 604 612 return 605 613 } 614 + allEntries.CustomSort(base.NaturalSortLess) 615 + 616 + entries, _, err := allEntries.GetCommitsInfo(gocontext.Context(ctx), commit, treePath) 617 + if err != nil { 618 + ctx.ServerError("GetCommitsInfo", err) 619 + return 620 + } 621 + 606 622 pages := make([]PageMeta, 0, len(entries)) 607 623 for _, entry := range entries { 608 - if !entry.IsRegular() { 624 + if !entry.Entry.IsRegular() { 609 625 continue 610 626 } 611 - c, err := wikiRepo.GetCommitByPath(entry.Name()) 612 - if err != nil { 613 - ctx.ServerError("GetCommit", err) 614 - return 615 - } 616 - wikiName, err := wiki_service.GitPathToWebPath(entry.Name()) 627 + wikiName, err := wiki_service.GitPathToWebPath(entry.Entry.Name()) 617 628 if err != nil { 618 629 if repo_model.IsErrWikiInvalidFileName(err) { 619 630 continue ··· 625 636 pages = append(pages, PageMeta{ 626 637 Name: displayName, 627 638 SubURL: wiki_service.WebPathToURLPath(wikiName), 628 - GitEntryName: entry.Name(), 629 - UpdatedUnix: timeutil.TimeStamp(c.Author.When.Unix()), 639 + GitEntryName: entry.Entry.Name(), 640 + UpdatedUnix: timeutil.TimeStamp(entry.Commit.Author.When.Unix()), 630 641 }) 631 642 } 632 643 ctx.Data["Pages"] = pages
+18
tests/integration/api_packages_swift_test.go
··· 43 43 44 44 url := fmt.Sprintf("/api/packages/%s/swift", user.Name) 45 45 46 + t.Run("CheckLogin", func(t *testing.T) { 47 + defer tests.PrintCurrentTest(t)() 48 + 49 + req := NewRequestWithBody(t, "POST", url, strings.NewReader("")) 50 + MakeRequest(t, req, http.StatusUnauthorized) 51 + 52 + req = NewRequestWithBody(t, "POST", url, strings.NewReader("")). 53 + AddBasicAuth(user.Name) 54 + MakeRequest(t, req, http.StatusOK) 55 + 56 + req = NewRequestWithBody(t, "POST", url+"/login", strings.NewReader("")) 57 + MakeRequest(t, req, http.StatusUnauthorized) 58 + 59 + req = NewRequestWithBody(t, "POST", url+"/login", strings.NewReader("")). 60 + AddBasicAuth(user.Name) 61 + MakeRequest(t, req, http.StatusOK) 62 + }) 63 + 46 64 t.Run("CheckAcceptMediaType", func(t *testing.T) { 47 65 defer tests.PrintCurrentTest(t)() 48 66
+24
tests/integration/git_clone_wiki_test.go tests/integration/wiki_test.go
··· 6 6 import ( 7 7 "context" 8 8 "fmt" 9 + "net/http" 9 10 "net/url" 10 11 "os" 11 12 "path/filepath" 13 + "strings" 12 14 "testing" 13 15 14 16 "code.gitea.io/gitea/modules/git" 15 17 "code.gitea.io/gitea/modules/util" 18 + "code.gitea.io/gitea/tests" 16 19 20 + "github.com/PuerkitoBio/goquery" 17 21 "github.com/stretchr/testify/assert" 18 22 "github.com/stretchr/testify/require" 19 23 ) ··· 47 51 }) 48 52 }) 49 53 } 54 + 55 + func Test_RepoWikiPages(t *testing.T) { 56 + defer tests.PrepareTestEnv(t)() 57 + 58 + url := "/user2/repo1/wiki/?action=_pages" 59 + req := NewRequest(t, "GET", url) 60 + resp := MakeRequest(t, req, http.StatusOK) 61 + 62 + doc := NewHTMLParser(t, resp.Body) 63 + expectedPagePaths := []string{ 64 + "Home", "Long-Page", "Page-With-Image", "Page-With-Spaced-Name", "Unescaped-File", 65 + } 66 + doc.Find("tr").Each(func(i int, s *goquery.Selection) { 67 + firstAnchor := s.Find("a").First() 68 + href, _ := firstAnchor.Attr("href") 69 + pagePath := strings.TrimPrefix(href, "/user2/repo1/wiki/") 70 + 71 + assert.EqualValues(t, expectedPagePaths[i], pagePath) 72 + }) 73 + }
+3 -3
web_src/js/components/RepoActionView.vue
··· 42 42 run: { 43 43 link: '', 44 44 title: '', 45 + titleHTML: '', 45 46 status: '', 46 47 canCancel: false, 47 48 canApprove: false, ··· 424 425 <div class="action-info-summary"> 425 426 <div class="action-info-summary-title"> 426 427 <ActionRunStatus :locale-status="locale.status[run.status]" :status="run.status" :size="20"/> 427 - <h2 class="action-info-summary-title-text"> 428 - {{ run.title }} 429 - </h2> 428 + <!-- eslint-disable-next-line vue/no-v-html --> 429 + <h2 class="action-info-summary-title-text" v-html="run.titleHTML"/> 430 430 </div> 431 431 <button class="ui basic small compact button primary" @click="approveRun()" v-if="run.canApprove"> 432 432 {{ locale.approve }}