Is it possible to initialize ${COUNT} to something other than 0?

Follow

Comments

13 comments

  • Avatar
    Justin Boyd

    I was about to ask the same question, we are converting across from Cruisecontrol.NEt and I want to ressed the build number to be the same when we switch over.

  • Avatar
    Santosh Hegde

     


    As of now this is not possible. It's definitely in our backlog. 

  • Avatar
    LeeBenhart

    Any idea when this is planned for implementation?

  • Avatar
    Esko Luontola

    Any progress on this one? Is there a workaround such as editing Go's internal database directly?

  • Avatar
    Esko Luontola

    I was able to change the pipeline counter by connecting directly to the H2 database used by Go. I split one of my projects into two and I wanted the pipeline counter of the extracted project to continue from where it was left, because I use the build numbers as part of the version number. The commands I used to achieve that were:

     

    /etc/init.d/go-server stop
    java -cp /var/lib/go-server/work/Jetty_0_0_0_0_8153_cruise.war__go__.mt8b37/webapp/WEB-INF/lib/h2-1.2.147.jar org.h2.tools.Shell -user sa -url "jdbc:h2:/var/lib/go-server/db/h2db/cruise"

    select * from public.pipelinelabelcounts;
    update public.pipelinelabelcounts set labelcount=213 where pipelinename='jumi-actors';
    quit

    /etc/init.d/go-server start

  • Avatar
    Jack Knight

    Any indication of when this feature might bubble up to the top of the backlog?

     

    Failing that, what's Thoughtworks' view on the H2 hacking solution noted by Esko?

     

    Thanks

  • Avatar
    Raghuram Bharathan

    Hi Jack,  

    We have second thoughts on providing the ability to reset/change the build counter value, due to the potential side-effects it can cause.  However, we are exploring the ability to customise the build label to allow simple operation on ${COUNT} - e.g.  ${COUNT}+100).   But this is still in early analysis.

    We do not recommend recommend altering the database contents manually.  

  • Avatar
    LeeBenhart

    Not being able to initialize the ${COUNT}on a pipeline to some value other than zero is a potential show stopper for us.  We were excited about this possibility as we are hacking our existing solutions to add an offset that is invisible to GO. I am curious about direct editing the database, although not sure how that will play with upgrades, and makes it such that our directors will not be able to easily create pipelines without IT intervention, as this is certainly not something we want to allow everyone to do.  Since you do not recommend directly editing the databse, perhaps you could make an API call available which would allow said functionality?

     

    Lee

  • Avatar
    Bastien Vetault

    Hi,

    Is there any update on the initialisation of the ${COUNT}? This request has been open for a while now.

  • Avatar
    Srinivas Upadhya

    Hi All,

    Ability to initialize counter might have side-effects. There are places where the code is written with the assumption that the pipeline counter starts with 1 & increments by 1 for every new run. We will analyze the full impact of this when we get time.

    For adding capability to do some math on label like ${COUNT}+100 seems to be a feature which needs quiet some thought. It might end up becoming a mini programming language to compute label! We will analyze this separately.

    Going ahead please use Go users / Go developers Google group to discuss this further. You will find the links here: http://www.go.cd/community.

    Regards,

    Srinivas

  • Avatar
    Aaron Tomosky

    Bump.

    Your backlog is 3 years old...

  • Avatar
    Hilverd Reker

    Thanks Esko Luontola!

    How do we vote for this to be implemented?

  • Avatar
    Nick Kovanidis

    I have a similar issue where we find ourselves needing to modify the GO Label $COUNT for various reasons.  

Please sign in to leave a comment.