Build 1.0.0.1689 - Variable values

Hi,

 We have noticed an issue in processing some variable values.

 We took .branch -property of a repository to a variable to debug and noticed some peculiar behavior.

 At the very start of a build we have a Set Variable -action that logs the following:

Variable %C_TEMP_BRANCH% has been set to the value '/TestAutomation/SuiteTestAutomationFramework/trunk/'.

 

At third stage of our build we put a new Set variable action, setting it to the same value, and double checked that the Expand variable values -checkbox was checked.

That action - with identical settings - logged the following:

Variable %C_TEMP_BRANCH% has been set to the value '$Source.TestAutomationFramework.Branch$'.

 

This is probably causing the if -check to fail:

 

If ['$Source.TestAutomationFramework.Branch$' Contains '/trunk/'] Skipped

 

 



Hi Ollie

This sounds like a bug that was supposedlty fixed last week. Can you confirm what version your agents are running?

Hi Olli

I was able to reproduce this here, if I remove Repository Mapping for the stage so that it does not have the repository then I see exactly the same result as you. This looks to me to be a bug, the Set variable action should be erroring out if it cannot expand the expression… will discuss with the team and figure out what we should do.

Is there some workaround for this issue then?

No, if the stage doesn’t have the source rules then it doesn’t know about the repositories. The work around is the set the variable in an earlier stage and then just use the variable.

The Set Variable action will error out in the next beta if you try to set it to an expression it cannot evaluate.

Why the repository paths are not usable in stages that do not use the repositories?

We have number of places where operation logic depends on the paths, but not in places that are actually using the sources from the repository, but rather the end products of the previous parts of the process.

I’ll take another look at it tomorrow and see if it can be done.

My curiosity got the better of me. We do actually filter out the repositories based on the stage repository rules… I guess the reasoning was that a user might be fooled into thinking the repo would be available if the descriptor (the class that implements the expression handling) was available for the repo,. I’ll make the change tomorrow (just have delete a few lines of code!), bed time now!