This is an automated email from the ASF dual-hosted git repository.

Cole-Greer pushed a commit to branch 3.7-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/3.7-dev by this push:
     new 3a216a7fb7 Fix automatic GLV version propagation (#3547)
3a216a7fb7 is described below

commit 3a216a7fb7a33c70ad80049835c2fc620a93f367
Author: Cole Greer <[email protected]>
AuthorDate: Thu Jul 23 15:10:38 2026 -0700

    Fix automatic GLV version propagation (#3547)
---
 docs/src/dev/developer/release.asciidoc            |  7 ++--
 gremlin-javascript/pom.xml                         | 24 +++++++++----
 gremlin-python/pom.xml                             | 41 ++++++++++++++++++++++
 .../src/main/python/gremlin_python/__init__.py     |  2 +-
 gremlint/pom.xml                                   | 37 ++++++++++---------
 5 files changed, 84 insertions(+), 27 deletions(-)

diff --git a/docs/src/dev/developer/release.asciidoc 
b/docs/src/dev/developer/release.asciidoc
index f6374fda9a..0a72ace472 100644
--- a/docs/src/dev/developer/release.asciidoc
+++ b/docs/src/dev/developer/release.asciidoc
@@ -149,8 +149,8 @@ deployment.
 . `docker/build.sh -t -i -n`
 . `bin/publish-docs.sh <username>` - note that under a release candidate the 
documentation is published as SNAPSHOT
 . `mvn versions:set -DnewVersion=xx.yy.zz -DgenerateBackupPoms=false` to 
update the project files to reference a non-SNAPSHOT version
-.. Manually update the `__version__` for `gremlin-python` in 
`gremlin-python/src/main/python/gremlin_python/__init__.py`
 . `mvn clean install -DskipTests` to update GLV versions
+.. Review `__init__.py` in `gremlin-python`
 .. Review `Gremlin.Net.csproj`, `Gremlin.Net.Template.csproj` and 
`Gremlin.Net.Template.nuspec` in `gremlin-dotnet`
 .. Review `package.json` and `package-lock.json` in `gremlin-javascript` and 
in `gremlint`
 . `pushd gremlin-console/bin; ln -fs 
../target/apache-tinkerpop-gremlin-console-xx.yy.zz-standalone/bin/gremlin.sh 
gremlin.sh; popd`
@@ -159,8 +159,8 @@ deployment.
 . `git tag -a -m "TinkerPop xx.yy.zz release" xx.yy.zz` and `git push --tags`
 . `mvn clean install`
 . `mvn versions:set -DnewVersion=xx.yy.zz-SNAPSHOT -DgenerateBackupPoms=false` 
to go back to SNAPSHOT
-.. Manually update the `__version__` for `gremlin-python` in 
`gremlin-python/src/main/python/gremlin_python/__init__.py` to a dev version 
like `xx.yy.zz.dev1`
 . `mvn clean install -DskipTests` to update GLV versions
+.. Review `__init__.py` in `gremlin-python`
 .. Review `Gremlin.Net.csproj`, `Gremlin.Net.Template.csproj` and 
`Gremlin.Net.Template.nuspec` in `gremlin-dotnet`
 .. Review `package.json` and `package-lock.json` in `gremlin-javascript` and 
in `gremlint`
 . `pushd gremlin-console/bin; ln -fs 
../target/apache-tinkerpop-gremlin-console-xx.yy.zz-SNAPSHOT-standalone/bin/gremlin.sh
 gremlin.sh; popd`
@@ -210,8 +210,8 @@ current release was under development as this new release 
will have those change
 .. Update the release date.
 .. Update the link to `CHANGELOG.asciidoc` - this link may already be correct 
but will not exist until the repository is tagged.
 . `mvn versions:set -DnewVersion=xx.yy.zz -DgenerateBackupPoms=false` to 
update project files to reference the non-SNAPSHOT version
-.. Manually update the `__version__` for `gremlin-python` in 
`gremlin-python/src/main/python/gremlin_python/__init__.py`
 . `mvn clean install -DskipTests` to update GLV versions
+.. Review `__init__.py` in `gremlin-python`
 .. Review `Gremlin.Net.csproj`, `Gremlin.Net.Template.csproj` and 
`Gremlin.Net.Template.nuspec` in `gremlin-dotnet`
 .. Review `package.json` and `package-lock.json` in `gremlin-javascript` and 
in `gremlint`
 . `pushd gremlin-console/bin; ln -fs 
../target/apache-tinkerpop-gremlin-console-xx.yy.zz-standalone/bin/gremlin.sh 
gremlin.sh; popd`
@@ -320,6 +320,7 @@ the help of a PMC member for those steps.
 .. Make the appropriate branching changes as required by the release and bump 
the version to `SNAPSHOT` with
 `mvn versions:set -DnewVersion=xx.yy.zz-SNAPSHOT -DgenerateBackupPoms=false`.
 . `mvn clean install -DskipTests` to update GLV versions
+.. Review `__init__.py` in `gremlin-python`
 .. Review `Gremlin.Net.csproj`, `Gremlin.Net.Template.csproj` and 
`Gremlin.Net.Template.nuspec` in `gremlin-dotnet`
 .. Review `package.json` and `package-lock.json` in `gremlin-javascript` and 
in `gremlint`
 .. `pushd gremlin-console/bin; ln -fs 
../target/apache-tinkerpop-gremlin-console-xx.yy.zz-SNAPSHOT-standalone/bin/gremlin.sh
 gremlin.sh; popd`
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index dea2967ef9..5c5d84081b 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -101,7 +101,7 @@ limitations under the License.
                         </configuration>
                     </execution>
                     <execution>
-                        <id>update-version</id>
+                        <id>compute-js-version</id>
                         <phase>generate-sources</phase>
                         <goals>
                             <goal>execute</goal>
@@ -109,11 +109,10 @@ limitations under the License.
                         <configuration>
                             <scripts>
                                 <script>
-                                    def mavenVersion = "${project.version}"
-                                    def versionForJs = 
mavenVersion.replace("-SNAPSHOT", "-alpha1")
-                                    def platformAgnosticBaseDirPath = 
project.basedir.getAbsolutePath().replace("\\", "/")
-                                    def file = new 
File(platformAgnosticBaseDirPath + 
"/src/main/javascript/gremlin-javascript/package.json")
-                                    
file.write(file.getText("UTF-8").replaceFirst(/"version": "(.*)",/, 
"\"version\": \"" + versionForJs + "\","))
+                                    // npm doesn't understand Maven's 
"-SNAPSHOT" suffix, so translate it to a
+                                    // valid semver pre-release tag for use by 
the "npm version" execution below.
+                                    def versionForJs = 
"${project.version}".replace("-SNAPSHOT", "-alpha1")
+                                    
project.properties.setProperty("versionForJs", versionForJs)
                                 </script>
                             </scripts>
                         </configuration>
@@ -171,6 +170,19 @@ limitations under the License.
                             <failOnError>true</failOnError>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>npm version</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+                        <configuration>
+                            <!--
+                            Update TinkerPop version in package.json and 
package-lock.json
+                            -->
+                            <arguments>version ${versionForJs} 
--no-git-tag-version --allow-same-version --ignore-scripts</arguments>
+                        </configuration>
+                    </execution>
                     <execution>
                         <id>npm jsdoc</id>
                         <goals>
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index 21ccc02a84..0a667b0eeb 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -82,6 +82,47 @@ limitations under the License.
                     </replacements>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.gmavenplus</groupId>
+                <artifactId>gmavenplus-plugin</artifactId>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.groovy</groupId>
+                        <artifactId>groovy-all</artifactId>
+                        <version>${groovy.version}</version>
+                        <type>pom</type>
+                        <scope>runtime</scope>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>update-version</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            <scripts>
+                                <script>
+                                    def mavenVersion = "${project.version}"
+                                    // Translate Maven version to PEP 440:
+                                    //   "x.y.z-SNAPSHOT" -> "x.y.z.dev1"
+                                    //   "x.y.z"          -> "x.y.z"
+                                    def pythonVersion = 
mavenVersion.replace("-SNAPSHOT", ".dev1")
+                                    def platformAgnosticBaseDirPath = 
project.basedir.getAbsolutePath().replace("\\", "/")
+                                    def file = new 
File(platformAgnosticBaseDirPath + 
"/src/main/python/gremlin_python/__init__.py")
+                                    def contents = file.getText("UTF-8")
+                                    def versionPattern = /__version__ = '.*'/
+                                    if (!(contents =~ versionPattern)) {
+                                        throw new RuntimeException("Could not 
find __version__ assignment matching " + versionPattern.toString() + " in " + 
file.getAbsolutePath() + " - the file's format may have changed.")
+                                    }
+                                    
file.write(contents.replaceFirst(versionPattern, "__version__ = '" + 
pythonVersion + "'"))
+                                </script>
+                            </scripts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 
diff --git a/gremlin-python/src/main/python/gremlin_python/__init__.py 
b/gremlin-python/src/main/python/gremlin_python/__init__.py
index b75d38083b..abd215479b 100644
--- a/gremlin-python/src/main/python/gremlin_python/__init__.py
+++ b/gremlin-python/src/main/python/gremlin_python/__init__.py
@@ -18,4 +18,4 @@
 #
 
 __author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
-__version__ = '3.7.7.dev1'
+__version__ = '3.7.7.dev1' # Do not touch, updated automatically from maven
diff --git a/gremlint/pom.xml b/gremlint/pom.xml
index 43984f33c0..a07398585f 100644
--- a/gremlint/pom.xml
+++ b/gremlint/pom.xml
@@ -47,7 +47,7 @@ limitations under the License.
             <plugin>
                 <!--
                 Use gmavenplus-plugin to:
-                    - Update version number
+                    - Compute the npm-compatible version string
                 -->
                 <groupId>org.codehaus.gmavenplus</groupId>
                 <artifactId>gmavenplus-plugin</artifactId>
@@ -62,28 +62,18 @@ limitations under the License.
                 </dependencies>
                 <executions>
                     <execution>
-                        <id>update-version</id>
-                        <phase>generate-sources</phase>
+                        <id>compute-js-version</id>
+                        <phase>generate-resources</phase>
                         <goals>
                             <goal>execute</goal>
                         </goals>
                         <configuration>
-                            <properties>
-                                <property>
-                                    <name>projectBaseDir</name>
-                                    <value>${project.basedir}</value>
-                                </property>
-                                <property>
-                                    <name>mavenVersion</name>
-                                    <value>${project.version}</value>
-                                </property>
-                            </properties>
                             <scripts>
                                 <script>
-                                    def versionForJs = 
mavenVersion.replace("-SNAPSHOT", "-alpha1")
-                                    def platformAgnosticBaseDirPath = 
project.basedir.getAbsolutePath().replace("\\","/")
-                                    def file = new 
File(platformAgnosticBaseDirPath + "/package.json")
-                                    
file.write(file.getText("UTF-8").replaceFirst(/"version": "(.*)",/, 
"\"version\": \"" + versionForJs + "\","))
+                                    // npm doesn't understand Maven's 
"-SNAPSHOT" suffix, so translate it to a
+                                    // valid semver pre-release tag for use by 
the "npm version" execution below.
+                                    def versionForJs = 
"${project.version}".replace("-SNAPSHOT", "-alpha1")
+                                    
project.properties.setProperty("versionForJs", versionForJs)
                                 </script>
                             </scripts>
                         </configuration>
@@ -122,6 +112,19 @@ limitations under the License.
                             <arguments>ci</arguments>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>npm version</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+                        <configuration>
+                            <!--
+                            Update TinkerPop version in package.json and 
package-lock.json
+                            -->
+                            <arguments>version ${versionForJs} 
--no-git-tag-version --allow-same-version --ignore-scripts</arguments>
+                        </configuration>
+                    </execution>
                     <execution>
                         <id>npm test</id>
                         <phase>test</phase>

Reply via email to