Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass installation id to pr revision activities #716

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions server/neptune/lyft/activities/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
)

type Github struct {
ClientCreator githubapp.ClientCreator
ClientCreator githubapp.ClientCreator
InstallationID int64
}

type ListPRsRequest struct {
Expand All @@ -29,7 +30,7 @@ type ListPRsResponse struct {

func (a *Github) GithubListPRs(ctx context.Context, request ListPRsRequest) (ListPRsResponse, error) {
prs, err := a.listPullRequests(
ctx, request.Repo.Credentials.InstallationToken,
ctx, a.InstallationID,
request.Repo.Owner,
request.Repo.Name,
request.Repo.DefaultBranch,
Expand Down Expand Up @@ -65,7 +66,7 @@ type ListModifiedFilesResponse struct {

func (a *Github) GithubListModifiedFiles(ctx context.Context, request ListModifiedFilesRequest) (ListModifiedFilesResponse, error) {
files, err := a.listModifiedFiles(
ctx, request.Repo.Credentials.InstallationToken,
ctx, a.InstallationID,
request.Repo.Owner,
request.Repo.Name,
request.PullRequest.Number,
Expand Down
3 changes: 2 additions & 1 deletion server/neptune/temporalworker/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ func NewServer(config *config.Config) (*Server, error) {
}

prRevisionGithubActivities := &lyftActivities.Github{
ClientCreator: clientCreator,
ClientCreator: clientCreator,
InstallationID: config.GithubCfg.TemporalAppInstallationID,
}

cronScheduler := internalSync.NewCronScheduler(config.CtxLogger)
Expand Down
Loading