use of net.nemerosa.ontrack.extension.github.client.OntrackGitHubClient in project ontrack by nemerosa.
the class GitHubIssueServiceExtension method getIssue.
@Override
public Issue getIssue(IssueServiceConfiguration issueServiceConfiguration, String issueKey) {
GitHubIssueServiceConfiguration configuration = (GitHubIssueServiceConfiguration) issueServiceConfiguration;
OntrackGitHubClient client = gitHubClientFactory.create(configuration.getConfiguration());
return client.getIssue(configuration.getRepository(), getIssueId(issueKey));
}
use of net.nemerosa.ontrack.extension.github.client.OntrackGitHubClient in project ontrack by nemerosa.
the class GitHubConfigurationServiceImpl method validate.
@Override
protected ConnectionResult validate(GitHubEngineConfiguration configuration) {
try {
// Gets the client
OntrackGitHubClient client = gitHubClientFactory.create(configuration);
// Gets the list of repositories
client.getRepositories();
// OK
return ConnectionResult.ok();
} catch (Exception ex) {
applicationLogService.log(ApplicationLogEntry.error(ex, NameDescription.nd("github", "GitHub connection issue"), configuration.getUrl()).withDetail("github-config-name", configuration.getName()).withDetail("github-config-url", configuration.getUrl()));
return ConnectionResult.error(ex.getMessage());
}
}
use of net.nemerosa.ontrack.extension.github.client.OntrackGitHubClient in project ontrack by nemerosa.
the class GitHubHealthIndicator method getHealth.
@Override
protected Health getHealth(GitHubEngineConfiguration config) {
try {
// Gets the client
OntrackGitHubClient client = gitHubClientFactory.create(config);
// Gets the list of repositories
client.getRepositories();
// OK
return Health.up().build();
} catch (Exception ex) {
return Health.down(ex).build();
}
}
Aggregations