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 'feat: upgrade F3 to v3.7.0' (#5004) from earl-warren/forgejo:wip-f3 into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5004
Reviewed-by: Otto <otto@codeberg.org>

+50 -56
-5
assets/go-licenses.json
··· 1020 1020 "licenseText": "Copyright 2009 The Go Authors.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google LLC nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" 1021 1021 }, 1022 1022 { 1023 - "name": "golang.org/x/exp", 1024 - "path": "golang.org/x/exp/LICENSE", 1025 - "licenseText": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" 1026 - }, 1027 - { 1028 1023 "name": "golang.org/x/image", 1029 1024 "path": "golang.org/x/image/LICENSE", 1030 1025 "licenseText": "Copyright (c) 2009 The Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
+2 -2
go.mod
··· 3 3 go 1.22.5 4 4 5 5 require ( 6 - code.forgejo.org/f3/gof3/v3 v3.4.0 6 + code.forgejo.org/f3/gof3/v3 v3.7.0 7 7 code.forgejo.org/forgejo/reply v1.0.2 8 8 code.gitea.io/actions-proto-go v0.4.0 9 9 code.gitea.io/gitea-vet v0.2.3 ··· 95 95 github.com/ulikunitz/xz v0.5.12 96 96 github.com/urfave/cli/v2 v2.27.2 97 97 github.com/valyala/fastjson v1.6.4 98 - github.com/xanzy/go-gitlab v0.96.0 98 + github.com/xanzy/go-gitlab v0.106.0 99 99 github.com/yohcop/openid-go v1.0.1 100 100 github.com/yuin/goldmark v1.7.4 101 101 github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
+4 -4
go.sum
··· 1 1 cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= 2 2 cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= 3 - code.forgejo.org/f3/gof3/v3 v3.4.0 h1:60LOo47tAKvr9nVu2qqNjbgRnCKeKx68mRMRBo/hIuA= 4 - code.forgejo.org/f3/gof3/v3 v3.4.0/go.mod h1:9v7foN46KlEr5gywOSQPn1k5BVpPeuBozsLKlgOQ3YM= 3 + code.forgejo.org/f3/gof3/v3 v3.7.0 h1:ZfuCP8CGm8ZJbWmL+V0pUu3E0X4FCAA7GfRDy/y5/K4= 4 + code.forgejo.org/f3/gof3/v3 v3.7.0/go.mod h1:oNhOeqD4DZYjVcNjQXIOdDX9b/1tqxi9ITLS8H9/Csw= 5 5 code.forgejo.org/forgejo/archiver/v3 v3.5.1 h1:UmmbA7D5550uf71SQjarmrn6yKwOGxtEjb3jaYYtmSE= 6 6 code.forgejo.org/forgejo/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= 7 7 code.forgejo.org/forgejo/reply v1.0.2 h1:dMhQCHV6/O3L5CLWNTol+dNzDAuyCK88z4J/lCdgFuQ= ··· 719 719 github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= 720 720 github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= 721 721 github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= 722 - github.com/xanzy/go-gitlab v0.96.0 h1:LGkZ+wSNMRtHIBaYE4Hq3dZVjprwHv3Y1+rhKU3WETs= 723 - github.com/xanzy/go-gitlab v0.96.0/go.mod h1:ETg8tcj4OhrB84UEgeE8dSuV/0h4BBL1uOV/qK0vlyI= 722 + github.com/xanzy/go-gitlab v0.106.0 h1:EDfD03K74cIlQo2EducfiupVrip+Oj02bq9ofw5F8sA= 723 + github.com/xanzy/go-gitlab v0.106.0/go.mod h1:ETg8tcj4OhrB84UEgeE8dSuV/0h4BBL1uOV/qK0vlyI= 724 724 github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= 725 725 github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= 726 726 github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
+2 -2
services/f3/driver/asset.go
··· 87 87 node := o.GetNode() 88 88 o.Trace("%s", node.GetID()) 89 89 90 - id := f3_util.ParseInt(string(node.GetID())) 90 + id := node.GetID().Int64() 91 91 92 92 asset, err := repo_model.GetAttachmentByID(ctx, id) 93 93 if repo_model.IsErrAttachmentNotExist(err) { ··· 154 154 } 155 155 156 156 o.Trace("asset created %d", o.forgejoAsset.ID) 157 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoAsset.ID)) 157 + return generic.NewNodeID(o.forgejoAsset.ID) 158 158 } 159 159 160 160 func (o *asset) Delete(ctx context.Context) {
+2 -2
services/f3/driver/comment.go
··· 72 72 node := o.GetNode() 73 73 o.Trace("%s", node.GetID()) 74 74 75 - id := f3_util.ParseInt(string(node.GetID())) 75 + id := node.GetID().Int64() 76 76 77 77 comment, err := issues_model.GetCommentByID(ctx, id) 78 78 if issues_model.IsErrCommentNotExist(err) { ··· 105 105 panic(err) 106 106 } 107 107 o.Trace("comment created %d", o.forgejoComment.ID) 108 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoComment.ID)) 108 + return generic.NewNodeID(o.forgejoComment.ID) 109 109 } 110 110 111 111 func (o *comment) Delete(ctx context.Context) {
+1 -1
services/f3/driver/container.go
··· 39 39 } 40 40 41 41 func (o *container) upsert(context.Context) generic.NodeID { 42 - return generic.NodeID(o.getKind()) 42 + return generic.NewNodeID(o.getKind()) 43 43 }
+1 -1
services/f3/driver/forge.go
··· 50 50 51 51 func (o *forge) Equals(context.Context, generic.NodeInterface) bool { return true } 52 52 func (o *forge) Get(context.Context) bool { return true } 53 - func (o *forge) Put(context.Context) generic.NodeID { return generic.NodeID("forge") } 53 + func (o *forge) Put(context.Context) generic.NodeID { return generic.NewNodeID("forge") } 54 54 func (o *forge) Patch(context.Context) {} 55 55 func (o *forge) Delete(context.Context) {} 56 56 func (o *forge) NewFormat() f3.Interface { return &f3.Forge{} }
+5 -5
services/f3/driver/issue.go
··· 96 96 }, 97 97 Content: issue.Content, 98 98 Milestone: milestone, 99 - IsClosed: issue.State == "closed", 99 + IsClosed: issue.State == f3.IssueStateClosed, 100 100 CreatedUnix: timeutil.TimeStamp(issue.Created.Unix()), 101 101 UpdatedUnix: timeutil.TimeStamp(issue.Updated.Unix()), 102 102 IsLocked: issue.IsLocked, ··· 124 124 o.Trace("%s", node.GetID()) 125 125 126 126 project := f3_tree.GetProjectID(o.GetNode()) 127 - id := f3_util.ParseInt(string(node.GetID())) 127 + id := node.GetID().Int64() 128 128 129 129 issue, err := issues_model.GetIssueByIndex(ctx, project, id) 130 130 if issues_model.IsErrIssueNotExist(err) { ··· 144 144 func (o *issue) Patch(ctx context.Context) { 145 145 node := o.GetNode() 146 146 project := f3_tree.GetProjectID(o.GetNode()) 147 - id := f3_util.ParseInt(string(node.GetID())) 147 + id := node.GetID().Int64() 148 148 o.Trace("repo_id = %d, index = %d", project, id) 149 - if _, err := db.GetEngine(ctx).Where("`repo_id` = ? AND `index` = ?", project, id).Cols("name", "content").Update(o.forgejoIssue); err != nil { 149 + if _, err := db.GetEngine(ctx).Where("`repo_id` = ? AND `index` = ?", project, id).Cols("name", "content", "is_closed").Update(o.forgejoIssue); err != nil { 150 150 panic(fmt.Errorf("%v %v", o.forgejoIssue, err)) 151 151 } 152 152 } ··· 207 207 } 208 208 209 209 o.Trace("issue created %d/%d", o.forgejoIssue.ID, o.forgejoIssue.Index) 210 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoIssue.Index)) 210 + return generic.NewNodeID(o.forgejoIssue.Index) 211 211 } 212 212 213 213 func (o *issue) Delete(ctx context.Context) {
+3 -3
services/f3/driver/label.go
··· 65 65 o.Trace("%s", node.GetID()) 66 66 67 67 project := f3_tree.GetProjectID(o.GetNode()) 68 - id := f3_util.ParseInt(string(node.GetID())) 68 + id := node.GetID().Int64() 69 69 70 70 label, err := issues_model.GetLabelInRepoByID(ctx, project, id) 71 71 if issues_model.IsErrRepoLabelNotExist(err) { ··· 80 80 81 81 func (o *label) Patch(ctx context.Context) { 82 82 o.Trace("%d", o.forgejoLabel.ID) 83 - if _, err := db.GetEngine(ctx).ID(o.forgejoLabel.ID).Cols("name", "description").Update(o.forgejoLabel); err != nil { 83 + if _, err := db.GetEngine(ctx).ID(o.forgejoLabel.ID).Cols("name", "description", "color").Update(o.forgejoLabel); err != nil { 84 84 panic(fmt.Errorf("UpdateLabelCols: %v %v", o.forgejoLabel, err)) 85 85 } 86 86 } ··· 94 94 panic(err) 95 95 } 96 96 o.Trace("label created %d", o.forgejoLabel.ID) 97 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoLabel.ID)) 97 + return generic.NewNodeID(o.forgejoLabel.ID) 98 98 } 99 99 100 100 func (o *label) Delete(ctx context.Context) {
+3 -3
services/f3/driver/milestone.go
··· 89 89 ID: f3_util.ParseInt(milestone.GetID()), 90 90 Name: milestone.Title, 91 91 Content: milestone.Description, 92 - IsClosed: milestone.State == "closed", 92 + IsClosed: milestone.State == f3.MilestoneStateClosed, 93 93 CreatedUnix: timeutil.TimeStamp(milestone.Created.Unix()), 94 94 UpdatedUnix: timeutil.TimeStamp(milestone.Updated.Unix()), 95 95 ClosedDateUnix: closed, ··· 102 102 o.Trace("%s", node.GetID()) 103 103 104 104 project := f3_tree.GetProjectID(o.GetNode()) 105 - id := f3_util.ParseInt(string(node.GetID())) 105 + id := node.GetID().Int64() 106 106 107 107 milestone, err := issues_model.GetMilestoneByRepoID(ctx, project, id) 108 108 if issues_model.IsErrMilestoneNotExist(err) { ··· 131 131 panic(err) 132 132 } 133 133 o.Trace("milestone created %d", o.forgejoMilestone.ID) 134 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoMilestone.ID)) 134 + return generic.NewNodeID(o.forgejoMilestone.ID) 135 135 } 136 136 137 137 func (o *milestone) Delete(ctx context.Context) {
+2 -2
services/f3/driver/organization.go
··· 62 62 func (o *organization) Get(ctx context.Context) bool { 63 63 node := o.GetNode() 64 64 o.Trace("%s", node.GetID()) 65 - id := f3_util.ParseInt(string(node.GetID())) 65 + id := node.GetID().Int64() 66 66 organization, err := org_model.GetOrgByID(ctx, id) 67 67 if user_model.IsErrUserNotExist(err) { 68 68 return false ··· 94 94 panic(err) 95 95 } 96 96 97 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoOrganization.ID)) 97 + return generic.NewNodeID(o.forgejoOrganization.ID) 98 98 } 99 99 100 100 func (o *organization) Delete(ctx context.Context) {
+1 -1
services/f3/driver/organizations.go
··· 42 42 panic(fmt.Errorf("GetOrganizationByName: %v", err)) 43 43 } 44 44 45 - return generic.NodeID(fmt.Sprintf("%d", organization.ID)) 45 + return generic.NewNodeID(organization.ID) 46 46 } 47 47 48 48 func newOrganizations() generic.NodeDriverInterface {
+2 -2
services/f3/driver/project.go
··· 96 96 func (o *project) Get(ctx context.Context) bool { 97 97 node := o.GetNode() 98 98 o.Trace("%s", node.GetID()) 99 - id := f3_util.ParseInt(string(node.GetID())) 99 + id := node.GetID().Int64() 100 100 u, err := repo_model.GetRepositoryByID(ctx, id) 101 101 if repo_model.IsErrRepoNotExist(err) { 102 102 return false ··· 166 166 o.forgejoProject = repo 167 167 o.Trace("project created %d", o.forgejoProject.ID) 168 168 } 169 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoProject.ID)) 169 + return generic.NewNodeID(o.forgejoProject.ID) 170 170 } 171 171 172 172 func (o *project) Delete(ctx context.Context) {
+2 -3
services/f3/driver/projects.go
··· 13 13 14 14 f3_tree "code.forgejo.org/f3/gof3/v3/tree/f3" 15 15 "code.forgejo.org/f3/gof3/v3/tree/generic" 16 - f3_util "code.forgejo.org/f3/gof3/v3/util" 17 16 ) 18 17 19 18 type projects struct { ··· 31 30 panic(fmt.Errorf("error GetRepositoryByOwnerAndName(%s, %s): %v", owner, name, err)) 32 31 } 33 32 34 - return generic.NodeID(fmt.Sprintf("%d", forgejoProject.ID)) 33 + return generic.NewNodeID(forgejoProject.ID) 35 34 } 36 35 37 36 func (o *projects) ListPage(ctx context.Context, page int) generic.ChildrenSlice { ··· 41 40 42 41 forgejoProjects, _, err := repo_model.SearchRepository(ctx, &repo_model.SearchRepoOptions{ 43 42 ListOptions: db.ListOptions{Page: page, PageSize: pageSize}, 44 - OwnerID: f3_util.ParseInt(string(owner.GetID())), 43 + OwnerID: owner.GetID().Int64(), 45 44 Private: true, 46 45 }) 47 46 if err != nil {
+5 -5
services/f3/driver/pullrequest.go
··· 51 51 if repository == nil { 52 52 panic("unexpected nil repository") 53 53 } 54 - forge := o.getTree().GetRoot().GetChild(f3_tree.KindForge).GetDriver().(*forge) 54 + forge := o.getTree().GetRoot().GetChild(generic.NewNodeID(f3_tree.KindForge)).GetDriver().(*forge) 55 55 owners := forge.getOwnersPath(ctx, fmt.Sprintf("%d", repository.OwnerID)) 56 56 return f3_tree.NewRepositoryReference(owners.String(), repository.OwnerID, repository.ID) 57 57 } ··· 172 172 Title: pullRequest.Title, 173 173 Content: pullRequest.Content, 174 174 Milestone: milestone, 175 - IsClosed: pullRequest.State == "closed", 175 + IsClosed: pullRequest.State == f3.PullRequestStateClosed, 176 176 CreatedUnix: timeutil.TimeStamp(pullRequest.Created.Unix()), 177 177 UpdatedUnix: timeutil.TimeStamp(pullRequest.Updated.Unix()), 178 178 IsLocked: pullRequest.IsLocked, ··· 190 190 o.Trace("%s", node.GetID()) 191 191 192 192 project := f3_tree.GetProjectID(o.GetNode()) 193 - id := f3_util.ParseInt(string(node.GetID())) 193 + id := node.GetID().Int64() 194 194 195 195 issue, err := issues_model.GetIssueByIndex(ctx, project, id) 196 196 if issues_model.IsErrIssueNotExist(err) { ··· 219 219 func (o *pullRequest) Patch(ctx context.Context) { 220 220 node := o.GetNode() 221 221 project := f3_tree.GetProjectID(o.GetNode()) 222 - id := f3_util.ParseInt(string(node.GetID())) 222 + id := node.GetID().Int64() 223 223 o.Trace("repo_id = %d, index = %d", project, id) 224 224 if _, err := db.GetEngine(ctx).Where("`repo_id` = ? AND `index` = ?", project, id).Cols("name", "content").Update(o.forgejoPullRequest); err != nil { 225 225 panic(fmt.Errorf("%v %v", o.forgejoPullRequest, err)) ··· 289 289 } 290 290 291 291 o.Trace("pullRequest created %d/%d", o.forgejoPullRequest.ID, o.forgejoPullRequest.Index) 292 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoPullRequest.Index)) 292 + return generic.NewNodeID(o.forgejoPullRequest.Index) 293 293 } 294 294 295 295 func (o *pullRequest) Delete(ctx context.Context) {
+2 -2
services/f3/driver/reaction.go
··· 67 67 node := o.GetNode() 68 68 o.Trace("%s", node.GetID()) 69 69 70 - id := f3_util.ParseInt(string(node.GetID())) 70 + id := node.GetID().Int64() 71 71 72 72 if has, err := db.GetEngine(ctx).Where("ID = ?", id).Get(o.forgejoReaction); err != nil { 73 73 panic(fmt.Errorf("reaction %v %w", id, err)) ··· 115 115 panic(err) 116 116 } 117 117 o.Trace("reaction created %d", o.forgejoReaction.ID) 118 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoReaction.ID)) 118 + return generic.NewNodeID(o.forgejoReaction.ID) 119 119 } 120 120 121 121 func (o *reaction) Delete(ctx context.Context) {
+2 -2
services/f3/driver/release.go
··· 85 85 node := o.GetNode() 86 86 o.Trace("%s", node.GetID()) 87 87 88 - id := f3_util.ParseInt(string(node.GetID())) 88 + id := node.GetID().Int64() 89 89 90 90 release, err := repo_model.GetReleaseByID(ctx, id) 91 91 if repo_model.IsErrReleaseNotExist(err) { ··· 133 133 panic(err) 134 134 } 135 135 o.Trace("release created %d", o.forgejoRelease.ID) 136 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoRelease.ID)) 136 + return generic.NewNodeID(o.forgejoRelease.ID) 137 137 } 138 138 139 139 func (o *release) Delete(ctx context.Context) {
+1 -1
services/f3/driver/repository.go
··· 68 68 func (o *repository) upsert(ctx context.Context) generic.NodeID { 69 69 o.Trace("%s", o.GetNativeID()) 70 70 o.h.Upsert(ctx, o.f) 71 - return generic.NodeID(o.f.Name) 71 + return generic.NewNodeID(o.f.Name) 72 72 } 73 73 74 74 func (o *repository) SetFetchFunc(fetchFunc func(ctx context.Context, destination string)) {
+2 -2
services/f3/driver/review.go
··· 111 111 node := o.GetNode() 112 112 o.Trace("%s", node.GetID()) 113 113 114 - id := f3_util.ParseInt(string(node.GetID())) 114 + id := node.GetID().Int64() 115 115 116 116 review, err := issues_model.GetReviewByID(ctx, id) 117 117 if issues_model.IsErrReviewNotExist(err) { ··· 153 153 panic(err) 154 154 } 155 155 o.Trace("review created %d", o.forgejoReview.ID) 156 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoReview.ID)) 156 + return generic.NewNodeID(o.forgejoReview.ID) 157 157 } 158 158 159 159 func (o *review) Delete(ctx context.Context) {
+2 -2
services/f3/driver/reviewcomment.go
··· 92 92 node := o.GetNode() 93 93 o.Trace("%s", node.GetID()) 94 94 95 - id := f3_util.ParseInt(string(node.GetID())) 95 + id := node.GetID().Int64() 96 96 97 97 reviewComment, err := issues_model.GetCommentByID(ctx, id) 98 98 if issues_model.IsErrCommentNotExist(err) { ··· 125 125 panic(err) 126 126 } 127 127 o.Trace("reviewComment created %d", o.forgejoReviewComment.ID) 128 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoReviewComment.ID)) 128 + return generic.NewNodeID(o.forgejoReviewComment.ID) 129 129 } 130 130 131 131 func (o *reviewComment) Delete(ctx context.Context) {
+2 -2
services/f3/driver/topic.go
··· 61 61 node := o.GetNode() 62 62 o.Trace("%s", node.GetID()) 63 63 64 - id := f3_util.ParseInt(string(node.GetID())) 64 + id := node.GetID().Int64() 65 65 66 66 if has, err := db.GetEngine(ctx).Where("ID = ?", id).Get(o.forgejoTopic); err != nil { 67 67 panic(fmt.Errorf("topic %v %w", id, err)) ··· 86 86 panic(err) 87 87 } 88 88 o.Trace("topic created %d", o.forgejoTopic.ID) 89 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoTopic.ID)) 89 + return generic.NewNodeID(o.forgejoTopic.ID) 90 90 } 91 91 92 92 func (o *topic) Delete(ctx context.Context) {
+3 -3
services/f3/driver/user.go
··· 81 81 func (o *user) Get(ctx context.Context) bool { 82 82 node := o.GetNode() 83 83 o.Trace("%s", node.GetID()) 84 - id := f3_util.ParseInt(string(node.GetID())) 84 + id := node.GetID().Int64() 85 85 u, err := user_model.GetPossibleUserByID(ctx, id) 86 86 if user_model.IsErrUserNotExist(err) { 87 87 return false ··· 98 98 99 99 func (o *user) Put(ctx context.Context) generic.NodeID { 100 100 if user := getSystemUserByName(o.forgejoUser.Name); user != nil { 101 - return generic.NodeID(fmt.Sprintf("%d", user.ID)) 101 + return generic.NewNodeID(user.ID) 102 102 } 103 103 104 104 o.forgejoUser.LowerName = strings.ToLower(o.forgejoUser.Name) ··· 111 111 panic(err) 112 112 } 113 113 114 - return generic.NodeID(fmt.Sprintf("%d", o.forgejoUser.ID)) 114 + return generic.NewNodeID(o.forgejoUser.ID) 115 115 } 116 116 117 117 func (o *user) Delete(ctx context.Context) {
+1 -1
services/f3/driver/users.go
··· 40 40 panic(fmt.Errorf("GetUserByName: %v", err)) 41 41 } 42 42 43 - return generic.NodeID(fmt.Sprintf("%d", user.ID)) 43 + return generic.NewNodeID(user.ID) 44 44 } 45 45 46 46 func newUsers() generic.NodeDriverInterface {