GitHubProvider extends DefaultProvider { @Override public void updateStatus(String url, PluginSettings pluginSettings, String prIdStr, String revision, String pipelineStage, String result, String trackbackURL) throws Exception { LOGGER.info("Updating status for '%s' to %s", url, result); String repository = getRepository(url); GHCommitState state = getState(result); String endPointToUse = pluginSettings.getEndPoint(); String usernameToUse = pluginSettings.getUsername(); String passwordToUse = pluginSettings.getPassword(); String oauthAccessTokenToUse = pluginSettings.getOauthToken(); if (StringUtils.isEmpty(endPointToUse)) { endPointToUse = System.getProperty("go.plugin.build.status.github.endpoint"); } if (StringUtils.isEmpty(usernameToUse)) { usernameToUse = System.getProperty("go.plugin.build.status.github.username"); } if (StringUtils.isEmpty(passwordToUse)) { passwordToUse = System.getProperty("go.plugin.build.status.github.password"); } if (StringUtils.isEmpty(oauthAccessTokenToUse)) { oauthAccessTokenToUse = System.getProperty("go.plugin.build.status.github.oauth"); } updateCommitStatus(revision, pipelineStage, trackbackURL, repository, state, usernameToUse, passwordToUse, oauthAccessTokenToUse, endPointToUse); } GitHubProvider(); @Override String pluginId(); @Override String pollerPluginId(); @Override void updateStatus(String url, PluginSettings pluginSettings, String prIdStr, String revision, String pipelineStage,
                             String result, String trackbackURL); @Override List<Map<String, Object>> validateConfig(Map<String, Object> fields); String getRepository(String url); static final String PLUGIN_ID; static final String GITHUB_PR_POLLER_PLUGIN_ID; }
@Ignore("for local runs") @Test public void shouldUpdateStatusForPR() throws Exception { provider.updateStatus("https: }