Skip to content

Commit 2b8a2aa

Browse files
API ported - address lint
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent 52655ee commit 2b8a2aa

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

cla-backend-go/swagger/cla.v2.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,12 +2458,12 @@ paths:
24582458
summary: |
24592459
Returns all metadata associated with a user's active signature.
24602460
{
2461-
'user_id': <user-id>,
2462-
'project_id': <project-id>,
2463-
'repository_id': <repository-id>,
2464-
'pull_request_id': <PR>,
2465-
*'merge_request_id': <MR> (optional),
2466-
'return_url': <url-where-user-initiated-signature-from>'
2461+
'user_id': <user-uuid>,
2462+
'project_id': <project-uuid>,
2463+
'repository_id': <repository-id> (as string),
2464+
'pull_request_id': <PR> (PR number as string),
2465+
*'merge_request_id': <MR> (optional MR number as string - this property can be missing in JSON),
2466+
'return_url': <url-where-user-initiated-signature-from> (for example itHub PR path)'
24672467
}
24682468
Returns null if the user does not have an active signature.
24692469
security: [ ]

cla-backend-go/swagger/common/user-active-signature.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ description: >
1010
properties:
1111
user_id:
1212
$ref: './common/properties/internal-id.yaml'
13-
description: The unique internal ID of the user
13+
description: The unique internal UUID of the user
1414
project_id:
1515
$ref: './common/properties/internal-id.yaml'
16-
description: The unique ID of the associated project
16+
description: The unique UUID of the associated project
1717
repository_id:
1818
type: string
19-
description: The unique ID of the associated repository
19+
description: The unique ID of the associated repository (number stored as string)
2020
example: '168926425'
2121
pull_request_id:
2222
type: string
23-
description: The pull request ID related to the signature
23+
description: The pull request ID related to the signature (number stored as string)
2424
example: '456'
2525
merge_request_id:
2626
type: string
27-
description: The merge request ID related to the signature
27+
description: The merge request ID related to the signature (optional number stored as string, thsi property can be missing in JSON)
2828
example: '456'
2929
x-nullable: true
3030
return_url:
3131
type: string
3232
format: uri
33-
description: The return URL where the user initiated the signature
34-
example: https://example.com/return
33+
description: The return URL where the user initiated the signature (for example GitHub PR path)
34+
example: https://github.com/veer-missingid2/repo03/pull/3

cla-backend-go/v2/sign/handlers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ func Configure(api *operations.EasyclaAPI, service Service, userService users.Se
271271
return middleware.ResponderFunc(func(w http.ResponseWriter, _ runtime.Producer) {
272272
w.Header().Set("Content-Type", "application/json")
273273
w.WriteHeader(http.StatusOK)
274-
_, _ = w.Write([]byte("null"))
274+
if _, err := w.Write([]byte("null")); err != nil {
275+
log.WithFields(f).WithError(err).Warn("failed to write null response")
276+
}
275277
})
276278
}
277279
return sign.NewGetUserActiveSignatureOK().WithPayload(resp)

cla-backend-go/v2/sign/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2852,10 +2852,10 @@ func (s *service) GetUserActiveSignature(ctx context.Context, userID string) (*m
28522852
log.WithFields(f).WithError(err).Warnf("unable to get active signature meta data for user: %s", userID)
28532853
return nil, err
28542854
}
2855+
log.WithFields(f).Debugf("active signature metadata: %+v", activeSignatureMetadata)
28552856
if len(activeSignatureMetadata) == 0 {
28562857
return nil, nil
28572858
}
2858-
log.WithFields(f).Debugf("active signature metadata: %+v", activeSignatureMetadata)
28592859
var (
28602860
mergeRequestId *string
28612861
isGitlab bool

cla-backend/cla/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def request_company_ccla(
232232
# return cla.controllers.user.request_company_admin_access(str(user_id), str(company_id))
233233

234234

235-
# LG: porting this to golang
235+
# LG: This is ported to golang and no longer used in dev (still used in prod)
236236
@hug.get("/user/{user_id}/active-signature", versions=2)
237237
def get_user_active_signature(user_id: hug.types.uuid):
238238
"""

0 commit comments

Comments
 (0)