Skip to content

Commit

Permalink
[#2636] Bug/Sign Standalone Project
Browse files Browse the repository at this point in the history
- Resolved CCLA sign issue for standalone projects

Signed-off-by: wanyaland <[email protected]>
  • Loading branch information
wanyaland committed Feb 15, 2021
1 parent ba86955 commit 17f21bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions cla-backend-go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ github.com/communitybridge/easycla v1.0.106 h1:NLYUZUZtp9DQ0dHEQkhz9h9EMzLRmuh9u
github.com/communitybridge/easycla v1.0.107 h1:dktHAji1yJ1nMEu54z4paPWOM4Q7A9rryc0OCADfAcY=
github.com/communitybridge/easycla v1.0.117 h1:o+rdmcNgZeMQ/N8HV/d5apNIBrkYH7eyM9UUYnEzewo=
github.com/communitybridge/easycla v1.0.118 h1:8yrsOQ+ENUFi4RFl1krRlIxc51lzZNutidR+yy2HwW0=
github.com/communitybridge/easycla v1.0.123 h1:Lh5i/9aajrTYItxNpVCmi9T1yyIfnQIOk0tC2Wtslvk=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
Expand Down
16 changes: 9 additions & 7 deletions cla-backend-go/v2/sign/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ func (s *service) RequestCorporateSignature(ctx context.Context, lfUsername stri
var claGroupID string
if project.Parent == "" || (project.Foundation != nil &&
(project.Foundation.Name == utils.TheLinuxFoundation || project.Foundation.Name == utils.LFProjectsLLC)) {
cgm, perr := s.projectClaGroupsRepo.GetClaGroupIDForProject(utils.StringValue(input.ProjectSfid))
if perr != nil {
log.WithFields(f).WithError(err).Warn("unable to lookup CLA Group ID for this project SFID")
return nil, perr
}
claGroupID = cgm.ClaGroupID

} else {
// this is root project
cgmlist, perr := s.projectClaGroupsRepo.GetProjectsIdsForFoundation(utils.StringValue(input.ProjectSfid))
if perr != nil {
Expand All @@ -195,13 +203,7 @@ func (s *service) RequestCorporateSignature(ctx context.Context, lfUsername stri
return nil, errors.New("invalid project_sfid. multiple cla-groups are associated with this project_sfid")
}
claGroupID = (claGroups.List())[0]
} else {
cgm, perr := s.projectClaGroupsRepo.GetClaGroupIDForProject(utils.StringValue(input.ProjectSfid))
if perr != nil {
log.WithFields(f).WithError(err).Warn("unable to lookup CLA Group ID for this project SFID")
return nil, perr
}
claGroupID = cgm.ClaGroupID

}

f["claGroupID"] = claGroupID
Expand Down

0 comments on commit 17f21bd

Please sign in to comment.