Skip to content

Commit 575e070

Browse files
Merge pull request #4788 from linuxfoundation/dev
Sync `main` with `dev`.
2 parents a0726c8 + 2c822bc commit 575e070

File tree

94 files changed

+10201
-6109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+10201
-6109
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
echo "Validating v2 backend using endpoint: ${v2_url}"
165165
curl --fail -XGET ${v2_url}
166166
exit_code=$?
167-
if [[ ${exit_coe} -eq 0 ]]; then
167+
if [[ ${exit_code} -eq 0 ]]; then
168168
echo "Successful response from endpoint: ${v2_url}"
169169
else
170170
echo "Failed to get a successful response from endpoint: ${v2_url}"
@@ -174,7 +174,7 @@ jobs:
174174
echo "Validating v3 backend using endpoint: ${v3_url}"
175175
curl --fail -XGET ${v3_url}
176176
exit_code=$?
177-
if [[ ${exit_coe} -eq 0 ]]; then
177+
if [[ ${exit_code} -eq 0 ]]; then
178178
echo "Successful response from endpoint: ${v3_url}"
179179
# JSON response should include "Status": "healthy"
180180
if [[ `curl -s -XGET ${v3_url} | jq -r '.Status'` == "healthy" ]]; then
@@ -207,7 +207,7 @@ jobs:
207207
echo "Validating v4 backend using endpoint: ${v4_url}"
208208
curl --fail -XGET ${v4_url}
209209
exit_code=$?
210-
if [[ ${exit_coe} -eq 0 ]]; then
210+
if [[ ${exit_code} -eq 0 ]]; then
211211
echo "Successful response from endpoint: ${v4_url}"
212212
# JSON response should include "Status": "healthy"
213213
if [[ `curl -s -XGET ${v4_url} | jq -r '.Status'` == "healthy" ]]; then

.github/workflows/deploy-prod.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
echo "Validating v2 backend using endpoint: ${v2_url}"
131131
curl --fail -XGET ${v2_url}
132132
exit_code=$?
133-
if [[ ${exit_coe} -eq 0 ]]; then
133+
if [[ ${exit_code} -eq 0 ]]; then
134134
echo "Successful response from endpoint: ${v2_url}"
135135
else
136136
echo "Failed to get a successful response from endpoint: ${v2_url}"
@@ -140,7 +140,7 @@ jobs:
140140
echo "Validating v3 backend using endpoint: ${v3_url}"
141141
curl --fail -XGET ${v3_url}
142142
exit_code=$?
143-
if [[ ${exit_coe} -eq 0 ]]; then
143+
if [[ ${exit_code} -eq 0 ]]; then
144144
echo "Successful response from endpoint: ${v3_url}"
145145
# JSON response should include "Status": "healthy"
146146
if [[ `curl -s -XGET ${v3_url} | jq -r '.Status'` == "healthy" ]]; then
@@ -172,7 +172,7 @@ jobs:
172172
echo "Validating v4 backend using endpoint: ${v4_url}"
173173
curl --fail -XGET ${v4_url}
174174
exit_code=$?
175-
if [[ ${exit_coe} -eq 0 ]]; then
175+
if [[ ${exit_code} -eq 0 ]]; then
176176
echo "Successful response from endpoint: ${v4_url}"
177177
# JSON response should include "Status": "healthy"
178178
if [[ `curl -s -XGET ${v4_url} | jq -r '.Status'` == "healthy" ]]; then

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,4 @@ cover.out
258258
src.txt
259259
src.txt.*
260260
out.json
261+
body.json

