Skip to content

Commit f521e48

Browse files
codyosslqiu96
authored andcommitted
fix(librarian): generate PR body (#2009)
Fixes an issue where the generate PR body parsing code was referencing the wrong repo. Tested: codyoss/google-cloud-go#4 Fixes: #1972
1 parent 3bf6c8a commit f521e48

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

internal/librarian/command.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ type ContainerClientFactory func(workRoot, image, userUID, userGID string) (Cont
5353

5454
// CommitInfo stores the fields used to create a commit locally.
5555
type CommitInfo struct {
56-
cfg *config.Config
57-
state *config.LibrarianState
58-
repo gitrepo.Repository
56+
cfg *config.Config
57+
state *config.LibrarianState
58+
repo gitrepo.Repository
59+
sourceRepo gitrepo.Repository
60+
5961
ghClient GitHubClient
6062
branch string
6163
commitMessage string

internal/librarian/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func (r *generateRunner) run(ctx context.Context) error {
204204
cfg: r.cfg,
205205
state: r.state,
206206
repo: r.repo,
207+
sourceRepo: r.sourceRepo,
207208
ghClient: r.ghClient,
208209
branch: branch,
209210
commitMessage: "chore: generate libraries",

internal/librarian/release_init.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func init() {
9090
type initRunner struct {
9191
cfg *config.Config
9292
repo gitrepo.Repository
93+
sourceRepo gitrepo.Repository
9394
state *config.LibrarianState
9495
librarianConfig *config.LibrarianConfig
9596
ghClient GitHubClient
@@ -107,6 +108,7 @@ func newInitRunner(cfg *config.Config) (*initRunner, error) {
107108
return &initRunner{
108109
cfg: runner.cfg,
109110
repo: runner.repo,
111+
sourceRepo: runner.sourceRepo,
110112
state: runner.state,
111113
librarianConfig: runner.librarianConfig,
112114
ghClient: runner.ghClient,
@@ -144,6 +146,7 @@ func (r *initRunner) run(ctx context.Context) error {
144146
cfg: r.cfg,
145147
state: r.state,
146148
repo: r.repo,
149+
sourceRepo: r.sourceRepo,
147150
ghClient: r.ghClient,
148151
branch: branch,
149152
commitMessage: "chore: create a release",

0 commit comments

Comments
 (0)