[JIRA] [build-name-setter-plugin] (JENKINS-24277) BUILD_USER_ID not available for build-name-setter plugin.

7 views
Skip to first unread message

slide.o.mix@gmail.com (JIRA)

unread,
Oct 27, 2015, 10:02:05 AM10/27/15
to jenkinsc...@googlegroups.com
Alex Earl commented on Bug JENKINS-24277
 
Re: BUILD_USER_ID not available for build-name-setter plugin.

What version of token macro do you have installed?

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

leomichine@gmail.com (JIRA)

unread,
Nov 6, 2015, 2:09:01 AM11/6/15
to jenkinsc...@googlegroups.com

It seems you need to use $

{ENV, var="BUILD_USER_ID"}

leomichine@gmail.com (JIRA)

unread,
Nov 6, 2015, 2:09:02 AM11/6/15
to jenkinsc...@googlegroups.com
Lev Mishin edited a comment on Bug JENKINS-24277

leomichine@gmail.com (JIRA)

unread,
Nov 6, 2015, 2:26:05 AM11/6/15
to jenkinsc...@googlegroups.com
Lev Mishin assigned an issue to Lev Mishin
 
Jenkins / Bug JENKINS-24277
Change By: Lev Mishin
Assignee: Kohsuke Kawaguchi Lev Mishin

leomichine@gmail.com (JIRA)

unread,
Nov 6, 2015, 2:28:01 AM11/6/15
to jenkinsc...@googlegroups.com
Lev Mishin edited a comment on Bug JENKINS-24277
It seems you need to use
${ENV, var="BUILD_USER_ID"}
 
 

so the bug is not related to build-name-setter, please read about Token macro plugin to know how to write macros correctly

slide.o.mix@gmail.com (JIRA)

unread,
Nov 6, 2015, 5:01:02 AM11/6/15
to jenkinsc...@googlegroups.com

$BUILD_USER_ID should work since TokenMacro.expandAll is being used. It's possible that the variables aren't available because build-user-vars isn't setting them up correctly. I am not familiar with that plugin.

leomichine@gmail.com (JIRA)

unread,
Apr 24, 2016, 4:52:01 AM4/24/16
to jenkinsc...@googlegroups.com

Damien Nozay please check if the bug still persists and let me know.
Also please provide more detailed description (reproduce steps including setting BUILD_USER_ID)

leomichine@gmail.com (JIRA)

unread,
Apr 24, 2016, 4:52:01 AM4/24/16
to jenkinsc...@googlegroups.com
Lev Mishin started work on Bug JENKINS-24277
 
Change By: Lev Mishin
Status: Open In Progress

leomichine@gmail.com (JIRA)

unread,
Apr 24, 2016, 4:52:01 AM4/24/16
to jenkinsc...@googlegroups.com
Lev Mishin resolved as Cannot Reproduce
 
Change By: Lev Mishin
Status: In Progress Resolved
Resolution: Cannot Reproduce

leomichine@gmail.com (JIRA)

unread,
Apr 24, 2016, 10:43:01 AM4/24/16
to jenkinsc...@googlegroups.com

leomichine@gmail.com (JIRA)

unread,
May 10, 2016, 2:18:01 PM5/10/16
to jenkinsc...@googlegroups.com
Lev Mishin closed an issue as Cannot Reproduce
Change By: Lev Mishin
Status: Resolved Closed

mmh19891113@qq.com (JIRA)

unread,
Apr 24, 2020, 10:52:03 AM4/24/20
to jenkinsc...@googlegroups.com
Minghui Ma commented on Bug JENKINS-24277
 
Re: BUILD_USER_ID not available for build-name-setter plugin.

The BUILD_USER_* variables were init  by plugin "Jenkins user build vars plugin",   this plugin execute after plugin " Build Name and Description Setter".

when you configure the plugin "Build Name and Description Setter",  you can choose "Set build name before build starts" or "Set build name after build ends".

The two plugin execution sequence maybe like this: 

①"Build Name and Description Setter" if you choose "Set build name before build starts"  -->  ②"Jenkins user build vars plugin" init BUILD_USER_* variables --> ③"Build Name and Description Setter" if you choose "Set build name after build ends".

 

The order of execution is determined by "Extension ordinal value", but the two plugin set this value is zero. so the order is determined by getDisplayName() value.

the displayname one is "Set Build Name"  another is  "Set jenkins user build variables".  

 

 the source code is here

 



    /**
     * Sort {@link ExtensionComponent}s in the descending order of {@link #ordinal()}.
     */
    public int compareTo(ExtensionComponent<T> that) {
        double a = this.ordinal();
        double b = that.ordinal();
        if (a>b)    return -1;
        if (a<b)    return 1;        // make the order bit more deterministic among extensions of the same ordinal
        if (this.instance instanceof Descriptor && that.instance instanceof Descriptor) {
            try {
                return Util.fixNull(((Descriptor)this.instance).getDisplayName()).compareTo(Util.fixNull(((Descriptor)that.instance).getDisplayName()));
            } catch (RuntimeException | LinkageError x) {
                LOG.log(Level.WARNING, null, x);
            }
        }
        return this.instance.getClass().getName().compareTo(that.instance.getClass().getName());
    }







 

 

Is my analysis correct ???

 

 

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

mmh19891113@qq.com (JIRA)

unread,
Apr 24, 2020, 10:56:03 AM4/24/20
to jenkinsc...@googlegroups.com
Minghui Ma edited a comment on Bug JENKINS-24277
The BUILD_USER_* variables were init  by plugin "Jenkins user build vars plugin",   this plugin execute after plugin " Build Name and Description Setter".

when you configure the plugin "Build Name and Description Setter",  you can choose "Set build name before build starts" or "Set build name after build ends".

The two plugin execution sequence maybe like this: 

①"Build Name and Description Setter" if you choose "Set build name before build starts"  -->  ②"Jenkins user build vars plugin" init BUILD_USER_* variables --> ③"Build Name and Description Setter" if you choose "Set build name after build ends".

 

The order of execution is determined by "Extension ordinal value", but the two plugin set this value is zero. so the order is determined by getDisplayName() value.

the displayname one is "Set Build Name"  another is  "Set jenkins user build variables".  

 

 the source code is here

 
{code:java}


    /**
     * Sort {@link ExtensionComponent}s in the descending order of {@link #ordinal()}.
     */
    public int compareTo(ExtensionComponent<T> that) {
        double a = this.ordinal();
        double b = that.ordinal();
        if (a>b)    return -1;
        if (a<b)    return 1;        // make the order bit more deterministic among extensions of the same ordinal
        if (this.instance instanceof Descriptor && that.instance instanceof Descriptor) {
            try {
                return Util.fixNull(((Descriptor)this.instance).getDisplayName()).compareTo(Util.fixNull(((Descriptor)that.instance).getDisplayName()));
            } catch (RuntimeException | LinkageError x) {
                LOG.log(Level.WARNING, null, x);
            }
        }
        return this.instance.getClass().getName().compareTo(that.instance.getClass().getName());
    }







{code}

 

 

Is my analysis correct ???

 

 
Reply all
Reply to author
Forward
0 new messages