KBEC-00259 - Preflight auto check-in - setting the user for checking in

Article ID:360033191651
2 minute readKnowledge base

Problem

You want your preflight builds to auto check in as my user instead of the defined user in the SCM configuration.

Solution

There are two users involved:

  • The EC user, i.e. the one used to log in to EC and launch jobs, etc.

  • The SVN user, i.e. the one used on the local machine to communicate with SVN (including the commit).

Furthermore, there are two ways to specify each user when launching a preflight:

  • In an XML configuration file passed to ecclientpreflight

  • Via the command-line call to ecclientpreflight.
    Note: Command-line flags overwrite XML flags if both are specified

For the EC user, you would specify the username using one of the following methods:

  • In the XML file under <data><server><userName>

  • On the command-line via the argument --userName

For the SVN user, you would specify the username using one of the following methods:

  • In the XML file under <data><scm><user>

  • On the command-line via the argument --svnuser

The commit would probably occur as the SVN user, i.e. the user specified in <data><scm><user> or --svnuser.

To get the developer to be the one who checked in the code, the fix would be to set the SVN user to the developer’s user.

Example

Scenario

  • We have SVN at Electric Cloud

  • Our EC server chronic3 isn’t hooked up to LDAP so we use a generic local user called "preflight"

  • We are developers launching preflights

One user, Mary Baker - maryb - sets her preflight configuration XML file to:

<data>
<server>
<userName>preflight</userName>
<hostName>chronic3</hostName>
</server>
<procedure>
...
</procedure>
<scm>
<type>subversion</type>
<user>maryb</user>
</scm>
</data>

But another user, John Smith - johns - sets the preflight configuration XML file to:

<data>
<server>
<userName>preflight</userName>
<hostName>chronic3</hostName>
</server>
<procedure>
...
</procedure>
<scm>
<type>subversion</type>
<user>johns</user>
</scm>
</data>

It’s fairly common for users to be configured to talk to CloudBees CD (CloudBees Flow) via LDAP/AD, so the EC user name could very well be the same as the SVN user name. But for this particular issue, the SVN user name should be the same as the username of the developer launching ecclientpreflight.