Skip to content

feat: Refactor handling of project version numbers and tags#1147

Merged
isabelle-dr merged 9 commits intoMobilityData:masterfrom
bdferris-v2:issue/1139/versions
May 24, 2022
Merged

feat: Refactor handling of project version numbers and tags#1147
isabelle-dr merged 9 commits intoMobilityData:masterfrom
bdferris-v2:issue/1139/versions

Conversation

@bdferris-v2
Copy link
Copy Markdown
Collaborator

Per issue #1139, refactor how versions are handled in project.

Currently, project version info is passed in via a versionTag env variable, which is only specified in the Github workflow environment. Consequently, project.version ends up being null when run locally. This causes weirdness for tools that expect a valid version number.

This change switches the project to use the axion-release plugin, which determines the project version by looking at the git repo's tags.

Along with that switch, I've moved the project group and version specification into the root build.gradle allprojects {} such that these values do not need to be specified in each sub-poject.

I also did some related clean-up for our jitpack configuration (and Maven repository modules, should we every decide to publish them). I believe our current jitpack config doesn't actually work correctly because we only publish artifacts from the main package, but not core.

You can see this in practice when looking at:
https://jitpack.io/com/github/MobilityData/gtfs-validator/3.0.1/gtfs-validator-3.0.1.pom

Notice how it has a dependency on the core module but we don't actually publish it anywhere. If you actually attempt to use our project as a jitpack dependency, it will fail.

The change was to also publish the core module and to specify more natural artifact names.

…ject.

Currently, project version info is passed in via a `versionTag` env variable,
which is only specified in the Github workflow environment.  Consequently,
`project.version` ends up being `null` when run locally.  This causes
weirdness for tools that expect a valid version number.

This change switches the project to use the axion-release plugin, which
determines the project version by looking at the git repo's tags.

Along with that switch, I've moved the project group and version
specification into the root build.gradle allprojects {} such that
these values do not need to be specified in each sub-poject.

I also did some related clean-up for our jitpack configuration (and
Maven repository modules, should we every decide to publish them).
I believe our current jitpack config doesn't actually work correctly
because we only publish artifacts from the main package, but not core.

You can see this in practice when looking at:
https://jitpack.io/com/github/MobilityData/gtfs-validator/3.0.1/gtfs-validator-3.0.1.pom

Notice how it has a dependency on the `core` module but we don't
actually publish it anywhere.  If you actually attempt to use our
project as a jitpack dependency, it will fail.

The change was to also publish the core module and to specify more
natural artifact names.
@bdferris-v2
Copy link
Copy Markdown
Collaborator Author

(This isn't ready for review yet. I just wanted to see what would happen with all the workflow tasks.)

longer needed now that project version is determined within Gradle
directly.

Also fixup references to shadow jars, since they no longer include
the versionTag in the filename (also _cli => -cli).
@bdferris-v2 bdferris-v2 linked an issue May 16, 2022 that may be closed by this pull request
@bdferris-v2 bdferris-v2 marked this pull request as ready for review May 16, 2022 23:26
@barbeau barbeau mentioned this pull request May 18, 2022
4 tasks
Copy link
Copy Markdown
Contributor

@maximearmstrong maximearmstrong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bdferris-v2, this looks good! Some thoughts in-line.

I also cleaned up some other variables from the docker config that don't seem to be used.
Copy link
Copy Markdown
Member

@barbeau barbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@barbeau
Copy link
Copy Markdown
Member

barbeau commented May 23, 2022

@bdferris-v2 The branch rules require that the main branch be merged into the PR, if you could do that.

@bdferris-v2
Copy link
Copy Markdown
Collaborator Author

Hopefully should be merged at this point.

@bdferris-v2 bdferris-v2 requested a review from isabelle-dr May 24, 2022 18:24
@isabelle-dr isabelle-dr merged commit b93dc1b into MobilityData:master May 24, 2022
@isabelle-dr
Copy link
Copy Markdown
Contributor

I forgot to add my review before merging: I approve this PR, thanks!

bdferris-v2 added a commit to bdferris-v2/gtfs-validator that referenced this pull request May 25, 2022
maximearmstrong pushed a commit that referenced this pull request May 25, 2022
* Per issue #1139, refactor how versions are handled in project.

Currently, project version info is passed in via a `versionTag` env variable,
which is only specified in the Github workflow environment.  Consequently,
`project.version` ends up being `null` when run locally.  This causes
weirdness for tools that expect a valid version number.

This change switches the project to use the axion-release plugin, which
determines the project version by looking at the git repo's tags.

Along with that switch, I've moved the project group and version
specification into the root build.gradle allprojects {} such that
these values do not need to be specified in each sub-poject.

I also did some related clean-up for our jitpack configuration (and
Maven repository modules, should we every decide to publish them).
I believe our current jitpack config doesn't actually work correctly
because we only publish artifacts from the main package, but not core.

You can see this in practice when looking at:
https://jitpack.io/com/github/MobilityData/gtfs-validator/3.0.1/gtfs-validator-3.0.1.pom

Notice how it has a dependency on the `core` module but we don't
actually publish it anywhere.  If you actually attempt to use our
project as a jitpack dependency, it will fail.

The change was to also publish the core module and to specify more
natural artifact names.

* Remove references to versionTag env variable in workflows.  It is no
longer needed now that project version is determined within Gradle
directly.

Also fixup references to shadow jars, since they no longer include
the versionTag in the filename (also _cli => -cli).

* Restore versionTag behavior for master branch.

We can't update this code until the PR actually goes in on the master
branch.

* Fix typo in yml.

* Download artifacts to separate directories to avoid eventual name conflicts.

* Remove all references to versionTag from docker.yml

I also cleaned up some other variables from the docker config that don't seem to be used.

* Remove all references to versionTag from test_pack_doc.yml

* Add back `tags` output variable, which was improperly removed in the previous commit.

* Resolve TODO to correctly handle -cli.jar reference on master branch now that PR #1147 has been committed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor handling of project version numbers and tags

4 participants