-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathGitHubChecksPublisherITest.java
More file actions
453 lines (393 loc) · 21.6 KB
/
GitHubChecksPublisherITest.java
File metadata and controls
453 lines (393 loc) · 21.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
package io.jenkins.plugins.checks.github;
import com.cloudbees.plugins.credentials.CredentialsScope;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import hudson.model.Action;
import hudson.model.Result;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;
import java.util.function.Function;
import java.util.logging.Level;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.LoggerRule;
import org.mockito.MockedStatic;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.InjectableValues;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.GHCheckRun;
import org.kohsuke.github.GHCheckRunBuilder;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
import org.jenkinsci.plugins.displayurlapi.ClassicDisplayURLProvider;
import org.jenkinsci.plugins.github_branch_source.Connector;
import org.jenkinsci.plugins.github_branch_source.GitHubAppCredentials;
import org.jenkinsci.plugins.github_branch_source.GitHubSCMSource;
import org.jenkinsci.plugins.github_branch_source.PullRequestSCMRevision;
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import hudson.model.FreeStyleProject;
import hudson.model.Job;
import hudson.model.Queue;
import hudson.model.Run;
import hudson.util.Secret;
import jenkins.model.ParameterizedJobMixIn;
import jenkins.scm.api.SCMHead;
import io.jenkins.plugins.checks.api.ChecksAction;
import io.jenkins.plugins.checks.api.ChecksAnnotation.ChecksAnnotationBuilder;
import io.jenkins.plugins.checks.api.ChecksAnnotation.ChecksAnnotationLevel;
import io.jenkins.plugins.checks.api.ChecksConclusion;
import io.jenkins.plugins.checks.api.ChecksDetails;
import io.jenkins.plugins.checks.api.ChecksDetails.ChecksDetailsBuilder;
import io.jenkins.plugins.checks.api.ChecksImage;
import io.jenkins.plugins.checks.api.ChecksOutput.ChecksOutputBuilder;
import io.jenkins.plugins.checks.api.ChecksStatus;
import io.jenkins.plugins.util.PluginLogger;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
/**
* Tests if the {@link GitHubChecksPublisher} actually sends out the requests to GitHub in order to publish the check
* runs.
*/
@RunWith(Parameterized.class)
@SuppressWarnings({"PMD.ExcessiveImports", "checkstyle:ClassDataAbstractionCoupling", "rawtypes", "checkstyle:ClassFanOutComplexity", "checkstyle:JavaNCSS"})
public class GitHubChecksPublisherITest {
private static final String TEST_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n" +
"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDWV2v0jCfzbyTi\n" +
"r3mIufQSvXQj02e0Hbia0BOjYluZ2ife/RMs8mrzxAfWUtyrWsi+50OvbxXx+mk1\n" +
"drn+aR0z0YJ7gqymvn2zWUDv+99eWSb9yeKT3cZU7EpcwtL8APPLzSycoPeylkf8\n" +
"jtWopdglWO7AXnA+OIiW/luxgxzjUL6lrzye/9l67qQksy6F42+X5jKTZYx2e3vd\n" +
"I/NZgCGd/2h61RAHJH/2QwujYva2kc5pvm0JmwHKWqEWu+i6lcGXeL/C3zkyh8To\n" +
"ROFNMz/12+mUbqye1dAg19JcJtmM8ymHsmfFc9CGmXQyuAuhU4zPssA/2i0rPWl+\n" +
"xthlEA6TAgMBAAECggEASVrf8nCpF5H5IK+HO3jQhD1cawpl2mm1jR4bKnZ1/QCB\n" +
"Vrpr/pz0Z3q2Z+4x4V8Phu4k5vxwmUDnEsoQO3aD7QEN0/FT3zkgUeoA5GDiACso\n" +
"wgB+z7Y9s0Cu7nIqvN4ikaQlWXFpdDAkcNX9X1tqztVR2Ho5lcHJVUu129mQYGbY\n" +
"ivdmSIjLn9oqFhqOpdYtLSoiNtoJmhyFTQj0G+DTumS9G556sBRuZI7qwAKrd6+D\n" +
"GPvbgVC7mcGogDgUyIAMLj9Q+EfjlX+gfWtqabF9v5Wxp0u1vdC+mdmL/IgbqGTW\n" +
"DYEQAS1gkkLYXQZXBp7vREU5Oq/W2/okX4FaRNzW2QKBgQDurWDX3Jh+3Q+raQy4\n" +
"qyN3WZ4XUPzmVoQ11+GY/SkcFXK3r6xD+FZtjUv8yugarnjdYPeG3SUJKhEhVnl8\n" +
"Ja2CLruZB6sbfsQ2lA9vKR87upWV4DJftuAdFnWVVMD6ti1KCTHIDiUl0YAxWF6A\n" +
"EGKDrzQIVdTtBn6+Hrhn59AYtQKBgQDl5eKQiyA1wQ/nO4u+VskcrBcaTQJjNysz\n" +
"mo9k+jpJQqVrJ2kNopbkaZyz74IXI73rQ8CmctAPrSiucj1SeMBWWPWXDC+hxzjV\n" +
"NURdmEh7D0fpKAknn2WPrIDrqLgsVTiCEX/XicX3eCTuKf+mSUwv//6MFhDIntC4\n" +
"2PdCtMD/JwKBgBFEH55eCfYbfdezmMT/NGic5g/fvvvWxGe0v1A2+DNc5did78NX\n" +
"AsGYGCgocZQEjR/OtPlfpB8+mNClldJCU4P4Z3/RizJJAF7GZTtwaR8EB3A5MMu1\n" +
"yg6woj70S6WXaj1R3vUO+Ob8ed6X+vYeuVG3afc0ZlvjPWX5iPOTVH2FAoGAYqnc\n" +
"KChtNGSczKITgSaBvRpl99Wg9q+QjN8CN1XkedhuYaRSQ5XJqFFi/R4G+KNQOI2l\n" +
"Okn/3Rp1YRiKFMDZ2rTnAWIrdwSm8Wmg44IdaSLPu9KAy05vKc/grEKGeBBC5h9Y\n" +
"fEoWefRH9SZ1HwpJ9jepKLm3jkIKVapXw3sLcPUCgYBdbDosTe2LtF2buaNsBMQw\n" +
"H3c9fHllrDSy2Twr12ShSc5xMIqTWtiTAvEcMZYP4BX9uSPUWwaB7wMBx2CCMsXR\n" +
"sZLRujRKV9s5qSmUOXHQWIcmsEvjyxiNtVNhi3rXeMMgYISleUH4ife4evulPHzD\n" +
"gppAplykAFg49TGEqr7ihQ==\n" +
"-----END PRIVATE KEY-----";
/**
* Provides parameters for tests.
* @return A list of methods used to create GitHubChecksContexts, with which each test should be run.
*/
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> contextBuilders() {
return Arrays.asList(new Object[][]{
{"Freestyle (run)", (Function<GitHubChecksPublisherITest, GitHubChecksContext>) GitHubChecksPublisherITest::createGitHubChecksContextWithGitHubSCMFreestyle, false},
{"Freestyle (job)", (Function<GitHubChecksPublisherITest, GitHubChecksContext>) GitHubChecksPublisherITest::createGitHubChecksContextWithGitHubSCMFreestyle, true},
{"Pipeline (run)", (Function<GitHubChecksPublisherITest, GitHubChecksContext>) GitHubChecksPublisherITest::createGitHubChecksContextWithGitHubSCMFromPipeline, false},
{"Pipeline (job)", (Function<GitHubChecksPublisherITest, GitHubChecksContext>) GitHubChecksPublisherITest::createGitHubChecksContextWithGitHubSCMFromPipeline, true}
});
}
/**
* Human readable name of the context builder - used only for test name formatting.
*/
@SuppressWarnings("checkstyle:VisibilityModifier")
@Parameterized.Parameter(0)
public String contextBuilderName;
/**
* Reference to method used to create GitHubChecksContext with either a pipeline or freestyle job.
*/
@SuppressWarnings("checkstyle:VisibilityModifier")
@Parameterized.Parameter(1)
public Function<GitHubChecksPublisherITest, GitHubChecksContext> contextBuilder;
/**
* Create GitHubChecksContext from the job instead of the run.
*/
@SuppressWarnings("checkstyle:VisibilityModifier")
@Parameterized.Parameter(2)
public boolean fromJob;
/**
* Rule for the log system.
*/
@Rule
public LoggerRule loggerRule = new LoggerRule();
@Rule
public JenkinsRule j = new JenkinsRule();
/**
* A rule which provides a mock server.
*/
@Rule
public WireMockRule wireMockRule = new WireMockRule(
WireMockConfiguration.options().dynamicPort());
/**
* Checks should be published to GitHub correctly when GitHub SCM is found and parameters are correctly set.
*/
@Test
public void shouldPublishGitHubCheckRunCorrectly() {
loggerRule.record(GitHubChecksPublisher.class.getName(), Level.WARNING).capture(1);
ChecksDetails details = new ChecksDetailsBuilder()
.withName("Jenkins")
.withStatus(ChecksStatus.COMPLETED)
.withDetailsURL("https://ci.jenkins.io")
.withStartedAt(LocalDateTime.ofEpochSecond(999_999, 0, ZoneOffset.UTC))
.withCompletedAt(LocalDateTime.ofEpochSecond(999_999, 0, ZoneOffset.UTC))
.withConclusion(ChecksConclusion.SUCCESS)
.withOutput(new ChecksOutputBuilder()
.withTitle("Jenkins Check")
.withSummary("# A Successful Build")
.withText("## 0 Failures")
.withAnnotations(Arrays.asList(
new ChecksAnnotationBuilder()
.withPath("Jenkinsfile")
.withLine(1)
.withAnnotationLevel(ChecksAnnotationLevel.NOTICE)
.withMessage("say hello to Jenkins")
.withStartColumn(0)
.withEndColumn(20)
.withTitle("Hello Jenkins")
.withRawDetails("a simple echo command")
.build(),
new ChecksAnnotationBuilder()
.withPath("Jenkinsfile")
.withLine(2)
.withAnnotationLevel(ChecksAnnotationLevel.WARNING)
.withMessage("say hello to GitHub Checks API")
.withStartColumn(0)
.withEndColumn(30)
.withTitle("Hello GitHub Checks API")
.withRawDetails("a simple echo command")
.build()))
.withImages(Collections.singletonList(
new ChecksImage("Jenkins",
"https://ci.jenkins.io/static/cd5757a8/images/jenkins-header-logo-v2.svg",
"Jenkins Symbol")))
.build())
.withActions(Collections.singletonList(
new ChecksAction("re-run", "re-run Jenkins build", "#0")))
.build();
new GitHubChecksPublisher(contextBuilder.apply(this),
new PluginLogger(j.createTaskListener().getLogger(), "GitHub Checks"),
wireMockRule.baseUrl())
.publish(details);
assertThat(loggerRule.getRecords().size()).isEqualTo(1);
assertThat(loggerRule.getMessages().get(0))
.contains("has been published.")
.contains("status: COMPLETED")
.contains("name: Jenkins")
.contains("url: example.com");
}
/**
* If exception happens when publishing checks, it should output all parameters of the check to the system log.
*/
@Issue("issue-20")
@Test
public void shouldLogChecksParametersIfExceptionHappensWhenPublishChecks() {
loggerRule.record(GitHubChecksPublisher.class.getName(), Level.WARNING).capture(1);
ChecksDetails details = new ChecksDetailsBuilder()
.withName("Jenkins")
.withStatus(ChecksStatus.COMPLETED)
.withConclusion(ChecksConclusion.SUCCESS)
.withOutput(new ChecksOutputBuilder()
.withTitle("Jenkins Check")
.withSummary("# A Successful Build")
.withAnnotations(Collections.singletonList(
new ChecksAnnotationBuilder()
.withPath("Jenkinsfile")
.withStartLine(1)
.withEndLine(2)
.withStartColumn(0)
.withEndColumn(20)
.withAnnotationLevel(ChecksAnnotationLevel.WARNING)
.withMessage("say hello to Jenkins")
.build()))
.build())
.build();
new GitHubChecksPublisher(contextBuilder.apply(this),
new PluginLogger(j.createTaskListener().getLogger(), "GitHub Checks"),
wireMockRule.baseUrl())
.publish(details);
assertThat(loggerRule.getRecords().size()).isEqualTo(1);
assertThat(loggerRule.getMessages().get(0))
.contains("Failed Publishing GitHub checks: ")
.contains("name='Jenkins'")
.contains("status=COMPLETED")
.contains("conclusion=SUCCESS")
.contains("title='Jenkins Check'")
.contains("summary='# A Successful Build'")
.contains("path='Jenkinsfile'")
.contains("startLine=1")
.contains("endLine=2")
.contains("startColumn=0")
.contains("endColumn=20")
.contains("annotationLevel=WARNING")
.contains("message='say hello to Jenkins'");
}
/**
* We can't mock the id field on {@link org.kohsuke.github.GHObject}s thanks to {@link com.infradna.tool.bridge_method_injector.WithBridgeMethods}.
* So, create a stub GHCheckRun with the id we want.
* @param id id of check run to spoof
* @return Stubbed {@link GHCheckRun} with only the id of {@link GHCheckRun} set
*/
private GHCheckRun createStubCheckRun(final long id) throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibility(new VisibilityChecker.Std(NONE, NONE, NONE, NONE, ANY));
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS, true);
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
InjectableValues.Std std = new InjectableValues.Std();
std.addValue("org.kohsuke.github.connector.GitHubConnectorResponse", null);
std.addValue("org.kohsuke.github.GitHub", null);
ObjectReader reader = mapper.reader(std).forType(GHCheckRun.class);
return reader.readValue(String.format("{\"id\": %d}", id));
}
/**
* Test that publishing a second check with the same name will update rather than overwrite the existing check.
*/
@Test
@SuppressFBWarnings(value = "RCN", justification = "False positive of SpotBugs")
public void testChecksPublisherUpdatesCorrectly() throws Exception {
GitHub gitHub = mock(GitHub.class);
GHRepository repository = mock(GHRepository.class);
when(gitHub.getRepository(anyString())).thenReturn(repository);
long checksId1 = 1000;
long checksId2 = 2000;
String checksName1 = "Test Updating";
String checksName2 = "Different Tests";
GHCheckRunBuilder createBuilder1 = mock(GHCheckRunBuilder.class, RETURNS_SELF);
GHCheckRunBuilder createBuilder2 = mock(GHCheckRunBuilder.class, RETURNS_SELF);
GHCheckRunBuilder updateBuilder1 = mock(GHCheckRunBuilder.class, RETURNS_SELF);
GHCheckRun createResult1 = createStubCheckRun(checksId1);
GHCheckRun createResult2 = createStubCheckRun(checksId2);
doReturn(createResult1).when(createBuilder1).create();
doReturn(createResult2).when(createBuilder2).create();
doReturn(createResult1).when(updateBuilder1).create();
when(repository.createCheckRun(eq(checksName1), anyString())).thenReturn(createBuilder1);
when(repository.createCheckRun(eq(checksName2), anyString())).thenReturn(createBuilder2);
when(repository.updateCheckRun(checksId1)).thenReturn(updateBuilder1);
try (MockedStatic<Connector> connector = mockStatic(Connector.class)) {
connector.when(() -> Connector.connect(anyString(), any(GitHubAppCredentials.class))).thenReturn(gitHub);
GitHubChecksContext context = contextBuilder.apply(this);
ChecksDetails details1 = new ChecksDetailsBuilder()
.withName(checksName1)
.withStatus(ChecksStatus.IN_PROGRESS)
.build();
GitHubChecksPublisher publisher = new GitHubChecksPublisher(context,
new PluginLogger(j.createTaskListener().getLogger(), "GitHub Checks"),
"https://github.example.com/"
);
assertThat(context.getId(checksName1)).isNotPresent();
assertThat(context.getId(checksName2)).isNotPresent();
publisher.publish(details1);
verify(createBuilder1, times(1)).create();
verify(createBuilder2, never()).create();
verify(updateBuilder1, never()).create();
if (fromJob) {
assertThat(context.getId(checksName1)).isNotPresent();
}
else {
assertThat(context.getId(checksName1)).isPresent().get().isEqualTo(checksId1);
}
assertThat(context.getId(checksName2)).isNotPresent();
ChecksDetails details2 = new ChecksDetailsBuilder()
.withName(checksName2)
.withStatus(ChecksStatus.COMPLETED)
.withConclusion(ChecksConclusion.SUCCESS)
.build();
publisher.publish(details2);
verify(createBuilder1, times(1)).create();
verify(createBuilder2, times(1)).create();
verify(updateBuilder1, never()).create();
if (fromJob) {
assertThat(context.getId(checksName1)).isNotPresent();
assertThat(context.getId(checksName1)).isNotPresent();
}
else {
assertThat(context.getId(checksName1)).isPresent().get().isEqualTo(checksId1);
assertThat(context.getId(checksName2)).isPresent().get().isEqualTo(checksId2);
}
ChecksDetails updateDetails1 = new ChecksDetailsBuilder()
.withName(checksName1)
.withStatus(ChecksStatus.COMPLETED)
.withConclusion(ChecksConclusion.FAILURE)
.build();
publisher.publish(updateDetails1);
verify(createBuilder1, times(fromJob ? 2 : 1)).create();
verify(createBuilder2, times(1)).create();
verify(updateBuilder1, times(fromJob ? 0 : 1)).create();
if (fromJob) {
assertThat(context.getId(checksName1)).isNotPresent();
assertThat(context.getId(checksName1)).isNotPresent();
}
else {
assertThat(context.getId(checksName1)).isPresent().get().isEqualTo(checksId1);
assertThat(context.getId(checksName2)).isPresent().get().isEqualTo(checksId2);
}
}
}
private GitHubChecksContext createGitHubChecksContextWithGitHubSCMFreestyle() {
try {
FreeStyleProject job = j.createFreeStyleProject();
return createGitHubChecksContextWithGitHubSCM(job);
} catch (Exception e) {
throw new AssertionError(e);
}
}
private GitHubChecksContext createGitHubChecksContextWithGitHubSCMFromPipeline() {
try {
WorkflowJob job = j.createProject(WorkflowJob.class);
job.setDefinition(new CpsFlowDefinition("node {}", true));
return createGitHubChecksContextWithGitHubSCM(job);
} catch (Exception e) {
throw new AssertionError(e);
}
}
private Run<?, ?> buildSuccessfully(ParameterizedJobMixIn.ParameterizedJob<?, ?> job) throws Exception {
return j.assertBuildStatus(Result.SUCCESS, job.scheduleBuild2(0, new Action[0]));
}
private <R extends Run<J, R> & Queue.Executable, J extends Job<J, R> & ParameterizedJobMixIn.ParameterizedJob<J, R>>
GitHubChecksContext createGitHubChecksContextWithGitHubSCM(final J job) throws Exception {
Run run = buildSuccessfully(job);
SCMFacade scmFacade = mock(SCMFacade.class);
GitHubSCMSource source = mock(GitHubSCMSource.class);
SCMHead head = mock(SCMHead.class);
PullRequestSCMRevision revision = mock(PullRequestSCMRevision.class);
ClassicDisplayURLProvider urlProvider = mock(ClassicDisplayURLProvider.class);
when(source.getCredentialsId()).thenReturn("1");
when(source.getRepoOwner()).thenReturn("XiongKezhi");
when(source.getRepository()).thenReturn("Sandbox");
GitHubAppCredentials gitHubAppCredentials = new GitHubAppCredentials(CredentialsScope.GLOBAL,
"cred-id", null, "app-id", Secret.fromString(TEST_PRIVATE_KEY));
when(scmFacade.findGitHubSCMSource(job)).thenReturn(Optional.of(source));
when(scmFacade.findGitHubAppCredentials(job, "1")).thenReturn(Optional.of(gitHubAppCredentials));
when(scmFacade.findHead(job)).thenReturn(Optional.of(head));
when(scmFacade.findRevision(source, run)).thenReturn(Optional.of(revision));
when(scmFacade.findRevision(source, head)).thenReturn(Optional.of(revision));
when(scmFacade.findHash(revision)).thenReturn(Optional.of("18c8e2fd86e7aa3748e279c14a00dc3f0b963e7f"));
when(urlProvider.getRunURL(run)).thenReturn("https://ci.jenkins.io");
when(urlProvider.getJobURL(job)).thenReturn("https://ci.jenkins.io");
if (fromJob) {
return GitHubSCMSourceChecksContext.fromJob(job, urlProvider.getJobURL(job), scmFacade);
}
return GitHubSCMSourceChecksContext.fromRun(run, urlProvider.getRunURL(run), scmFacade);
}
}