Skip to content

Commit

Permalink
Update the git index application's git repos.
Browse files Browse the repository at this point in the history
  • Loading branch information
merks committed Aug 4, 2023
1 parent d07e068 commit 42d32dc
Showing 1 changed file with 38 additions and 15 deletions.
Expand Up @@ -833,6 +833,16 @@ public class GitIndexApplication implements IApplication
"https://gitlab.eclipse.org/eclipse/scm/scm", //
"https://gitlab.eclipse.org/eclipse/sw361/playground-git", //
"https://gitlab.eclipse.org/eclipse/titan/titan.vs-code-extension", //
"https://github.com/eclipse-babel/translations", //
"https://github.com/eclipse-thingweb/test-things", //
"https://gitlab.eclipse.org/eclipse/autowrx/autowrx", //
"https://gitlab.eclipse.org/eclipse/drops/drops-agent", //
"https://gitlab.eclipse.org/eclipse/openpass/road-logic-suite", //
"https://github.com/eclipse-chariott/chariott-example-applications", //
"https://github.com/eclipse-keypop/keypop-calypso-crypto-asymmetric-cpp-api", //
"https://github.com/eclipse-keypop/keypop-calypso-crypto-symmetric-cpp-api", //
"https://github.com/eclipse-openxilenv/openxilenv", //
"https://github.com/eclipse-velocitas/velocitas-lib", //
"" //
));

Expand Down Expand Up @@ -867,7 +877,6 @@ public class GitIndexApplication implements IApplication
"https://git.eclipse.org/r/gemini.web/org.eclipse.gemini.web.gemini-web-container", //
"https://git.eclipse.org/r/gendoc/org.eclipse.gendoc", //
"https://git.eclipse.org/r/handly/org.eclipse.handly", //
"https://git.eclipse.org/r/hawk/hawk", //
"https://git.eclipse.org/r/henshin/org.eclipse.emft.henshin", //
"https://git.eclipse.org/r/jeetools/webtools.javaee", //
"https://git.eclipse.org/r/jgit/jgit", //
Expand Down Expand Up @@ -931,12 +940,6 @@ public class GitIndexApplication implements IApplication
"https://git.eclipse.org/r/sourceediting/webtools.sourceediting.xsl", //
"https://git.eclipse.org/r/sourceediting/webtools.sourceediting.xsl.tests", //
"https://git.eclipse.org/r/sphinx/org.eclipse.sphinx", //
"https://git.eclipse.org/r/statet/org.eclipse.statet-commons", //
"https://git.eclipse.org/r/statet/org.eclipse.statet-docmlet", //
"https://git.eclipse.org/r/statet/org.eclipse.statet-eutils", //
"https://git.eclipse.org/r/statet/org.eclipse.statet-ltk", //
"https://git.eclipse.org/r/statet/org.eclipse.statet-r", //
"https://git.eclipse.org/r/statet/org.eclipse.statet-rj", //
"https://git.eclipse.org/r/stem/org.eclipse.stem", //
"https://git.eclipse.org/r/stem/org.eclipse.stem.data", //
"https://git.eclipse.org/r/stem/org.eclipse.stem.data.earthscience", //
Expand Down Expand Up @@ -1148,6 +1151,7 @@ public class GitIndexApplication implements IApplication
"https://github.com/eclipse-jdt/eclipse.jdt.core", //
"https://github.com/eclipse-jdt/eclipse.jdt.debug", //
"https://github.com/eclipse-jdt/eclipse.jdt.ui", //
"https://github.com/eclipse-jdtls/eclipse.jdt.ls", //
"https://github.com/eclipse-jsdt/webtools.jsdt", //
"https://github.com/eclipse-justj/justj.tools", //
"https://github.com/eclipse-keypop/keypop-calypso-crypto-asymmetric-java-api", //
Expand Down Expand Up @@ -1187,6 +1191,7 @@ public class GitIndexApplication implements IApplication
"https://github.com/eclipse-opensmartclide/smartclide-service-registry-poc", //
"https://github.com/eclipse-orbit/ebr", //
"https://github.com/eclipse-orbit/orbit", //
"https://github.com/eclipse-orbit/orbit-legacy", //
"https://github.com/eclipse-orbit/orbit-simrel", //
"https://github.com/eclipse-packaging/packages", //
"https://github.com/eclipse-pass/modeshape/", //
Expand Down Expand Up @@ -1313,7 +1318,6 @@ public class GitIndexApplication implements IApplication
"https://github.com/eclipse/eclemma", //
"https://github.com/eclipse/eclipse-collections", //
"https://github.com/eclipse/eclipse-collections-kata", //
"https://github.com/eclipse/eclipse.jdt.ls", //
"https://github.com/eclipse/efbt", //
"https://github.com/eclipse/elk", //
"https://github.com/eclipse/emf-query", //
Expand Down Expand Up @@ -1937,6 +1941,12 @@ public Set<String> getRepositories(String projectID) throws IOException
{
for (var i = 1; i < 10; i++)
{
if (org.startsWith("eclipse/"))
{
System.err.println(org);
org = org.replace('/', '-');
}

var repos = contentHandler.getContent("https://api.github.com/orgs/" + org + "/repos?page=" + i);
var urls = getValues("html_url", repos);
urls.remove("https://github.com/" + org);
Expand Down Expand Up @@ -2032,6 +2042,12 @@ private void cleanupRepos(Set<String> repos)
return true;
}

if (it.matches("https://github.com/[^/]+"))
{
// Remove if it's an organization.
return true;
}

return it.endsWith("/.github") || it.endsWith("/ui-best-practices") || it.endsWith("/.eclipsefdn") || it.contains("www.eclipse.org")
|| it.endsWith(".incubator") || it.contains("website") || it.endsWith(".github.io") || it.endsWith("binaries") || it.contains("-ghsa-");
});
Expand Down Expand Up @@ -2175,15 +2191,22 @@ protected String basicGetContent(URI uri) throws IOException, InterruptedExcepti
requestBuilder.header("X-GitHub-Api-Version", "2022-11-28");
}

var request = requestBuilder.build();
var response = httpClient.send(request, BodyHandlers.ofString());
var statusCode = response.statusCode();
if (statusCode != 200)
try
{
throw new IOException("status code " + statusCode + " -> " + uri);
}
var request = requestBuilder.build();
var response = httpClient.send(request, BodyHandlers.ofString());
var statusCode = response.statusCode();
if (statusCode != 200)
{
throw new IOException("status code " + statusCode + " -> " + uri);
}

return response.body();
return response.body();
}
catch (IOException ex)
{
throw new IOException(ex.getMessage() + " -> " + uri, ex);
}
}

protected Path getCachePath(URI uri)
Expand Down

0 comments on commit 42d32dc

Please sign in to comment.