You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aurora.apache.org by Kevin Sweeney <ke...@apache.org> on 2014/04/08 05:05:16 UTC

[DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Hi all,

Summarizing an IRC discussion with Bhuvan Arumugam I'm convinced we should
use git-describe(1)<https://www.kernel.org/pub/software/scm/git/docs/git-describe.html>
to
generate the embedded version string instead of .auroraversion.

This will require 2 changes. The first is to use git-describe instead of
.auroraversion in our Pants and Gradle buildscripts. The second is to
update release scripts to create a "v-next-snapshot" annotated tag on
master each time we finalize a release.

I think the best way to show it is with this example:

If I create a tag when .auroraversion is updated to a new -snapshot on
master like so (we haven't had a release yet but assume I did this during
the release of 0.4.0):

% git tag -a -m 'Create 0.5.0-snapshot' 0.5.0-snapshot
19e087509cfd6c86c9928ca6c8e8b40068a64f39

Now git-describe gives very nice output on master (we're 192 commits ahead,
and the short hash is there for disambiguation).
% git checkout master
% git describe
0.5.0-snapshot-192-g8846655

Now say I make a new commit.

% cowsay "May the Force be with you" >> README.md
% git diff
diff --git a/README.md b/README.md
index 82096f6..9caf267 100644
--- a/README.md
+++ b/README.md
@@ -9,3 +9,11 @@ Getting Started
 * [Deploying Aurora](docs/deploying-aurora-scheduler.md)
 * [Running a Local Cluster with Vagrant](docs/vagrant.md)
 * More docs coming soon!
+ ___________________________
+< May the Force be with you >
+ ---------------------------
+        \   ^__^
+         \  (oo)\_______
+            (__)\       )\/\
+                ||----w |
+                ||     ||

% git commit -a -m 'Enhance README'
[master 3aef8fd] Enhance README
 1 file changed, 8 insertions(+)

% git describe
0.5.0-snapshot-193-g3aef8fd

Now I have a new unambiguous version number that's monotonically increasing
according to both setuptools and Maven and I didn't need to create dev tags
at all or create a new commit with .auroraversion at all.

