@@ -179,7 +179,7 @@ func initGitHubClient(ctx context.Context, token string) (*github.Client, error)
179179}
180180
181181// processPullRequests lists and processes all pull requests
182- func processPullRequests (ctx context.Context , client * github.Client , owner , repo string , states []string ) ([]api.AgentResource , error ) {
182+ func processPullRequests (ctx context.Context , client * github.Client , owner , repo string , states []string ) ([]api.CreateResource , error ) {
183183 log .Debug ("Processing pull requests" , "owner" , owner , "repo" , repo , "states" , states )
184184
185185 // If no states specified or "all" is specified, include everything
@@ -270,7 +270,7 @@ func processPullRequests(ctx context.Context, client *github.Client, owner, repo
270270 "filtered" , len (filteredPRs ),
271271 "states" , states )
272272
273- resources := []api.AgentResource {}
273+ resources := []api.CreateResource {}
274274 for _ , pr := range filteredPRs {
275275 log .Info ("Processing pull request" , "number" , pr .GetNumber (), "source" , pr .GetHead ().GetRef (), "target" , pr .GetBase ().GetRef ())
276276 resource , err := processPullRequest (ctx , client , owner , repo , pr )
@@ -454,7 +454,7 @@ func getNormalizedStatus(pr *github.PullRequest) string {
454454}
455455
456456// processPullRequest handles processing of a single pull request
457- func processPullRequest (ctx context.Context , client * github.Client , owner , repo string , pr * github.PullRequest ) (api.AgentResource , error ) {
457+ func processPullRequest (ctx context.Context , client * github.Client , owner , repo string , pr * github.PullRequest ) (api.CreateResource , error ) {
458458 prNumber := pr .GetNumber ()
459459 log .Debug ("Processing pull request" , "number" , prNumber , "title" , pr .GetTitle ())
460460
@@ -498,7 +498,7 @@ func processPullRequest(ctx context.Context, client *github.Client, owner, repo
498498 resourceName := fmt .Sprintf ("%s-%s-%d" , owner , repo , prNumber )
499499 log .Debug ("Creating resource" , "number" , prNumber , "name" , resourceName )
500500
501- return api.AgentResource {
501+ return api.CreateResource {
502502 Version : "ctrlplane.dev/git/pull-request/v1" ,
503503 Kind : "GitHubPullRequest" ,
504504 Name : resourceName ,
@@ -608,7 +608,7 @@ func initPullRequestMetadata(pr *github.PullRequest, owner, repo string) map[str
608608var relationshipRules = []api.CreateResourceRelationshipRule {}
609609
610610// upsertToCtrlplane handles upserting resources to Ctrlplane
611- func upsertToCtrlplane (ctx context.Context , resources []api.AgentResource , owner , repo , name string ) error {
611+ func upsertToCtrlplane (ctx context.Context , resources []api.CreateResource , owner , repo , name string ) error {
612612 log .Debug ("Upserting resources to Ctrlplane" , "count" , len (resources ))
613613
614614 if name == "" {
0 commit comments