none
TFS 2010: Pass updated argument to new build

    Question

  • For our product, we have set up a chain of builds that need to be run in sequence, and for that we use Community TFS Build Extensions QueueBuild activity. The process itself works great, and we can pass processparameters between the builds using that argument. Having snatched that solution from 'somewhere', this is how the argument is populated:

    Microsoft.TeamFoundation.Build.Workflow.WorkflowHelpers.SerializeProcessParameters(New Dictionary(Of String, Object) From {
    {"ParentBuildUri", BuildDetail.Uri},
    {"Verbosity", Verbosity},
    {"CleanWorkspace", CleanWorkspace},
    {"AssociatedEmails", AssociatedEmails}
    })

    Most arguments are passed along to the new build just like they should, but we have a problem with the last one, AssociatedEmails. This one is updated during the build process with values from the associatedChangesets. (The idea is that if a build breaks later in the chain, each user associated with any of the previous builds is 'suspect' of breaking the build). 

    The parameter is defined as an In/Out string, and I have checked that it has its value updated during the build. But the updated values are never passed along, only any 'original' value the parameter may have. Does anybody know why I can't pass along the updated value, or suggest any other solution to this problem?

    UPDATE: Found a paragraph in an entry on Jason Prickett's blog that think may be the cause: the order in which arguments receive their values. I have since tried leaving this particular argument unassigned from the build definition, and then programmatically assign the correct values. But that didn't seem to work either; it seems to me from inspecting the build logs as if the value is never passed along (while the other arguments receive their values like they should) - or that it always passes along the initial value, even when this is null.



    Thursday, June 21, 2012 12:02 PM

Answers

All replies

  • Hi Torbjörn Bergstedt,

    Thank you for your question.

    I am currently looking into this issue and will give you an update as soon as possible.
     
    Thank you for your understanding and support.


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us


    Monday, June 25, 2012 8:42 AM
    Moderator
  • Found a blog post that I think may describe this behavior - but not how to solve it in my case. See update in original post.
    Monday, June 25, 2012 2:04 PM
  • Found the solution myself after even more googling ;). This blog post by William Bartholomew guided me; information set on Agent level does is not re-read out of agent scope, but by implementing his solution I managed to transfer the data correctly.
    Tuesday, June 26, 2012 3:19 PM
  • Hi Torbjörn Bergstedt,

    Thanks for sharing the solution here, which will be benefit to other community members having the similar question.

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, June 27, 2012 1:11 AM
    Moderator