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
- monitors the antithesis recipients email inbox for new test results.
5
5
- monitors the running test-run facts
6
6
- publish a report-test transaction for each new result found.
7
-
- automatically accepts pending test-runs from trusted creators, downloading their assets and pushing them to Antithesis.
7
+
- automatically accepts pending test-runs from trusted requesters, downloading their assets and pushing them to Antithesis.
8
8
9
9
Trickery:
10
10
- To avoid pushing to Antithesis twice the same test-run, we have to track also the test-runs that are changing state (pending->running or running->done).
@@ -123,6 +123,13 @@ parseArgs =
123
123
secretsFileOption
124
124
processOptionsParser
125
125
126
+
dataRequesters=Some [Username] | AnyRequester
127
+
deriving (Eq, Show)
128
+
129
+
allowRequester::Requesters->Username->Bool
130
+
allowRequester AnyRequester _ =True
131
+
allowRequester (Some users) user = user `elem` users
132
+
126
133
dataProcessOptions=ProcessOptions
127
134
{poAuth::Auth
128
135
, poPollIntervalSeconds::Int
@@ -132,7 +139,7 @@ data ProcessOptions = ProcessOptions
132
139
, poAntithesisEmail::EmailUser
133
140
, poAntithesisEmailPassword::EmailPassword
134
141
, poDays::Int
135
-
, poTrustedCreators::[Username]
142
+
, poTrustedRequesters::Requesters
136
143
, poRegistry::Registry
137
144
, poAntithesisAuth::AntithesisAuth
138
145
, poVerbose::Bool
@@ -149,7 +156,7 @@ processOptionsParser =
149
156
<*> agentEmailOption
150
157
<*> agentEmailPasswordOption
151
158
<*> daysOption
152
-
<*>creatorsOption
159
+
<*>requestersOption
153
160
<*> registryOption
154
161
<*> antithesisAuthOption
155
162
<*> verboseOption
@@ -164,172 +171,189 @@ verboseOption =
164
171
, value False
165
172
]
166
173
167
-
creatorsOption::Parser[Username]
168
-
creatorsOption=
174
+
someRequestersOption::ParserRequesters
175
+
someRequestersOption=
169
176
let fromOption =
170
177
many
171
178
$Username
172
179
<$> strOption
173
-
[ long "trusted-test-creator"
180
+
[ long "trusted-test-requester"
174
181
, short 'c'
175
182
, metavar "GITHUB_USERNAME"
176
183
, help
177
-
"GitHub username of a trusted test-run creator. \
178
-
\Can be specified multiple times to add multiple trusted creators. \
179
-
\All test-runs pending from trusted creators will be run by the agent."
184
+
"GitHub username of a trusted test-run requester. \
185
+
\Can be specified multiple times to add multiple trusted requesters. \
186
+
\All test-runs pending from trusted requesters will be run by the agent."
180
187
]
181
188
fromConfig =
182
189
fmap (fromMaybe [])
183
190
$ optional
184
191
$fmapUsername
185
192
<$> setting
186
193
[ conf "trustedRequesters"
187
-
, help "List of trusted test-run creators GitHub usernames."
194
+
, help "List of trusted test-run requesters GitHub usernames."
188
195
, metavar "GITHUB_USERNAMES"
189
196
]
190
-
in(<>)<$> fromOption <*> fromConfig
197
+
infmapSome$(<>)<$> fromOption <*> fromConfig
198
+
199
+
allRequestersOption::ParserRequesters
200
+
allRequestersOption =
201
+
setting
202
+
[ long "trust-all-requesters"
203
+
, help
204
+
"Trust all test-run requesters. All pending test-runs will be run by the agent."
0 commit comments