% python
> Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
> [GCC 4.8.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from pkg_resources import parse_version
> >>> parse_version('0.5.0-snapshot-193-g3aef8fd') >
> parse_version('0.5.0-snapshot-192-g8846655')
> True



> % jython2.7b1/bin/jython -J-cp Downloads/maven-artifact-3.2.1.jar
> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf8
> *sys-package-mgr*: processing new jar,
> '/home/ksweeney/Downloads/maven-artifact-3.2.1.jar'
> Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)
> [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_51
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from org.apache.maven.artifact.versioning import ComparableVersion
> >>> ComparableVersion('0.5.0-snapshot-193-g3aef8fd') >
> ComparableVersion('0.5.0-snapshot-192-g8846655')
> True
>

Please discuss.

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Bhuvan Arumugam <bh...@apache.org>.
Kevin, now that development for v0.5.1 is started, can you create the
tag for this release, 0.5.1?

On Wed, Apr 9, 2014 at 2:03 PM, Jay Buffington <me...@jaybuff.com> wrote:
> On Wed, Apr 9, 2014 at 1:55 PM, Kevin Sweeney <ke...@apache.org> wrote:
>
>> My thought is that if I want to build the source distributions that got
>> published for release 0.5.0 I should be able to clone the repo, run git
>> checkout 0.5.0, ./gradlew ...; ./pants ... and produce the same things we
>> publish to the apache mirrors. It's my understanding that ASF convention is
>> to have -rcN versions come before the unqualified release so we'd have
>> 0.5.0-rc1, then 0.5.0-rc2, then finally 0.5.0. I guess the -snapshot could
>> be considered superfluous here.
>>
>>
> +1 for dropping the -snapshot and everything else you said.  The 0.5.0 tag
> would be annotated and the 0.5.0-rc1 and 0.5.0-rc2 tags would be
> lightweight.
>
> Jay



-- 
Regards,
Bhuvan Arumugam
www.livecipher.com

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Jay Buffington <me...@jaybuff.com>.
On Wed, Apr 9, 2014 at 1:55 PM, Kevin Sweeney <ke...@apache.org> wrote:

> My thought is that if I want to build the source distributions that got
> published for release 0.5.0 I should be able to clone the repo, run git
> checkout 0.5.0, ./gradlew ...; ./pants ... and produce the same things we
> publish to the apache mirrors. It's my understanding that ASF convention is
> to have -rcN versions come before the unqualified release so we'd have
> 0.5.0-rc1, then 0.5.0-rc2, then finally 0.5.0. I guess the -snapshot could
> be considered superfluous here.
>
>
+1 for dropping the -snapshot and everything else you said.  The 0.5.0 tag
would be annotated and the 0.5.0-rc1 and 0.5.0-rc2 tags would be
lightweight.

Jay

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Kevin Sweeney <ke...@apache.org>.
My thought is that if I want to build the source distributions that got
published for release 0.5.0 I should be able to clone the repo, run git
checkout 0.5.0, ./gradlew ...; ./pants ... and produce the same things we
publish to the apache mirrors. It's my understanding that ASF convention is
to have -rcN versions come before the unqualified release so we'd have
0.5.0-rc1, then 0.5.0-rc2, then finally 0.5.0. I guess the -snapshot could
be considered superfluous here.


On Wed, Apr 9, 2014 at 1:40 PM, Jay Buffington <me...@jaybuff.com> wrote:

> On Mon, Apr 7, 2014 at 8:05 PM, Kevin Sweeney <ke...@apache.org> wrote:
>
> >
> > If I create a tag when .auroraversion is updated to a new -snapshot on
> > master like so (we haven't had a release yet but assume I did this during
> > the release of 0.4.0):
> >
> > % git tag -a -m 'Create 0.5.0-snapshot' 0.5.0-snapshot
> > 19e087509cfd6c86c9928ca6c8e8b40068a64f39
> >
>
> What is the point of the "-snapshot" in the tag name?
>
> The linux kernel does this:
>
>     $ git tag -l |grep 3.14
>     v3.14
>     v3.14-rc1
>     v3.14-rc2
>     v3.14-rc3
>     v3.14-rc4
>     v3.14-rc5
>     v3.14-rc6
>     v3.14-rc7
>     v3.14-rc8
>
>     $ git describe
>     v3.14-12236-g39de65a
>
> Git itself follows that same pattern:
>
>     $ git tag -l |grep 1.9
>     v1.9-rc0
>     v1.9-rc1
>     v1.9-rc2
>     v1.9.0
>     v1.9.0-rc3
>     v1.9.1
>
>     $ git describe
>     v1.9.1-506-g7bf272c
>

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Jay Buffington <me...@jaybuff.com>.
On Mon, Apr 7, 2014 at 8:05 PM, Kevin Sweeney <ke...@apache.org> wrote:

>
> If I create a tag when .auroraversion is updated to a new -snapshot on
> master like so (we haven't had a release yet but assume I did this during
> the release of 0.4.0):
>
> % git tag -a -m 'Create 0.5.0-snapshot' 0.5.0-snapshot
> 19e087509cfd6c86c9928ca6c8e8b40068a64f39
>

What is the point of the "-snapshot" in the tag name?

The linux kernel does this:

    $ git tag -l |grep 3.14
    v3.14
    v3.14-rc1
    v3.14-rc2
    v3.14-rc3
    v3.14-rc4
    v3.14-rc5
    v3.14-rc6
    v3.14-rc7
    v3.14-rc8

    $ git describe
    v3.14-12236-g39de65a

Git itself follows that same pattern:

    $ git tag -l |grep 1.9
    v1.9-rc0
    v1.9-rc1
    v1.9-rc2
    v1.9.0
    v1.9.0-rc3
    v1.9.1

    $ git describe
    v1.9.1-506-g7bf272c

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Bhuvan Arumugam <bh...@apache.org>.
On Mon, Apr 7, 2014 at 8:35 PM, Bill Farner <wf...@apache.org> wrote:
> Plucking from the man page:
>
> NAME
>        git-describe - Show the most recent tag that is reachable from a
> commit

We don't fall apart from this purpose. By default git-describe honor
annotated tags unless --tags option is specified.

As long as we create an annotated tag on master, using -a switch to
"git tag" when creating snapshot tags, we are good. "git describe"
does the right thing.

-- 
Regards,
Bhuvan Arumugam
www.livecipher.com

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Kevin Sweeney <ke...@apache.org>.
Since we create release and rc (and currently dev) tags on a terminal
branch they don't show in the history for master. Similarly rc and release
tags will always resolve to themselves.

On Monday, April 7, 2014, Bill Farner <wf...@apache.org> wrote:

> Plucking from the man page:
>
> NAME
>        git-describe - Show the most recent tag that is reachable from a
> commit
>
> Does this proposal fall apart if/when we start using tags for other
> purposes?
>
> -=Bill
>
>
> On Mon, Apr 7, 2014 at 8:05 PM, Kevin Sweeney <kevints@apache.org<javascript:;>>
> wrote:
>
> > Hi all,
> >
> > Summarizing an IRC discussion with Bhuvan Arumugam I'm convinced we
> should
> > use git-describe(1)<
> > https://www.kernel.org/pub/software/scm/git/docs/git-describe.html>
> > to
> > generate the embedded version string instead of .auroraversion.
> >
> > This will require 2 changes. The first is to use git-describe instead of
> > .auroraversion in our Pants and Gradle buildscripts. The second is to
> > update release scripts to create a "v-next-snapshot" annotated tag on
> > master each time we finalize a release.
> >
> > I think the best way to show it is with this example:
> >
> > If I create a tag when .auroraversion is updated to a new -snapshot on
> > master like so (we haven't had a release yet but assume I did this during
> > the release of 0.4.0):
> >
> > % git tag -a -m 'Create 0.5.0-snapshot' 0.5.0-snapshot
> > 19e087509cfd6c86c9928ca6c8e8b40068a64f39
> >
> > Now git-describe gives very nice output on master (we're 192 commits
> ahead,
> > and the short hash is there for disambiguation).
> > % git checkout master
> > % git describe
> > 0.5.0-snapshot-192-g8846655
> >
> > Now say I make a new commit.
> >
> > % cowsay "May the Force be with you" >> README.md
> > % git diff
> > diff --git a/README.md b/README.md
> > index 82096f6..9caf267 100644
> > --- a/README.md
> > +++ b/README.md
> > @@ -9,3 +9,11 @@ Getting Started
> >  * [Deploying Aurora](docs/deploying-aurora-scheduler.md)
> >  * [Running a Local Cluster with Vagrant](docs/vagrant.md)
> >  * More docs coming soon!
> > + ___________________________
> > +< May the Force be with you >
> > + ---------------------------
> > +        \   ^__^
> > +         \  (oo)\_______
> > +            (__)\       )\/\
> > +                ||----w |
> > +                ||     ||
> >
> > % git commit -a -m 'Enhance README'
> > [master 3aef8fd] Enhance README
> >  1 file changed, 8 insertions(+)
> >
> > % git describe
> > 0.5.0-snapshot-193-g3aef8fd
> >
> > Now I have a new unambiguous version number that's monotonically
> increasing
> > according to both setuptools and Maven and I didn't need to create dev
> tags
> > at all or create a new commit with .auroraversion at all.
> >
> > % python
> > > Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
> > > [GCC 4.8.1] on linux2
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > >>> from pkg_resources import parse_version
> > > >>> parse_version('0.5.0-snapshot-193-g3aef8fd') >
> > > parse_version('0.5.0-snapshot-192-g8846655')
> > > True
> >
> >
> >
> > > % jython2.7b1/bin/jython -J-cp Downloads/maven-artifact-3.2.1.jar
> > > Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf8
> > > *sys-package-mgr*: processing new jar,
> > > '/home/ksweeney/Downloads/maven-artifact-3.2.1.jar'
> > > Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)
> > > [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_51
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > >>> from org.apache.maven.artifact.versioning import ComparableVersion
> > > >>> ComparableVersion('0.5.0-snapshot-193-g3aef8fd') >
> > > ComparableVersion('0.5.0-snapshot-192-g8846655')
> > > True
> > >
> >
> > Please discuss.
> >
>


-- 
Sent from Gmail Mobile

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Jay Buffington <me...@jaybuff.com>.
On Mon, Apr 7, 2014 at 8:35 PM, Bill Farner <wf...@apache.org> wrote:

> Plucking from the man page:
>
> NAME
>        git-describe - Show the most recent tag that is reachable from a
> commit
>
> Does this proposal fall apart if/when we start using tags for other
> purposes?
>

Not as long as you use annotated tags only for releases and lightweight
tags for everything else.

>From the git-tag man page:

       Tag objects (created with -a, s, or -u) are called "annotated" tags;
they contain a creation
       date, the tagger name and e-mail, a tagging message, and an optional
GnuPG signature.
       Whereas a "lightweight" tag is simply a name for an object (usually
a commit object).

       Annotated tags are meant for release while lightweight tags are
meant for private or
       temporary object labels. For this reason, some git commands for
naming objects (like git
       describe) will ignore lightweight tags by default.

Re: [DISCUSS] Use $(git describe) output to bake version instead of .auroraversion

Posted by Bill Farner <wf...@apache.org>.
Plucking from the man page:

NAME
       git-describe - Show the most recent tag that is reachable from a
commit

Does this proposal fall apart if/when we start using tags for other
purposes?

-=Bill


On Mon, Apr 7, 2014 at 8:05 PM, Kevin Sweeney <ke...@apache.org> wrote:

> Hi all,
>
> Summarizing an IRC discussion with Bhuvan Arumugam I'm convinced we should
> use git-describe(1)<
> https://www.kernel.org/pub/software/scm/git/docs/git-describe.html>
> to
> generate the embedded version string instead of .auroraversion.
>
> This will require 2 changes. The first is to use git-describe instead of
> .auroraversion in our Pants and Gradle buildscripts. The second is to
> update release scripts to create a "v-next-snapshot" annotated tag on
> master each time we finalize a release.
>
> I think the best way to show it is with this example:
>
> If I create a tag when .auroraversion is updated to a new -snapshot on
> master like so (we haven't had a release yet but assume I did this during
> the release of 0.4.0):
>
> % git tag -a -m 'Create 0.5.0-snapshot' 0.5.0-snapshot
> 19e087509cfd6c86c9928ca6c8e8b40068a64f39
>
> Now git-describe gives very nice output on master (we're 192 commits ahead,
> and the short hash is there for disambiguation).
> % git checkout master
> % git describe
> 0.5.0-snapshot-192-g8846655
>
> Now say I make a new commit.
>
> % cowsay "May the Force be with you" >> README.md
> % git diff
> diff --git a/README.md b/README.md
> index 82096f6..9caf267 100644
> --- a/README.md
> +++ b/README.md
> @@ -9,3 +9,11 @@ Getting Started
>  * [Deploying Aurora](docs/deploying-aurora-scheduler.md)
>  * [Running a Local Cluster with Vagrant](docs/vagrant.md)
>  * More docs coming soon!
> + ___________________________
> +< May the Force be with you >
> + ---------------------------
> +        \   ^__^
> +         \  (oo)\_______
> +            (__)\       )\/\
> +                ||----w |
> +                ||     ||
>
> % git commit -a -m 'Enhance README'
> [master 3aef8fd] Enhance README
>  1 file changed, 8 insertions(+)
>
> % git describe
> 0.5.0-snapshot-193-g3aef8fd
>
> Now I have a new unambiguous version number that's monotonically increasing
> according to both setuptools and Maven and I didn't need to create dev tags
> at all or create a new commit with .auroraversion at all.
>
> % python
> > Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
> > [GCC 4.8.1] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> from pkg_resources import parse_version
> > >>> parse_version('0.5.0-snapshot-193-g3aef8fd') >
> > parse_version('0.5.0-snapshot-192-g8846655')
> > True
>
>
>
> > % jython2.7b1/bin/jython -J-cp Downloads/maven-artifact-3.2.1.jar
> > Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf8
> > *sys-package-mgr*: processing new jar,
> > '/home/ksweeney/Downloads/maven-artifact-3.2.1.jar'
> > Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)
> > [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_51
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> from org.apache.maven.artifact.versioning import ComparableVersion
> > >>> ComparableVersion('0.5.0-snapshot-193-g3aef8fd') >
> > ComparableVersion('0.5.0-snapshot-192-g8846655')
> > True
> >
>
> Please discuss.
>