Update URL locations

Signed-off-by: Taylor Smock <tsmock@meta.com>
pull/3/head
Taylor Smock 2022-10-10 08:49:07 -06:00
rodzic 207161b6c6
commit 96503e69d0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
13 zmienionych plików z 39 dodań i 39 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
# JOSM MapWithAI Plugin (formerly RapiD Plugin) # JOSM MapWithAI Plugin (formerly RapiD Plugin)
[![pipeline status](https://gitlab.com/gokaart/JOSM_MapWithAI/badges/master/pipeline.svg)](https://gitlab.com/gokaart/JOSM_MapWithAI/commits/master) [![pipeline status](https://github.com/JOSM/MapWithAI/actions/workflows/ant.yml/badge.svg)](https://github.com/JOSM/MapWithAI/actions/workflows/ant.yml)
[![code coverage](https://gitlab.com/gokaart/JOSM_MapWithAI/badges/master/coverage.svg)](https://codecov.io/github/gokaart/JOSM_MapWithAI?branch=master) [![code coverage](https://gitlab.com/gokaart/JOSM_MapWithAI/badges/master/coverage.svg)](https://codecov.io/github/gokaart/JOSM_MapWithAI?branch=master)
[![license](https://img.shields.io/badge/license-GPLv2-blue.svg?style=flat-square)](./LICENSE) [![license](https://img.shields.io/badge/license-GPLv2-blue.svg?style=flat-square)](./LICENSE)
@ -22,7 +22,7 @@ See the [wiki page](https://josm.openstreetmap.de/wiki/Help/Plugin/MapWithAI).
## Contributing ## Contributing
- The **source code** is hosted on [GitLab](https://gitlab.com/gokaart/JOSM_MapWithAI). - The **source code** is hosted on [GitHub](https://github.com/JOSM/MapWithAI).
- **Issues** are managed in [JOSM Trac](https://josm.openstreetmap.de/query?status=assigned&status=needinfo&status=new&status=reopened&component=Plugin+mapwithai&group=component&max=200&col=id&col=summary&col=component&col=status&col=type&col=priority&order=priority&report=17) - **Issues** are managed in [JOSM Trac](https://josm.openstreetmap.de/query?status=assigned&status=needinfo&status=new&status=reopened&component=Plugin+mapwithai&group=component&max=200&col=id&col=summary&col=component&col=status&col=type&col=priority&order=priority&report=17)
- Report a [New Ticket](https://josm.openstreetmap.de/newticket?component=Plugin+mapwithai) - Report a [New Ticket](https://josm.openstreetmap.de/newticket?component=Plugin+mapwithai)
- **Translations** are not currently done. - **Translations** are not currently done.

Wyświetl plik

@ -225,16 +225,16 @@ spotless {
josm { josm {
debugPort = 7055 debugPort = 7055
manifest { manifest {
oldVersionDownloadLink 17903, "v1.8.7", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.8.7/mapwithai.jar") oldVersionDownloadLink 17903, "v1.8.7", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.8.7/mapwithai.jar")
oldVersionDownloadLink 17084, "v1.7.1.6", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.7.1.6/mapwithai.jar") oldVersionDownloadLink 17084, "v1.7.1.6", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.7.1.6/mapwithai.jar")
oldVersionDownloadLink 16645, "v1.6.8", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.6.8/mapwithai.jar") oldVersionDownloadLink 16645, "v1.6.8", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.6.8/mapwithai.jar")
oldVersionDownloadLink 16284, "v1.5.10", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.5.10/mapwithai.jar") oldVersionDownloadLink 16284, "v1.5.10", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.5.10/mapwithai.jar")
oldVersionDownloadLink 16220, "v1.4.7", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.4.7/mapwithai.jar") oldVersionDownloadLink 16220, "v1.4.7", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.4.7/mapwithai.jar")
oldVersionDownloadLink 15820, "v1.3.11", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.3.11/mapwithai.jar") oldVersionDownloadLink 15820, "v1.3.11", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.3.11/mapwithai.jar")
oldVersionDownloadLink 15737, "v1.2.7", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.2.7/mapwithai.jar") oldVersionDownloadLink 15737, "v1.2.7", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.2.7/mapwithai.jar")
oldVersionDownloadLink 15609, "v1.1.12", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.1.12/mapwithai.jar") oldVersionDownloadLink 15609, "v1.1.12", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.1.12/mapwithai.jar")
oldVersionDownloadLink 15542, "v1.0.9", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v1.0.9/mapwithai.jar") oldVersionDownloadLink 15542, "v1.0.9", new URL("https://github.com/JOSM/MapWithAI/releases/download/v1.0.9/mapwithai.jar")
oldVersionDownloadLink 15233, "v0.2.14", new URL("https://gokaart.gitlab.io/JOSM_MapWithAI/dist/v0.2.14/mapwithai.jar") oldVersionDownloadLink 15233, "v0.2.14", new URL("https://github.com/JOSM/MapWithAI/releases/download/v0.2.14/mapwithai.jar")
} }
i18n { i18n {
pathTransformer = getPathTransformer(project.projectDir, "gitlab.com/${gitlabGroup}/${gitlabRepositoryName}/blob") pathTransformer = getPathTransformer(project.projectDir, "gitlab.com/${gitlabGroup}/${gitlabRepositoryName}/blob")

Wyświetl plik

@ -8,7 +8,7 @@ plugin.canloadatruntime = true
plugin.author = Taylor Smock plugin.author = Taylor Smock
plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin plugin.class = org.openstreetmap.josm.plugins.mapwithai.MapWithAIPlugin
plugin.icon = images/dialogs/mapwithai.svg plugin.icon = images/dialogs/mapwithai.svg
plugin.link = https://gitlab.com/gokaart/JOSM_MapWithAI plugin.link = https://github.com/JOSM/MapWithAI
plugin.description = Allows the use of MapWithAI data in JOSM (same data as used in RapiD) plugin.description = Allows the use of MapWithAI data in JOSM (same data as used in RapiD)
plugin.requires = utilsplugin2;apache-http plugin.requires = utilsplugin2;apache-http

Wyświetl plik

@ -185,7 +185,7 @@ public class MapWithAIPreferences extends DefaultTabPreferenceSetting {
kaartLogo.addMouseListener(new MouseAdapter() { kaartLogo.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
OpenBrowser.displayUrl("https://gitlab.com/gokaart/JOSM_MapWithAI"); OpenBrowser.displayUrl("https://github.com/JOSM/MapWithAI");
} }
}); });
kaartLogo.setCursor(new Cursor(Cursor.HAND_CURSOR)); kaartLogo.setCursor(new Cursor(Cursor.HAND_CURSOR));

Wyświetl plik

@ -402,8 +402,8 @@ public class MapWithAIProvidersPanel extends JPanel {
add(defaultToolbar, GBC.eol().anchor(GBC.SOUTH).insets(0, 0, 5, 0)); add(defaultToolbar, GBC.eol().anchor(GBC.SOUTH).insets(0, 0, 5, 0));
HtmlPanel help = new HtmlPanel( HtmlPanel help = new HtmlPanel(
tr("New default entries can be added in the <a href=\"{0}\">GitLab Repository</a>.", tr("New default entries can be added in the <a href=\"{0}\">GitHub Repository</a>.",
"https://gitlab.com/gokaart/JOSM_MapWithAI/-/blob/pages/public/json/sources.json")); "https://github.com/JOSM/MapWithAI/blob/pages/json/sources.json"));
help.enableClickableHyperlinks(); help.enableClickableHyperlinks();
add(help, GBC.eol().insets(10, 0, 0, 0).fill(GBC.HORIZONTAL)); add(help, GBC.eol().insets(10, 0, 0, 0).fill(GBC.HORIZONTAL));

Wyświetl plik

@ -29,7 +29,7 @@ import org.openstreetmap.josm.tools.Territories;
* definition file. * definition file.
* <p> * <p>
* The format is specified in the <a href= * The format is specified in the <a href=
* "https://gitlab.com/gokaart/JOSM_MapWithAI/-/blob/pages/public/json/sources.json">MapWithAI * "https://github.com/JOSM/MapWithAI/blob/pages/json/sources.json">MapWithAI
* source</a>. * source</a>.
*/ */
public class MapWithAISourceReader extends CommonSourceReader<List<MapWithAIInfo>> implements Closeable { public class MapWithAISourceReader extends CommonSourceReader<List<MapWithAIInfo>> implements Closeable {

Wyświetl plik

@ -2,10 +2,12 @@
package org.openstreetmap.josm.plugins.mapwithai.spi.preferences; package org.openstreetmap.josm.plugins.mapwithai.spi.preferences;
public class MapWithAIUrls implements IMapWithAIUrls { public class MapWithAIUrls implements IMapWithAIUrls {
/** The base url */
private static final String BASE_URL = "https://josm.github.io/MapWithAI/";
/** The default url for additional conflation servers */ /** The default url for additional conflation servers */
private static final String DEFAULT_CONFLATION_JSON = "https://gokaart.gitlab.io/JOSM_MapWithAI/json/conflation_servers.json"; private static final String DEFAULT_CONFLATION_JSON = BASE_URL + "json/conflation_servers.json";
/** The default URL for the MapWithAI sources */ /** The default URL for the MapWithAI sources */
private static final String DEFAULT_MAPWITHAI_SOURCES_JSON = "https://gokaart.gitlab.io/JOSM_MapWithAI/json/sources.json"; private static final String DEFAULT_MAPWITHAI_SOURCES_JSON = BASE_URL + "json/sources.json";
/** The default url for the MapWithAI paint style */ /** The default url for the MapWithAI paint style */
private static final String DEFAULT_PAINT_STYLE_RESOURCE_URL = "https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1"; private static final String DEFAULT_PAINT_STYLE_RESOURCE_URL = "https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1";

Wyświetl plik

@ -25,7 +25,7 @@ import org.openstreetmap.josm.tools.Logging;
* *
*/ */
public final class BlacklistUtils { public final class BlacklistUtils {
static final String DEFAULT_BLACKLIST_URL = "https://gokaart.gitlab.io/JOSM_MapWithAI/json/blacklisted_versions.json"; static final String DEFAULT_BLACKLIST_URL = "https://josm.github.io/MapWithAI/json/blacklisted_versions.json";
private static String blacklistUrl = DEFAULT_BLACKLIST_URL; private static String blacklistUrl = DEFAULT_BLACKLIST_URL;
private BlacklistUtils() { private BlacklistUtils() {

Wyświetl plik

@ -2,7 +2,7 @@
"id" : "fb2197f1-81fd-445d-bb90-b6219d187af6", "id" : "fb2197f1-81fd-445d-bb90-b6219d187af6",
"name" : "josm_mapwithai_json_conflation_serversjson", "name" : "josm_mapwithai_json_conflation_serversjson",
"request" : { "request" : {
"url" : "/JOSM_MapWithAI/json/conflation_servers.json", "url" : "/MapWithAI/json/conflation_servers.json",
"method" : "GET" "method" : "GET"
}, },
"response" : { "response" : {
@ -21,4 +21,4 @@
"uuid" : "fb2197f1-81fd-445d-bb90-b6219d187af6", "uuid" : "fb2197f1-81fd-445d-bb90-b6219d187af6",
"persistent" : true, "persistent" : true,
"insertionIndex" : 43 "insertionIndex" : 43
} }

Wyświetl plik

@ -2,7 +2,7 @@
"id" : "23497750-675c-440a-986a-34dd14b047f8", "id" : "23497750-675c-440a-986a-34dd14b047f8",
"name" : "josm_mapwithai_json_sourcesjson", "name" : "josm_mapwithai_json_sourcesjson",
"request" : { "request" : {
"urlPattern" : "(\/gokaart)?\/JOSM_MapWithAI\/(-\/raw\/pages\/public\/)?json\/sources.json", "urlPattern" : "\/MapWithAI\/?json\/sources.json",
"method" : "GET" "method" : "GET"
}, },
"response" : { "response" : {

Wyświetl plik

@ -50,12 +50,12 @@ public @interface MapWithAIConfig {
@Override @Override
public String getConflationServerJson() { public String getConflationServerJson() {
return this.wireMockServer.baseUrl() + "/JOSM_MapWithAI/json/conflation_servers.json"; return this.wireMockServer.baseUrl() + "/MapWithAI/json/conflation_servers.json";
} }
@Override @Override
public String getMapWithAISourcesJson() { public String getMapWithAISourcesJson() {
return this.wireMockServer.baseUrl() + "/JOSM_MapWithAI/json/sources.json"; return this.wireMockServer.baseUrl() + "/MapWithAI/json/sources.json";
} }
@Override @Override

Wyświetl plik

@ -184,8 +184,8 @@ public @interface Wiremock {
if (wireMockServer.getStubMappings().stream().filter(mapping -> mapping.getRequest().getUrl() != null) if (wireMockServer.getStubMappings().stream().filter(mapping -> mapping.getRequest().getUrl() != null)
.noneMatch(mapping -> mapping.getRequest().getUrl() .noneMatch(mapping -> mapping.getRequest().getUrl()
.equals("/JOSM_MapWithAI/json/conflation_servers.json"))) { .equals("/MapWithAI/json/conflation_servers.json"))) {
wireMockServer.stubFor(WireMock.get("/JOSM_MapWithAI/json/conflation_servers.json") wireMockServer.stubFor(WireMock.get("/MapWithAI/json/conflation_servers.json")
.willReturn(WireMock.aResponse().withBody("{}")).atPriority(-5)); .willReturn(WireMock.aResponse().withBody("{}")).atPriority(-5));
} }
} }

Wyświetl plik

@ -40,7 +40,7 @@ class BlacklistUtilsTest {
TestUtils.assumeWorkingJMockit(); TestUtils.assumeWorkingJMockit();
wireMock = new WireMockServer(options().dynamicPort()); wireMock = new WireMockServer(options().dynamicPort());
wireMock.start(); wireMock.start();
BlacklistUtils.setBlacklistUrl(wireMock.baseUrl() + "/JOSM_MapWithAI/json/blacklisted_versions.json"); BlacklistUtils.setBlacklistUrl(wireMock.baseUrl() + "/MapWithAI/json/blacklisted_versions.json");
new MapWithAIPluginMock(); new MapWithAIPluginMock();
} }
@ -58,7 +58,7 @@ class BlacklistUtilsTest {
@Test @Test
void testArrayBad() { void testArrayBad() {
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")) wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
.willReturn(aResponse().withStatus(200).withBody("[\"" + MapWithAIPlugin.getVersionInfo() + "\"]")) .willReturn(aResponse().withStatus(200).withBody("[\"" + MapWithAIPlugin.getVersionInfo() + "\"]"))
.build()); .build());
assertTrue(BlacklistUtils.isBlacklisted()); assertTrue(BlacklistUtils.isBlacklisted());
@ -66,37 +66,35 @@ class BlacklistUtilsTest {
@Test @Test
void testArrayGood() { void testArrayGood() {
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")) wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
.willReturn(aResponse().withStatus(200).withBody("[null, 0, false]")).build()); .willReturn(aResponse().withStatus(200).withBody("[null, 0, false]")).build());
assertFalse(BlacklistUtils.isBlacklisted()); assertFalse(BlacklistUtils.isBlacklisted());
} }
@Test @Test
void testObjectBad() { void testObjectBad() {
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")) wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(aResponse()
.willReturn(aResponse().withStatus(200) .withStatus(200).withBody("{ \"" + MapWithAIPlugin.getVersionInfo() + "\": \"reason here\"}")).build());
.withBody("{ \"" + MapWithAIPlugin.getVersionInfo() + "\": \"reason here\"}"))
.build());
assertTrue(BlacklistUtils.isBlacklisted()); assertTrue(BlacklistUtils.isBlacklisted());
} }
@Test @Test
void testObjectGood() { void testObjectGood() {
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")) wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
.willReturn(aResponse().withStatus(200).withBody("{ \"version\": \"reason here\"}")).build()); .willReturn(aResponse().withStatus(200).withBody("{ \"version\": \"reason here\"}")).build());
assertFalse(BlacklistUtils.isBlacklisted()); assertFalse(BlacklistUtils.isBlacklisted());
} }
@Test @Test
void testNullJson() { void testNullJson() {
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")) wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json"))
.willReturn(aResponse().withStatus(200).withBody("null")).build()); .willReturn(aResponse().withStatus(200).withBody("null")).build());
assertTrue(BlacklistUtils.isBlacklisted()); assertTrue(BlacklistUtils.isBlacklisted());
} }
@Test @Test
void testBrokenJson() { void testBrokenJson() {
wireMock.addStubMapping(get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")).willReturn( wireMock.addStubMapping(get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(
aResponse().withStatus(200).withBody("{ \"" + MapWithAIPlugin.getVersionInfo() + "\": \"reason here\"")) aResponse().withStatus(200).withBody("{ \"" + MapWithAIPlugin.getVersionInfo() + "\": \"reason here\""))
.build()); .build());
assertTrue(BlacklistUtils.isBlacklisted()); assertTrue(BlacklistUtils.isBlacklisted());
@ -105,14 +103,14 @@ class BlacklistUtilsTest {
@Test @Test
void testNoResponse() { void testNoResponse() {
wireMock.addStubMapping( wireMock.addStubMapping(
get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")).willReturn(noContent()).build()); get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(noContent()).build());
assertTrue(BlacklistUtils.isBlacklisted()); assertTrue(BlacklistUtils.isBlacklisted());
} }
@Test @Test
void testNotFound() { void testNotFound() {
wireMock.addStubMapping( wireMock.addStubMapping(
get(urlMatching("/JOSM_MapWithAI/json/blacklisted_versions.json")).willReturn(notFound()).build()); get(urlMatching("/MapWithAI/json/blacklisted_versions.json")).willReturn(notFound()).build());
assertTrue(BlacklistUtils.isBlacklisted()); assertTrue(BlacklistUtils.isBlacklisted());
} }
} }