rultor icon indicating copy to clipboard operation
rultor copied to clipboard

Build Number

Open sils opened this issue 10 years ago • 19 comments

Hey,

we want to use rultor for deploying our project when stuff gets merged to master. However for that we need some unique ID that is guaranteed to be higher than the last time the action was done, some may call this a build number :) Your docs don't really state such a thing exist, at least I didn't find it.

We'd love to switch to rultor for such things, currently we're using CI which is very comfortable but lacks the "pre-merge-security" and simulating deployment steps on wip branches isn't really the same.

sils avatar Jul 16 '15 20:07 sils

@sils1297 can't you use current date in milliseconds for that?

date +%s 

yegor256 avatar Jul 16 '15 20:07 yegor256

@yegor256 that is a very high number and feels somewhat hacky, I'd rather prefer real build numbers.

sils avatar Jul 16 '15 20:07 sils

@sils1297 each "talk" (a Github issue, for example) in rultor has its own number, and each build inside the talk has a number as well. Thus, we have two numbers... We can expose them both to all scripts, like ${talk} and ${build}. What do you think?

yegor256 avatar Jul 16 '15 20:07 yegor256

@yegor256 sounds good, I assume the build is not unique across talks though? I think people would prefer simplicity, i.e. a simple build number from which in the best case they even can generate an URL to the rultor log. (CircleCI does this.)

sils avatar Jul 16 '15 20:07 sils

@sils1297 yes, each build has a unique number and it's a combination of these two, for example, your build: http://www.rultor.com/t/4513-122032736 Pay attention to the end of the URL. 4513 is the talk number and 122032736 is a unique ID of the build inside the talk. We're using Github message ID for simplicity.

So, a unique address of this build is 4513-122032736

yegor256 avatar Jul 16 '15 20:07 yegor256

@sils1297 but there is no guarantee that they will go consequentially :(

yegor256 avatar Jul 16 '15 20:07 yegor256

@yegor256 so I guess we have no choice but use the good old time at least on short term.

sils avatar Jul 16 '15 20:07 sils

@sils1297 well, we can add a unique incremental number to the system, which will uniquely identify builds across the entire Rultor. It's not a big problem, but do we need this? Let's think.. How much difference will it have from good old date?

yegor256 avatar Jul 16 '15 20:07 yegor256

@yegor256

  • It's a bit less useful because date actually provides a hidden information.
  • It's probably a high number too but probably lower.
  • It doesn't feel hacky for your users because they are just using something as intended. (Actually even providing the date in a $BUILD_NUM variable would be better for the usability I think.)

FWIW, the ideal solution would be a number that is only unique per repository IMO. This would then be a real build number.

Just make sure you use the right time, in some time zones theres summer/winter time and stuff that needs to be avoided. Other than that I see no big risks.

sils avatar Jul 16 '15 21:07 sils

@sils1297 attached this issue to milestone "2.0" (let me know if this is wrong)

alex-palevsky avatar Jul 17 '15 13:07 alex-palevsky

@yegor256 this is your task now,help us

alex-palevsky avatar Jul 17 '15 13:07 alex-palevsky

@yegor256 fyi we ended up using date --utc +%Y%m%d%H%M%S to get the full "meaning" advantage.

sils avatar Jul 18 '15 09:07 sils

@alex-palevsky assign someone else pls

yegor256 avatar Sep 27 '15 02:09 yegor256

@alex-palevsky assign someone else pls

@yegor256 30 points deducted from your rating

alex-palevsky avatar Sep 27 '15 13:09 alex-palevsky

@alex-palevsky assign someone else pls

@yegor256 right, I'll try to find someone else for this task

alex-palevsky avatar Sep 27 '15 13:09 alex-palevsky

@alex-palevsky this is postponed

original-brownbear avatar Feb 22 '16 19:02 original-brownbear

@alex-palevsky this is postponed

@original-brownbear got it, "postponed" label here

alex-palevsky avatar Feb 23 '16 17:02 alex-palevsky

@alex-palevsky this is postponed

@original-brownbear someone else will help in this task, no problem at all

alex-palevsky avatar Feb 23 '16 17:02 alex-palevsky

Job gh:yegor256/rultor#896 is not assigned, can't get performer

0crat avatar Sep 10 '22 04:09 0crat