Skip to content
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

Proposal - add a timestamp to metadata of "uncommitted" versions #90

Closed
s4nk opened this issue Jun 15, 2018 · 3 comments
Closed

Proposal - add a timestamp to metadata of "uncommitted" versions #90

s4nk opened this issue Jun 15, 2018 · 3 comments
Milestone

Comments

@s4nk
Copy link

s4nk commented Jun 15, 2018

Use case:
During development cycle I keep experimenting, re-building and re-running my service. I would like the created artifacts (Docker images in my case) to have unique versions, but without commiting every change.

Proposed solution:
Add an ISO 8601 timestamp to version metadata when repository is dirty in


, e.g.:
0.1.0-beta.0.1+e06c68a863eb6ceaf889ee5802f478c10c1464bb.uncommitted.20180615T084953Z

It's fairly simple to implement, I can open a PR if you think it makes sense.

@s4nk s4nk changed the title Proposal - add a timestamp to metadata of "uncommited" versions Proposal - add a timestamp to metadata of "uncommitted" versions Jun 15, 2018
@s4nk
Copy link
Author

s4nk commented Jun 15, 2018

Alternatively the "uncommitted" suffix could become a timestamp instead.

@ajoberstar
Copy link
Owner

ajoberstar commented Jun 16, 2018

Seems worth considering. #86 is going to change the build metadata a little anyway, could change this at the same time.

Part of the deal with that one was to keep the metadata short though. I could see a couple options for this:

  1. 0.1.0-beta.0.1+e06c68a863eb6ceaf889ee5802f478c10c1464bb.uncommitted.20180615T084953Z
  2. 0.1.0-beta.0.1+e06c68a863eb6ceaf889ee5802f478c10c1464bb.20180615T084953Z
  3. 0.1.0-beta.0.1+uncommitted.20180615T084953Z
  4. 0.1.0-beta.0.1+20180615T084953Z
  5. 0.1.0-beta.0.1+uncommitted.1529052593 (use epoch seconds instead of ISO for brevity)

I like dropping the commit hash, since you're in an uncommitted state anyway.

However, this would also have to consider how Gradle sorts versions, which might mean we have to keep the hash.

@ajoberstar ajoberstar added this to the 0.8.0 milestone Jul 4, 2018
ajoberstar added a commit that referenced this issue Jul 4, 2018
Instead of using the hash, if present, and the string 'uncomitted', use
a UTC timestamp. Unique versions allow you to go back to a specific
build more easily.

This may make it harder to distinguish between commit builds and
uncommitted builds, so I could see us adding some identifier back, but
this keeps the versions shorter for now.

This fixes #90.
@s4nk
Copy link
Author

s4nk commented Jul 6, 2018 via email

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

No branches or pull requests

2 participants