Repository: Wikidata/Wikidata-Toolkit
Pull request #776 (2023-05-05 13:55:30)

Add release instructions
This is an attempt to codify the practice I have been following recently. Feel free to improve!

wetneb: @Lhaaits let me know if anything is unclear! The goal would be that you are able to do a release on your own.

Patch:
diff --git a/README.md b/README.md
index 2afbd269..c6cbea5e 100644
--- a/README.md
+++ b/README.md
@@ -24,4 +24,20 @@ License: [Apache 2.0](LICENSE.txt)
 
 The development of Wikidata Toolkit has been partially funded by the Wikimedia Foundation under the [Wikibase Toolkit Individual Engagement Grant](https://meta.wikimedia.org/wiki/Grants:IEG/Wikidata_Toolkit), and by the German Research Foundation (DFG) under [Emmy Noether grant KR 4381/1-1 "DIAMOND"](https://ddll.inf.tu-dresden.de/web/DIAMOND/en).
 
-
+How to make a release
+---------------------
+
+During development, the version number in the `pom.xml` files should be the next version number assuming that the next version is a patch release, followed by `-SNAPSHOT`. For instance, if the last version to have been released was `1.2.3`, then the `pom.xml` files should contain `<version>1.2.4-SNAPSHOT</version>`.
+
+1. Pick the version number for the new release you want to publish, following SemVer. If this is going to be a patch release, it should be the version currently in `pom.xml` without the `-SNAPSHOT` suffix. In the following steps, we will assume this new version is `1.2.4`.
+2. Write the new version number in the `pom.xml` files with `mvn versions:set -DnewVersion=1.2.4`
+3. Add some release notes in the `RELEASE-NOTES.md` file at the root of the repository
+4. Commit the changes: `git commit -am "Set version to 1.2.4"`
+5. Add a tag for the version: `git tag -a v1.2.4 -m "Version 1.2.4"`
+6. Write the next version number in the `pom.xml` file, by incrementing the patch release number: `mvn versions:set -DnewVersion=1.2.5-SNAPSHOT`
+7. Commit the changes: `git commit -am "Set version to 1.2.5-SNAPSHOT"`
+8. Push commits and tags: `git push --tags && git push`
+9. In GitHub's UI, create a release by going to https://github.com/Wikidata/Wikidata-Toolkit/releases/new. Pick the tag you just created, give a title to the release and quickly describe the changes since the previous release (see existing releases for examples).
+10. Update the version number mentioned in https://www.mediawiki.org/wiki/Wikidata_Toolkit
+
+The library is automatically packaged and uploaded to Maven Central by the continuous deployment (with GitHub Actions). So is the HTML version of the javadoc (to GitHub Pages).
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index a62049b1..2bb1d822 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -1,6 +1,13 @@
 Wikidata Toolkit Release Notes
 ==============================
 
+Version 0.14.5
+--------------
+
+Bug fixes:
+* fetching of MediaInfo entities by title, when they contain a dash (#777)
+* clear the CSRF editing token if it is no longer valid (#442)
+
 Version 0.14.4
 --------------
 
diff --git a/pom.xml b/pom.xml
index 23a44570..2b9c6a04 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 
 	<groupId>org.wikidata.wdtk</groupId>
 	<artifactId>wdtk-parent</artifactId>
-	<version>0.14.5-SNAPSHOT</version>
+	<version>0.14.6-SNAPSHOT</version>
 	<packaging>pom</packaging>
 
 	<name>Wikidata Toolkit</name>
@@ -72,18 +72,18 @@
 
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<apacheCommonsCompressVersion>1.22</apacheCommonsCompressVersion>
+		<apacheCommonsCompressVersion>1.23.0</apacheCommonsCompressVersion>
 		<apacheCommonsLangVersion>3.12.0</apacheCommonsLangVersion>
 		<apacheCommonsIOVersion>2.11.0</apacheCommonsIOVersion>
-		<jacksonVersion>2.14.2</jacksonVersion>
+		<jacksonVersion>2.15.0</jacksonVersion>
 		<junitVersion>4.13.2</junitVersion>
 		<hamcrestVersion>2.2</hamcrestVersion>
 		<mockitoVersion>4.11.0</mockitoVersion>
 		<rdf4jVersion>3.7.7</rdf4jVersion>
-		<slf4jVersion>2.0.6</slf4jVersion>
+		<slf4jVersion>2.0.7</slf4jVersion>
 		<threetenVersion>1.7.2</threetenVersion>
 		<okhttpSignpostVersion>1.1.0</okhttpSignpostVersion>
-		<okhttpVersion>4.10.0</okhttpVersion>
+		<okhttpVersion>4.11.0</okhttpVersion>
 	</properties>
 
 	<dependencies>
@@ -124,7 +124,7 @@
 				<plugin>
 					<groupId>org.codehaus.mojo</groupId>
 					<artifactId>license-maven-plugin</artifactId>
-					<version>2.0.0</version>
+					<version>2.0.1</version>
 					<configuration/>
 					<executions>
 						<execution>
@@ -183,7 +183,7 @@
 					target JRE (default is 1.5) -->
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-compiler-plugin</artifactId>
-				<version>3.10.1</version>
+				<version>3.11.0</version>
 				<configuration>
 					<source>8</source>
 					<target>8</target>
@@ -207,7 +207,7 @@
 				<!-- Call mvn test jacoco:report to generate test coverage -->
 				<groupId>org.jacoco</groupId>
 				<artifactId>jacoco-maven-plugin</artifactId>
-				<version>0.8.8</version>
+				<version>0.8.10</version>
 				<executions>
 					<execution>
 						<id>prepare-agent</id>
@@ -235,7 +235,7 @@
 				<!-- Plugin for creating Javadocs; goal for preparing docs for upload to github: javadoc:aggregate -->
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>3.4.1</version>
+				<version>3.5.0</version>
 				<configuration>
 					<bottom>
 						<![CDATA[Copyright &#169; {inceptionYear}&#x2013;{currentYear} {organizationName}. Generated from source code published under the Apache License 2.0. For more information, see the <a href="https://www.mediawiki.org/wiki/Wikidata_Toolkit">Wikidata Toolkit homepage</a>]]></bottom>
@@ -266,7 +266,7 @@
 				<!-- Signature -->
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-gpg-plugin</artifactId>
-				<version>3.0.1</version>
+				<version>3.1.0</version>
 				<executions>
 					<execution>
 						<id>sign-artifacts</id>
@@ -281,7 +281,7 @@
 				<!-- Plugin for uploading Javadocs to github; goal: scm-publish:publish-scm -->
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-scm-publish-plugin</artifactId>
-				<version>3.1.0</version>
+				<version>3.2.1</version>
 				<configuration>
 					<checkoutDirectory>${project.build.directory}/scmpublish</checkoutDirectory>
 					<checkinComment>Publishing javadoc for ${project.artifactId}:${project.version}</checkinComment>
diff --git a/wdtk-datamodel/pom.xml b/wdtk-datamodel/pom.xml
index 35619817..03b6418f 100644
--- a/wdtk-datamodel/pom.xml
+++ b/wdtk-datamodel/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-datamodel</artifactId>
diff --git a/wdtk-distribution/pom.xml b/wdtk-distribution/pom.xml
index a976b229..35997ced 100644
--- a/wdtk-distribution/pom.xml
+++ b/wdtk-distribution/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-distribution</artifactId>
@@ -134,7 +134,7 @@
 					<plugin>
 						<groupId>org.apache.maven.plugins</groupId>
 						<artifactId>maven-assembly-plugin</artifactId>
-						<version>3.4.2</version>
+						<version>3.5.0</version>
 						<executions>
 							<execution>
 								<id>create-source-jar</id>
diff --git a/wdtk-dumpfiles/pom.xml b/wdtk-dumpfiles/pom.xml
index 89b37e77..6d4f5dad 100644
--- a/wdtk-dumpfiles/pom.xml
+++ b/wdtk-dumpfiles/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-dumpfiles</artifactId>
diff --git a/wdtk-examples/pom.xml b/wdtk-examples/pom.xml
index 2ceafba6..faa2caee 100644
--- a/wdtk-examples/pom.xml
+++ b/wdtk-examples/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-examples</artifactId>
diff --git a/wdtk-rdf/pom.xml b/wdtk-rdf/pom.xml
index 7116c88f..743930ca 100644
--- a/wdtk-rdf/pom.xml
+++ b/wdtk-rdf/pom.xml
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.wikidata.wdtk</groupId>
     <artifactId>wdtk-parent</artifactId>
-    <version>0.14.5-SNAPSHOT</version>
+    <version>0.14.6-SNAPSHOT</version>
   </parent>
 
   <artifactId>wdtk-rdf</artifactId>
diff --git a/wdtk-storage/pom.xml b/wdtk-storage/pom.xml
index 81fd5738..530f8004 100644
--- a/wdtk-storage/pom.xml
+++ b/wdtk-storage/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-storage</artifactId>
diff --git a/wdtk-util/pom.xml b/wdtk-util/pom.xml
index bc570dc3..ef8c3fe4 100644
--- a/wdtk-util/pom.xml
+++ b/wdtk-util/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-util</artifactId>
diff --git a/wdtk-wikibaseapi/pom.xml b/wdtk-wikibaseapi/pom.xml
index 88b7d8b8..5fc3f499 100644
--- a/wdtk-wikibaseapi/pom.xml
+++ b/wdtk-wikibaseapi/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-wikibaseapi</artifactId>
diff --git a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesAction.java b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesAction.java
index 3ccd4339..7e126cfe 100644
--- a/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesAction.java
+++ b/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesAction.java
@@ -166,7 +166,7 @@ public class WbGetEntitiesAction {
 
 		Map<String, String> parameters = new HashMap<>();
 		parameters.put(ApiConnection.PARAM_ACTION, "wbgetentities");
-		List<String> titlesList = titles == null ? Collections.emptyList() : Arrays.asList(titles.split("-"));
+		List<String> titlesList = titles == null ? Collections.emptyList() : Arrays.asList(titles.split("\\|"));
 
 		if (ids != null) {
 			parameters.put("ids", ids);


Test patch:
diff --git a/wdtk-testing/pom.xml b/wdtk-testing/pom.xml
index a7251245..e4d6510c 100644
--- a/wdtk-testing/pom.xml
+++ b/wdtk-testing/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.wikidata.wdtk</groupId>
 		<artifactId>wdtk-parent</artifactId>
-		<version>0.14.5-SNAPSHOT</version>
+		<version>0.14.6-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>wdtk-testing</artifactId>
diff --git a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesActionTest.java b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesActionTest.java
index dd92cd62..76bf4f49 100644
--- a/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesActionTest.java
+++ b/wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/WbGetEntitiesActionTest.java
@@ -67,6 +67,14 @@ public class WbGetEntitiesActionTest {
 		params.put("ids", "M91629437");
 		this.con.setWebResourceFromPath(params, getClass(),
 				"/wbgetentities-missing-mid.json", CompressionType.NONE);
+		
+        params.clear();
+        params.put("action", "wbgetentities");
+        params.put("format", "json");
+        params.put("titles", "File:Foo-1.png|File:Bar.svg");
+        params.put("sites", "commonswiki");
+        this.con.setWebResourceFromPath(params, getClass(),
+                "/wbgetentities-titles.json", CompressionType.NONE);
 
 		this.action = new WbGetEntitiesAction(this.con, Datamodel.SITE_WIKIDATA);
 
@@ -121,6 +129,21 @@ public class WbGetEntitiesActionTest {
 		assertTrue(result1.containsKey("Q42"));
 		assertEquals(result1, result2);
 	}
+	
+    @Test
+    public void testWbGetEntitiesTitles()
+            throws MediaWikiApiErrorException, IOException {
+        WbGetEntitiesActionData properties = new WbGetEntitiesActionData();
+        properties.titles = "File:Foo-1.png|File:Bar.svg";
+        properties.sites = "commonswiki";
+        Map<String, EntityDocument> result1 = action.wbGetEntities(properties);
+        Map<String, EntityDocument> result2 = action.wbGetEntities(
+                null, properties.sites, properties.titles, properties.props, null, null);
+
+        assertTrue(result1.containsKey("File:Foo-1.png"));
+        assertTrue(result1.containsKey("File:Bar.svg"));
+        assertEquals(result1, result2);
+    }
 
 	@Test(expected = IOException.class)
 	public void testWbGetEntitiesIoError() throws MediaWikiApiErrorException, IOException {
diff --git a/wdtk-wikibaseapi/src/test/resources/wbgetentities-titles.json b/wdtk-wikibaseapi/src/test/resources/wbgetentities-titles.json
new file mode 100644
index 00000000..251f469c
--- /dev/null
+++ b/wdtk-wikibaseapi/src/test/resources/wbgetentities-titles.json
@@ -0,0 +1,39 @@
+{
+    "entities": {
+        "M89": {
+            "pageid": 125658679,
+            "ns": 6,
+            "title": "File:Foo-1.png",
+            "lastrevid": 734839557,
+            "modified": "2023-02-22T14:19:55Z",
+            "type": "mediainfo",
+            "id": "M89",
+            "labels": {
+                "en": {
+                    "language": "en",
+                    "value": "an amazing foo in its natural habitat"
+                }
+            },
+            "descriptions": {},
+            "statements": {}
+        },
+        "M37": {
+            "pageid": 1256586,
+            "ns": 6,
+            "title": "File:Bar.svg",
+            "lastrevid": 7348395,
+            "modified": "2023-02-22T14:19:55Z",
+            "type": "mediainfo",
+            "id": "M37",
+            "labels": {
+                "en": {
+                    "language": "en",
+                    "value": "the coats of arms of Bar"
+                }
+            },
+            "descriptions": {},
+            "statements": {}
+        }
+    },
+    "success": 1
+}