Skip to content

Commit

Permalink
Revert "Revert "Revert "Revert "Revert "[communitybridge#4358,communi…
Browse files Browse the repository at this point in the history
…tybridge#4359] Feature/LDAP Decommissioning"""""

This reverts commit 74f4f6d.
  • Loading branch information
nickmango committed Aug 22, 2024
1 parent 205b0c9 commit d6e75fb
Show file tree
Hide file tree
Showing 15 changed files with 707 additions and 835 deletions.
7 changes: 1 addition & 6 deletions cla-backend-go/cmd/dynamo_events_lambda/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,7 @@ func init() {
githubOrganizationsService := github_organizations.NewService(githubOrganizationsRepo, repositoriesRepo, projectClaGroupRepo)
repositoriesService := repositories.NewService(repositoriesRepo, githubOrganizationsRepo, projectClaGroupRepo)

gerritService := gerrits.NewService(gerritRepo, &gerrits.LFGroup{
LfBaseURL: configFile.LFGroup.ClientURL,
ClientID: configFile.LFGroup.ClientID,
ClientSecret: configFile.LFGroup.ClientSecret,
RefreshToken: configFile.LFGroup.RefreshToken,
})
gerritService := gerrits.NewService(gerritRepo)
// Services
projectService := service.NewService(projectRepo, repositoriesRepo, gerritRepo, projectClaGroupRepo, usersRepo)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,7 @@ func Handler(ctx context.Context) error {
v1ProjectClaGroupRepo,
})

gerritService := gerrits.NewService(gerritRepo, &gerrits.LFGroup{
LfBaseURL: configFile.LFGroup.ClientURL,
ClientID: configFile.LFGroup.ClientID,
ClientSecret: configFile.LFGroup.ClientSecret,
RefreshToken: configFile.LFGroup.RefreshToken,
})
gerritService := gerrits.NewService(gerritRepo)

approvalsTableName := "cla-" + stage + "-approvals"

Expand Down
2 changes: 1 addition & 1 deletion cla-backend-go/cmd/migrate_approval_list/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func init() {
v1ProjectClaGroupRepo,
})
ghOrgRepo = github_organizations.NewRepository(awsSession, stage)
gerritService = gerrits.NewService(gerritsRepo, nil)
gerritService = gerrits.NewService(gerritsRepo)
signatureRepo = signatures.NewRepository(awsSession, stage, companyRepo, usersRepo, eventsService, &ghRepo, ghOrgRepo, gerritService, approvalRepo)

log.Info("initialized repositories\n")
Expand Down
8 changes: 1 addition & 7 deletions cla-backend-go/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,7 @@ func server(localMode bool) http.Handler {
v1ProjectClaGroupRepo,
})

gerritService := gerrits.NewService(gerritRepo, &gerrits.LFGroup{
LfBaseURL: configFile.LFGroup.ClientURL,
ClientID: configFile.LFGroup.ClientID,
ClientSecret: configFile.LFGroup.ClientSecret,
RefreshToken: configFile.LFGroup.RefreshToken,
EventsService: eventsService,
})
gerritService := gerrits.NewService(gerritRepo)

// Signature repository handler
signaturesRepo := signatures.NewRepository(awsSession, stage, v1CompanyRepo, usersRepo, eventsService, gitV1Repository, githubOrganizationsRepo, gerritService, approvalsRepo)
Expand Down
143 changes: 143 additions & 0 deletions cla-backend-go/gerrits/mocks/mock_repository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions cla-backend-go/gerrits/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ type Gerrit struct {
// toModel converts the gerrit structure into a response model
func (g *Gerrit) toModel() *models.Gerrit {
return &models.Gerrit{
DateCreated: g.DateCreated,
DateModified: g.DateModified,
GerritID: strfmt.UUID4(g.GerritID),
GerritName: g.GerritName,
GerritURL: strfmt.URI(g.GerritURL),
GroupIDCcla: g.GroupIDCcla,
GroupIDIcla: g.GroupIDIcla,
GroupNameCcla: g.GroupNameCcla,
GroupNameIcla: g.GroupNameIcla,
ProjectID: g.ProjectID,
Version: g.Version,
ProjectSFID: g.ProjectSFID,
DateCreated: g.DateCreated,
DateModified: g.DateModified,
GerritID: strfmt.UUID4(g.GerritID),
GerritName: g.GerritName,
GerritURL: strfmt.URI(g.GerritURL),
GroupIDCcla: g.GroupIDCcla,
ProjectID: g.ProjectID,
Version: g.Version,
ProjectSFID: g.ProjectSFID,
}
}

Expand Down
21 changes: 9 additions & 12 deletions cla-backend-go/gerrits/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,15 @@ func (repo *repo) AddGerrit(ctx context.Context, input *models.Gerrit) (*models.
}
_, currentTime := utils.CurrentTime()
gerrit := &Gerrit{
DateCreated: currentTime,
DateModified: currentTime,
GerritID: gerritID.String(),
GerritName: input.GerritName,
GerritURL: input.GerritURL.String(),
GroupIDCcla: input.GroupIDCcla,
GroupIDIcla: input.GroupIDIcla,
GroupNameCcla: input.GroupNameCcla,
GroupNameIcla: input.GroupNameIcla,
ProjectID: input.ProjectID,
ProjectSFID: input.ProjectSFID,
Version: input.Version,
DateCreated: currentTime,
DateModified: currentTime,
GerritID: gerritID.String(),
GerritName: input.GerritName,
GerritURL: input.GerritURL.String(),
GroupIDCcla: input.GroupIDCcla,
ProjectID: input.ProjectID,
ProjectSFID: input.ProjectSFID,
Version: input.Version,
}
av, err := dynamodbattribute.MarshalMap(gerrit)
if err != nil {
Expand Down
Loading

0 comments on commit d6e75fb

Please sign in to comment.