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

[#4395]Feature/Gerrit Post #4448

Merged
merged 1 commit into from
Oct 7, 2024
Merged
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
13 changes: 9 additions & 4 deletions cla-backend-go/gerrits/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ func (s service) AddGerrit(ctx context.Context, claGroupID string, projectSFID s
"projectSFID": projectSFID,
}

log.WithFields(f).Debugf("cla groupID %s", claGroupID)
log.WithFields(f).Debugf("project Model %+v", claGroupModel)

if params.GerritName == nil {
return nil, errors.New("gerrit_name required")
}

log.WithFields(f).Debugf("checking if gerrit name already exists in the system : %s", *params.GerritName)
gerritObject, err := s.repo.ExistsByName(ctx, *params.GerritName)
if err != nil {
message := fmt.Sprintf("unable to get gerrit by name : %s", *params.GerritName)
Expand Down Expand Up @@ -108,9 +106,16 @@ func (s service) AddGerrit(ctx context.Context, claGroupID string, projectSFID s
for _, repo := range gerritRepoList.Repos {
repo.Connected = true
}
gerritInstance, err := s.repo.AddGerrit(ctx, input)
if err != nil {
return nil, err
}
input.GerritID = gerritInstance.GerritID
input.DateCreated = gerritInstance.DateCreated
input.DateModified = gerritInstance.DateModified
input.GerritRepoList = gerritRepoList
log.WithFields(f).Debugf("gerrit input %+v", input)
return s.repo.AddGerrit(ctx, input)
return input, nil
}

func (s service) GetGerrit(ctx context.Context, gerritID string) (*models.Gerrit, error) {
Expand Down
Loading