You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "mdedetrich (via GitHub)" <gi...@apache.org> on 2023/08/07 16:30:20 UTC

[GitHub] [incubator-pekko-grpc] mdedetrich opened a new pull request, #145: Derive gradle version from sbt

mdedetrich opened a new pull request, #145:
URL: https://github.com/apache/incubator-pekko-grpc/pull/145

   So I can confirm that the reason behind the gradle plugin not building correctly is that it wasn't setting the version correctly (see https://github.com/apache/incubator-pekko-grpc/actions/runs/5786987516/job/15682898907). After spending the last few hours digging around to figure out how gradle publishing works I came up with an elegant solution that also simplifies whats going on.
   
   Currently the gradle version is manually derived from executing git and parsing the results. Not only is this quite brittle (the sed regex would fail once we start releasing RC's/milestones for this same reason https://github.com/apache/incubator-pekko-http/issues/293#issuecomment-1666861760) but it also requires quite a bit of boilerplate because every single time we need to publish the gradle plugin (whether it is locally, as a snapshot or in production) we have to repeat the boilerplate of deriving the version from git tag and placing it in `~/.version`.
   
   So the best way to solve is this issue is why don't we just get the version directly from sbt? sbt is the source of truth when it comes to versions, its already doing the job deriving the version from a git tag via sbt-dynver and if the gradle plugin was hypothetically written as an sbt build it would be using the same version anyways.
   
   If you want to verify this PR locally, you can just run `./gradlew properties -q | awk '/^version:/ {print $2}'`, `./gradlew properties` is the source of truth for what is the final calculated version.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko-grpc] mdedetrich commented on a diff in pull request #145: Derive gradle version from sbt

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #145:
URL: https://github.com/apache/incubator-pekko-grpc/pull/145#discussion_r1286132333


##########
gradle-plugin/build.gradle:
##########
@@ -2,17 +2,23 @@ plugins {
   id 'groovy'
   id 'java-gradle-plugin'
   id 'maven-publish'
-  id 'com.palantir.git-version' version '0.10.1'

Review Comment:
   This dependency is no longer needed, it was the gradle equivalent of `sbt-dynver` but as can be seen from the referenced github issue below it didn't even work properly which explains all of the manual git calls



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko-grpc] mdedetrich commented on a diff in pull request #145: Derive gradle version from sbt

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #145:
URL: https://github.com/apache/incubator-pekko-grpc/pull/145#discussion_r1286149080


##########
.github/workflows/publish-nightly.yml:
##########
@@ -32,7 +32,7 @@ jobs:
           NEXUS_PW: ${{ secrets.NEXUS_PW }}
 
       - name: Publish Gradle Plugin to Apache Nexus Repository
-        run: cd gradle-plugin && ./gradlew properties -q | awk '/^version:/ {print $2}' && ./gradlew publishToSonatype

Review Comment:
   This was used to print the version, no need for this now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko-grpc] mdedetrich commented on pull request #145: Derive gradle version from sbt

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on PR #145:
URL: https://github.com/apache/incubator-pekko-grpc/pull/145#issuecomment-1668416315

   > the gradle tests are failing - eg https://github.com/apache/incubator-pekko-grpc/actions/runs/5788328185/job/15687098472?pr=145
   
   Yup I am looking into it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko-grpc] mdedetrich commented on a diff in pull request #145: Derive gradle version from sbt

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #145:
URL: https://github.com/apache/incubator-pekko-grpc/pull/145#discussion_r1286132333


##########
gradle-plugin/build.gradle:
##########
@@ -2,17 +2,23 @@ plugins {
   id 'groovy'
   id 'java-gradle-plugin'
   id 'maven-publish'
-  id 'com.palantir.git-version' version '0.10.1'

Review Comment:
   This dependency is no longer needed, it was the gradle equivalent of `sbt-dynver` but as can be seen from the referenced github issue below it didn't even work properly which is explains all of the manual git calls



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko-grpc] mdedetrich commented on pull request #145: Derive gradle version from sbt

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on PR #145:
URL: https://github.com/apache/incubator-pekko-grpc/pull/145#issuecomment-1668469944

   @pjfanning All is good now. The reason for the previous failing test is I used Intellij's inspections to remove unused imports in one of the files I was editing but it turns out that these imports where in fact used and Intellij's suggestion was incorrect due to the Groovy/Gradle SDK not being setup.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko-grpc] mdedetrich merged pull request #145: Derive gradle version from sbt

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich merged PR #145:
URL: https://github.com/apache/incubator-pekko-grpc/pull/145


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org