Skip to content

Commit

Permalink
#90: Use correct field to retrieve Github repository name
Browse files Browse the repository at this point in the history
The Github ALM Binding Web Service uses the `AlmRepo` field to store the repository name, but the Github decorator was using `AlmSlug` to try and retrieve the repository name, so was getting a `null` value back and failing to find a matching repository. Switching to using `AlmRepo` in the decorator overcomes this issues.
  • Loading branch information
ndeitch authored and mc1arke committed May 17, 2020
1 parent 2682ca2 commit 9b3aedf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void createCheckRun(AnalysisDetails analysisDetails, AlmSettingDto almSet
ProjectAlmSettingDto projectAlmSettingDto) throws IOException, GeneralSecurityException {
String apiUrl = almSettingDto.getUrl();
String apiPrivateKey = almSettingDto.getPrivateKey();
String projectPath = projectAlmSettingDto.getAlmSlug();
String projectPath = projectAlmSettingDto.getAlmRepo();
String appId = almSettingDto.getAppId();

RepositoryAuthenticationToken repositoryAuthenticationToken =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void createCheckRunExceptionOnErrorResponse() throws IOException, General
when(graphqlProvider.createGraphQLTemplate()).thenReturn(graphQLTemplate);

ProjectAlmSettingDto projectAlmSettingDto = mock(ProjectAlmSettingDto.class);
when(projectAlmSettingDto.getAlmSlug()).thenReturn("dummy/repo");
when(projectAlmSettingDto.getAlmRepo()).thenReturn("dummy/repo");
AlmSettingDto almSettingDto = mock(AlmSettingDto.class);
when(almSettingDto.getUrl()).thenReturn("http://host.name");
when(almSettingDto.getAppId()).thenReturn("app id");
Expand Down Expand Up @@ -325,7 +325,7 @@ private void createCheckRunHappyPath(QualityGate.Status status) throws IOExcepti
when(graphqlProvider.createGraphQLTemplate()).thenReturn(graphQLTemplate);

ProjectAlmSettingDto projectAlmSettingDto = mock(ProjectAlmSettingDto.class);
when(projectAlmSettingDto.getAlmSlug()).thenReturn("dummy/repo");
when(projectAlmSettingDto.getAlmRepo()).thenReturn("dummy/repo");
AlmSettingDto almSettingDto = mock(AlmSettingDto.class);
when(almSettingDto.getUrl()).thenReturn("http://host.name");
when(almSettingDto.getAppId()).thenReturn("app id");
Expand Down Expand Up @@ -505,4 +505,4 @@ public void checkCorrectDefaultValuesInjected() {
.isEqualTo(new GraphqlCheckRunProvider(new DefaultGraphqlProvider(), clock,
githubApplicationAuthenticationProvider, server));
}
}
}

0 comments on commit 9b3aedf

Please sign in to comment.