@Override public String toString() { return "Branch:" + name + " in " + owner.getUrl(); }
@Override public String toString() { final String url = owner != null ? owner.getUrl().toString() : "unknown"; return "Branch:" + name + " in " + url; }
@Override public String toString() { final String url = owner != null ? owner.getUrl().toString() : "unknown"; return "Branch:" + name + " in " + url; }
public void scanRepository(GHRepository repo) { logger.info("scanning repo: {}", repo.getName()); ObjectNode n = mapper.createObjectNode(); n.put("name", repo.getName()); n.put("description", repo.getDescription()); n.put("fullName", repo.getFullName()); n.put("homepage", repo.getHomepage()); n.put("sshUrl", repo.getSshUrl()); if (repo.getHtmlUrl() != null) { n.put("htmlUrl", repo.getHtmlUrl().toString()); } n.put("url", repo.getUrl().toString()); n.put("gitTransportUrl", repo.getGitTransportUrl()); String cypher = "merge (r:SCMRepo:GitHubRepo {url:{url}}) set r+={props},r.updateTs=timestamp() return r"; getProjector().getNeoRxClient().execCypher(cypher, "url", repo.getUrl().toString(), "props", n); }
for (GHContent content : directoryContent) { if (content.getName().equals(fileName)) { String repoName = StringUtils.substringAfter(repo.getUrl(), "github.com/");
public String forkRepository(String repository, AbstractStep step) throws IOException { GitHub gh = RepairnatorConfig.getInstance().getGithub(); showGitHubRateInformation(gh, step); if (gh.getRateLimit().remaining > 10) { GHRepository originalRepo = gh.getRepository(repository); if (originalRepo != null) { return originalRepo.fork().getUrl().toString(); } } return null; }
public void scanOrganization(GHOrganization org) { try { ObjectNode n = mapper.createObjectNode(); n.put("url", org.getUrl().toString()); if (org.getHtmlUrl() != null) { n.put("htmlUrl", org.getHtmlUrl().toString()); } n.put("name", org.getLogin()); n.put("displayName", org.getName()); String cypher = "merge (o:GitHubOrg {url:{url}}) set o+={props},o.updateTs=timestamp() return o"; getProjector().getNeoRxClient().execCypher(cypher, "url", n.path("url").asText(), "props", n); } catch (IOException e) { throw new MercatorException(e); } try { org.getRepositories().values().forEach(repo -> { scanRepository(repo); String cypher = "match (o:GitHubOrg {url:{orgUrl}}), (r:GitHubRepo {url:{repoUrl}}) merge (o)-[x:CONTAINS]->(r) set x.updateTs=timestamp()"; getProjector().getNeoRxClient().execCypher(cypher, "orgUrl", org.getUrl().toString(), "repoUrl", repo.getUrl().toString()); }); } catch (IOException e) { throw new MercatorException(e); } }
@Override public boolean hasCloneUrl(String url) { if (super.hasCloneUrl(url)) { return true; } return Strings.equalAnyValue(url, repository.getGitTransportUrl(), repository.gitHttpTransportUrl(), repository.getSshUrl(), repository.getUrl(), repository.getSvnUrl()); }
@Override public boolean hasCloneUrl(String url) { if (super.hasCloneUrl(url)) { return true; } return Strings.equalAnyValue(url, repository.getGitTransportUrl(), repository.gitHttpTransportUrl(), repository.getSshUrl(), repository.getUrl(), repository.getSvnUrl()); }
return; URL repoUrl = push.getRepository().getUrl(); final String pusherName = push.getPusher().getName(); LOGGER.info("Received PushEvent for {} from {}", repoUrl, event.getOrigin());
public DynamicProject createNewProject(final GHRepository githubRepository, final String accessToken, final String user) { try { new GithubRepositoryService(githubRepository).linkProjectToCi(accessToken, user); final OrganizationContainer folder = this.organizationRepository.getOrCreateContainer(githubRepository.getOwner().getLogin()); final String projectName = githubRepository.getName(); final DynamicProject project = folder.createProject(DynamicProject.class, projectName); project.setDescription(format("<a href=\"%s\">%s</a>", githubRepository.getUrl(), githubRepository.getUrl())); project.setConcurrentBuild(true); if (StringUtils.isNotEmpty(SetupConfig.get().getLabel())) { project.setAssignedLabel(Jenkins.getInstance().getLabel(SetupConfig.get().getLabel())); } project.addProperty(new ParametersDefinitionProperty(new GithubBranchParameterDefinition("BRANCH", "master", githubRepository.getHtmlUrl().toString()))); project.addProperty(new GithubRepoProperty(githubRepository.getHtmlUrl().toExternalForm())); project.addProperty(new BuildTypeProperty(SetupConfig.get().getDefaultBuildType())); project.addProperty(new DynamicProjectBranchTabsProperty("master")); project.addProperty(new RebuildSettings(true, false)); project.addProperty(new JobUiProperty(SetupConfig.get().isDefaultToNewUi())); project.save(); folder.addItem(project); folder.save(); return project; } catch (final IOException e) { throw new RuntimeException(e); } }