You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: WHITELISTING_BOTS.md
+34-19Lines changed: 34 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,26 @@ You can allow specific bot users to automatically pass the CLA check.
4
4
5
5
This can be done on the GitHub organization level by setting the `skip_cla` property on `cla-{stage}-github-orgs` DynamoDB table.
6
6
7
-
This property is a Map attribute that contains mapping from repository pattern to bot username and email pattern.
7
+
Replace `{stage}` with either `dev` or `prod`.
8
8
9
-
Each pattern is a string and can be one of three possible types:
10
-
-`"name"` - exact match for repository name, GitHub username, or email address.
9
+
This property is a Map attribute that contains mapping from repository pattern to bot username (GitHub login), email and name pattern.
10
+
11
+
Example username/login is lukaszgryglicki (like any username/login that can be accessed via `https://github.com/username`).
12
+
13
+
Example name is "Lukasz Gryglicki".
14
+
15
+
Email pattern and name pattern are optional and `*` is assumed for them if not specified.
16
+
17
+
Each pattern is a string and can be one of three possible types (and are checked tin this order):
18
+
-`"name"` - exact match for repository name, GitHub login/username, email address, GitHub name.
11
19
-`"re:regexp"` - regular expression match for repository name, GitHub username, or email address.
12
20
-`"*"` - matches all.
13
21
14
-
So the format is like `"repository_pattern": "github_username_pattern;email_pattern"`.
22
+
So the format is like `"repository_pattern": "github_username_pattern;email_pattern;name_pattern"`. `;` is used as a separator.
23
+
24
+
You can also specify multiple patterns so different set is used for multiple users - in such case configuration must start with `[`, end with `]` and be `||` separated.
25
+
26
+
For example: `"[copilot-swe-agent[bot];*;*||re:(?i)^l(ukasz)?gryglicki$;*;re:Gryglicki]"`.
15
27
16
28
There can be multiple entries under one Github Organization DynamoDB entry.
17
29
@@ -25,10 +37,10 @@ Example:
25
37
"skip_cla": {
26
38
"M": {
27
39
"*": {
28
-
"S": "copilot-swe-agent[bot];*"
40
+
"S": "copilot-swe-agent[bot];*;*"
29
41
},
30
-
"repo1": {
31
-
"S": "re:vee?rendra;*"
42
+
"re:(?i)^repo[0-9]+$": {
43
+
"S": "re:vee?rendra;*;*"
32
44
}
33
45
}
34
46
},
@@ -41,22 +53,24 @@ Algorithm to match pattern is as follows:
41
53
- If no exact match is found, we check for regular expression match. Only keys starting with `re:` are considered. If we find a match, we use that entry and stop searching.
42
54
- If no match is found, we check for `*` entry. If it exists, we use that entry and stop searching.
43
55
- If no match is found, we don't skip CLA check.
44
-
- Now when we have the entry, it is in the following format: `github_username_pattern;email_pattern`.
45
-
- We check both GitHub username and email address against the patterns. Algorith is the same - username and email patterns can be either direct match or `re:regexp` or `*`.
46
-
- If both username and email match the patterns, we skip CLA check. If username or email is not set but the pattern is `*` it means hit.
47
-
- So setting pattern to `username_pattern;*` means that we only check for username match and assume all emails are valid.
48
-
- If we set `repo_pattern` to `*` it means that this configuration applies to all repositories in the organization. If there are also specific repository patterns, they will be checked first.
56
+
- Now when we have the entry, it is in the following format: `github_username_pattern;email_pattern;name_pattern` or `"[github_username_pattern;email_pattern;name_pattern||...]" (array)`.
57
+
- We check GitHub username/login, email address and name against the patterns. Algorithm is the same - username, email and name patterns can be either direct match or `re:regexp` or `*`.
58
+
- If username, email and name match the patterns, we skip CLA check. If username or email or name is not set but the pattern is `*` it means hit.
59
+
- So setting pattern to `username_pattern;*;*` or `username_pattern` (which is equivalent) means that we only check for username match and assume all emails and names are valid.
60
+
- Any actor that matches any of the entries in the array will be skipped (logical OR).
61
+
- If we set `repo_pattern` to `*` it means that this configuration applies to all repositories in the organization. If there are also specific repository patterns, they will be used instead of `*` (fallback for all).
49
62
50
63
51
64
There is a script that allows you to update the `skip_cla` property in the DynamoDB table. It is located in `utils/skip_cla_entry.sh`. You can run it like this:
To check for log entries related to skipping CLA check, you can use the following command: `` STAGE=dev DTFROM='1 hour ago' DTTO='1 second ago' ./utils/search_aws_log_group.sh 'cla-backend-dev-githubactivity' 'skip_cla' ``.
Copy file name to clipboardExpand all lines: cla-backend-go/swagger/common/github-organization.yaml
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -74,11 +74,27 @@ properties:
74
74
additionalProperties:
75
75
type: string
76
76
description: |
77
-
Map of repository name or pattern (e.g. 'repo1', '*', 're:pattern') to a string in the form '<username_pattern>;<email_pattern>' for skipping CLA checks for certain bots. Patterns can be exact, wildcard '*', or regexp prefixed with 're:'.
78
-
example:
79
-
"*": "copilot-swe-agent[bot];*"
80
-
"repo1": "re:vee?rendra;*"
77
+
Map of repository name or pattern (e.g. 'repo1', '*', 're:pattern') to a string or array-string of pattern entries for skipping CLA checks for certain bots.
78
+
79
+
Each value can be either:
80
+
- A string in the form '<login_pattern>;<email_pattern>;<name_pattern>' (email and name patterns are optional, default to '*').
81
+
- Or an OR-array in the form '[<entry1>||<entry2>||...]', where each entry uses the same pattern format above.
81
82
83
+
Patterns can be:
84
+
- An exact match (e.g. 'repo1', 'username', 'email@domain').
85
+
- A wildcard '*' to match all.
86
+
- A regular expression prefixed with 're:' (e.g. 're:(?i)^bot.*').
0 commit comments