From 27fa51c7a826e97bac3f386ad7592bbfa96e81f7 Mon Sep 17 00:00:00 2001 From: Vault Automation Date: Tue, 2 Sep 2025 17:21:43 -0600 Subject: [PATCH] [VAULT-39333] pipeline(copy-pr): always fetch HEAD repo with it's clone URL (#9047) (#9061) * always fetch HEAD repo with it's clone URL * use the number instead of ID when generating the summary table Signed-off-by: Ryan Cragun Co-authored-by: Ryan Cragun --- tools/pipeline/internal/pkg/github/copy_pull_request.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/pipeline/internal/pkg/github/copy_pull_request.go b/tools/pipeline/internal/pkg/github/copy_pull_request.go index 1303c24d22..5b7d0c1fa0 100644 --- a/tools/pipeline/internal/pkg/github/copy_pull_request.go +++ b/tools/pipeline/internal/pkg/github/copy_pull_request.go @@ -155,7 +155,7 @@ func (r *CopyPullRequestReq) Run( Track: []string{prBranch}, Fetch: true, Name: r.FromOrigin, - URL: fmt.Sprintf("https://github.com/%s/%s.git", r.FromOwner, r.FromRepo), + URL: res.OriginPullRequest.GetHead().GetRepo().GetCloneURL(), }) if err != nil { err = fmt.Errorf("fetching target branch base ref: %s, %w", remoteRes.String(), err) @@ -400,11 +400,11 @@ func (r *CopyPullRequestRes) ToTable(err error) table.Writer { if r.Request != nil { from := r.Request.FromOwner + "/" + r.Request.FromRepo if pr := r.OriginPullRequest; pr != nil { - from = fmt.Sprintf("[%s#%d](%s)", from, pr.GetID(), pr.GetHTMLURL()) + from = fmt.Sprintf("[%s#%d](%s)", from, pr.GetNumber(), pr.GetHTMLURL()) } to := r.Request.ToOwner + "/" + r.Request.ToRepo if pr := r.PullRequest; pr != nil { - to = fmt.Sprintf("[%s#%d](%s)", to, pr.GetID(), pr.GetHTMLURL()) + to = fmt.Sprintf("[%s#%d](%s)", to, pr.GetNumber(), pr.GetHTMLURL()) } row = table.Row{from, to} }