BOT_ALLOWLIST.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ To add first `skip_cla` value for an organization:
146146
```
147147
aws --profile lfproduct-prod --region us-east-1 dynamodb update-item --table-name "cla-prod-github-orgs" --key '{"organization_name": {"S": "open-telemetry"}}' --update-expression 'SET skip_cla = :val' --expression-attribute-values '{":val": {"M": {"otel-arrow":{"S":";re:^\\d+\\+Copilot@users\\.noreply\\.github\\.com$;copilot-swe-agent[bot]"}}}}'
148148
aws --profile lfproduct-prod --region us-east-1 dynamodb update-item --table-name "cla-prod-github-orgs" --key '{"organization_name": {"S": "openfga"}}' --update-expression 'SET skip_cla = :val' --expression-attribute-values '{":val": {"M": {"vscode-ext":{"S":";re:^\\d+\\+Copilot@users\\.noreply\\.github\\.com$;copilot-swe-agent[bot]"}}}}'
149+
aws --profile lfproduct-prod --region us-east-1 dynamodb update-item --table-name "cla-prod-github-orgs" --key '{"organization_name": {"S": "eslint"}}' --update-expression 'SET skip_cla = :val' --expression-attribute-values '{":val": {"M": {"*":{"S":"[Copilot;re:^\\d+\\+Copilot@users\\.noreply\\.github\\.com$;copilot-swe-agent[bot]||;re:^\\d+\\+Copilot@users\\.noreply\\.github\\.com$;copilot-swe-agent[bot]||Copilot;re:^\\d+\\+copilot@users\\.noreply\\.github\\.com$;Copilot]"}}}}'
149150
```
150151

151152
To add additional repositories entries without overwriting the existing `skip_cla` value:

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ paths:
351351
- $ref: "#/parameters/x-email"
352352
- name: claGroupInput
353353
in: body
354+
required: true
354355
schema:
355356
$ref: '#/definitions/create-cla-group-input'
356357
responses:
@@ -2663,6 +2664,7 @@ paths:
26632664
- $ref: "#/parameters/path-userID"
26642665
- name: body
26652666
in: body
2667+
required: true
26662668
schema:
26672669
type: object
26682670
required:
@@ -2829,6 +2831,7 @@ paths:
28292831
- $ref: "#/parameters/path-companyID"
28302832
- $ref: "#/parameters/path-projectSFID"
28312833
- name: body
2834+
required: true
28322835
in: body
28332836
schema:
28342837
type: object
@@ -2998,6 +3001,7 @@ paths:
29983001
- $ref: "#/parameters/path-companyID"
29993002
- name: body
30003003
in: body
3004+
required: true
30013005
schema:
30023006
type: object
30033007
x-nullable: false
@@ -3043,6 +3047,7 @@ paths:
30433047
- $ref: "#/parameters/path-companyID"
30443048
- name: body
30453049
in: body
3050+
required: true
30463051
schema:
30473052
type: object
30483053
x-nullable: false
@@ -4637,7 +4642,9 @@ parameters:
46374642
description: the Salesforce ID of the Foundation
46384643
in: query
46394644
type: string
4640-
pattern: '^[a-zA-Z0-9]{18}|[a-zA-Z0-9]{15}$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4645+
pattern: '^([0-9A-Za-z]{15}|[0-9A-Za-z]{18})$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4646+
minLength: 15
4647+
maxLength: 18
46414648
companyID:
46424649
name: companyID
46434650
description: The internal company ID representing signing entity name instance (EasyCLA)
@@ -4658,18 +4665,18 @@ parameters:
46584665
in: path
46594666
type: string
46604667
required: true
4661-
pattern: '^[a-zA-Z0-9]{18}|[a-zA-Z0-9]{15}$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4662-
minLength: 5
4663-
maxLength: 255
4668+
pattern: '^([0-9A-Za-z]{15}|[0-9A-Za-z]{18})$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4669+
minLength: 15
4670+
maxLength: 18
46644671
path-projectSFID:
46654672
name: projectSFID
46664673
description: the Salesforce ID of the project
46674674
in: path
46684675
type: string
46694676
required: true
4670-
pattern: '^[a-zA-Z0-9]{18}|[a-zA-Z0-9]{15}$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4671-
minLength: 5
4672-
maxLength: 255
4677+
pattern: '^([0-9A-Za-z]{15}|[0-9A-Za-z]{18})$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4678+
minLength: 15
4679+
maxLength: 18
46734680
path-userID:
46744681
name: userID
46754682
description: v1 EasyCLA user Admin ID
@@ -4699,7 +4706,9 @@ parameters:
46994706
in: path
47004707
type: string
47014708
required: true
4702-
pattern: '^[a-zA-Z0-9]{18}|[a-zA-Z0-9]{15}$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4709+
pattern: '^([0-9A-Za-z]{15}|[0-9A-Za-z]{18})$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
4710+
minLength: 15
4711+
maxLength: 18
47034712
path-companyName:
47044713
name: companyName
47054714
description: the company name

