-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine version from git tags #457
base: master
Are you sure you want to change the base?
Conversation
I've kept this in draft because I wanted to get some feedback if we want this functionality. I thought this is rather controversial because in the past BRouter releases weren't even tagged. |
5fa6653
to
09a73fc
Compare
09a73fc
to
80427ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that with this change the version becomes something like:
> git describe --tags --always --first-parent
v1.6.3-46-g91459db
That does look to me like a good idea.
I'm not a friend of this feature. But I see that sometimes it could be useful to have an extra counter. I've been playing around with your branch.
These are all small side effects, but make development more difficult than necessary. |
I usually just
That's intentional. Version increments should be triggered using tags. A version should uniquely identify a source revision. Increasing version numbers in branches for stuff that isn't released yet is bad style because you can no longer determine the revision from the version number.
I think this can be easily solved using wildcards or getting the version using
We would add a dependency for building with correct version information, which has it's pros and cons. As we had issues in the past with F-Droid builds from development versions I'd like to avoid this issue by either avoiding version increments before releases or automatic versioning using git. |
More personal workflow Same with creator in gpx files. To compare something I use a batch e.g. (very short form) At the end of the development is the final version. Every thing is done. So we can tag it. I know you weren't too happy with my test variant of the two version names. But I still think it's a good and clear idea. Maybe not compliant with all rules, but understood by all testers. And we don't have many. So why scare some away with unsightly and unclear names? If I may express one wish, if already version automatic, I would like to see it that way |
I didn't push the tags to my fork. It works when using the abrensch repository (e.g. our GitHub action) or locally using
The version actually contains more information and an increasing number which shows later commits. You can pick the latest version by sorting, similar to our server.sh
If you already pushed your tag you just follow the guidelines in the git documentation. This is no different when using those version information. The intention of a tag is to identify a version and should match anyway.
I think for testers those names are better because they can determine if they already downloaded this version or some previous version of 1.6.4. Because 1.6.4 is currently a moving target and no version.
Unfortunately that's not possible with com.palantir.git-version, but I think switching to me.qoomon.git-versioning because it's more flexible and doesn't require a workaround for source code archives. |
Thanks for the remarks.
That's a good point. I'll try to find a Windows version of this. But anyway, this is only useful if you focus on one project.
Ok, that's useful info.
Did you try the other one already? And yes, this way of version number contains more information. But always useful? |
ee6aee1
to
72bee72
Compare
How would this work with your current workflow with increasing the version number in a branch? Would another branch/project just use 1.6.5 in this case because the update-version branch already used 1.6.4? I've switched to
Yes, I've moved the version number to
What's the harm of adding this information? You can disable it locally and overwrite the version information by using
|
Great, I had a test with all variantes of cloning, all worked as expected. And ZIP was not breaking.
That are great news as well. |
It works if you follow the instructions above.
I have no idea what that means. |
It means that I have controlled the junit reports.
I did all three export ideas. No version. |
+1 for the concept (I only tested it locally, cannot comment on effects on the CI). BRouter-Web might use a SemVer-compatible version check in the future. For this too keep working with this PR could you please change from hyphen (-) to plus (+) when appending build metadata, see 9. and 10. in spec. Otherwise e.g. |
Conversation continued from #605:
I still don't understand. This very PR does just that, and I already mentioned that it worked just fine in my testing. Nevertheless it has been blocked since nearly 9 months by your objections, despite the author going out of their way to accommodate your concerns. It is not for me to "finish" something here.
@afischerdev Is this still an issue for you? @zod Are you still interested in this? If so, I'd like to encourage you to rebase on master, to bump the fallback version in |
I remember a fallback when git information is not present. Was working well. |
6c607e8
to
81a85dc
Compare
81a85dc
to
8fd348f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update
My tests:
- download your version as zip
generates a brouter-1.7.3-all.jar - cloned version with the recommended steps
generates a brouter-1.7.3+8-gradle-git-version-g8fd348f-all.jar
Both have in RouteServerTest a 'BRouter null'
Please see Standard output at ../brouter-server/build/reports/tests/test/classes/btools.server.RouteServerTest.html
But I think we can ignore that. More tests with the generated jars bring out the expected version in standard output and gpx export.
LGTM (The only additional nit I noticed: Now that we include branch names in build results, we might want to improve sorting in @zod Thank you for rebasing. Note that merging the PR is blocked as long as it still is in draft state. |
Instead of manually specifying the version we can use the git tag information using
com.palantir.git-version
. This gives us sensible version information in branches without manually increasing version numbers.For android
versionCode
there also existsgradle-android-git-version
but it seems rather unmaintained. I think we can come up with some own version based in the palantir plugin which determines ourversionCode
if we want to have it auto generated as well.