cla-backend-go/swagger/common/properties/external-id.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33

44
type: string
55
example: "00117000015vpjXAAQ"
6-
pattern: '^[a-zA-Z0-9]{18}|[a-zA-Z0-9]{15}$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
6+
pattern: '^([0-9A-Za-z]{15}|[0-9A-Za-z]{18})$' # see: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id
7+
minLength: 15
8+
maxLength: 18

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,14 @@ func (s *service) NotifyCLAManagers(ctx context.Context, notifyCLAManagers *mode
11671167
// Search for Easy CLA User
11681168
log.WithFields(f).Debugf("Getting user by ID: %s", notifyCLAManagers.UserID)
11691169
userModel, userErr := s.easyCLAUserService.GetUser(notifyCLAManagers.UserID)
1170+
// log.WithFields(f).Debugf("Got user by ID: %s -> (%+v, %+v)", notifyCLAManagers.UserID, userModel, userErr)
11701171
if userErr != nil {
1171-
msg := fmt.Sprintf("Problem getting user by ID: %s ", notifyCLAManagers.UserID)
1172+
msg := fmt.Sprintf("Problem getting user by ID: %s: %v", notifyCLAManagers.UserID, userErr)
1173+
log.WithFields(f).Warn(msg)
1174+
return ErrCLAUserNotFound
1175+
}
1176+
if userModel == nil {
1177+
msg := fmt.Sprintf("Problem getting user by ID: %s", notifyCLAManagers.UserID)
11721178
log.WithFields(f).Warn(msg)
11731179
return ErrCLAUserNotFound
11741180
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ func (s *Service) InvalidateICLA(ctx context.Context, claGroupID string, userID
381381
log.WithFields(f).Debug("unable to get user record")
382382
return userErr
383383
}
384+
if user == nil {
385+
log.WithFields(f).Debug("unable to get user record")
386+
return fmt.Errorf("user not found for userID: %s", userID)
387+
}
384388

385389
log.WithFields(f).Debug("invalidating signature record ...")
386390
note := fmt.Sprintf("Signature invalidated (approved set to false) by %s for %s ", authUser.UserName, utils.GetBestUsername(user))

cla-backend/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ wrapt==1.17.2
5656
astroid==3.3.8
5757
pluggy==1.5.0
5858
gunicorn==22.0.0
59+
PyNaCl==1.5.0

tests/functional/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ You can ask for example `.env` file over slack.
9090
- Run `npx cypress install`
9191
- Run tests using cmd `npx cypress run`. Or `xvfb-run -a npx cypress run` when runnign over SSH.
9292
- Run tests using UI `npx cypress open`. Choose **E2E testing**, select **Chrome** browser.
93+
- Run single E2E spec file: `` [ALLOW_FAIL=1] ./utils/run-single-test.sh github-repositories ``.
94+
- Run single test from E2E spec file: `` [ALLOW_FAIL=1] ./utils/run-single-test.sh github-repositories 'test name regexp' ``.
95+
- Additional options include: `TOKEN=xxxx`, `XACL=xxxx`, `DEBUG=1`, `LOCAL=1`, `ALL=1`.
96+
- To format E2E tests: `` npx prettier --write cypress/e2e/* ``.
9397
- View test reports in the `cypress-report` directory.
9498
- Explore source code files for detailed implementation.
9599

0 commit comments

Comments
 (0)