Closed toddbrownmcis closed 6 years ago
Hi @toddbrownmcis
hmm the variable in the new version actually only "lives" while the build is run, after this it should be emptied directly. The reason why the previous values are stored is if you want to trigger more than one build with different conditions (meaning you need 2 differently configured tasks) and await both of them later with the separate wait task.
So the value set in the variable should nto be anymore after the build finished.
Do you have a concrete issue or experienced a different behavior?
I am switching from version 1 to version 2. So the user environment variable has a value set from the last version 1 task. It seems that the version 2 task is always starting with a previous value from the last version 1 task and appending the current version 2 task.
From: Benj Huser [mailto:notifications@github.com] Sent: Tuesday, September 26, 2017 1:54 PM To: huserben/TfsExtensions TfsExtensions@noreply.github.com Cc: Brown, Todd A. todd.brown@mcis.com; Mention mention@noreply.github.com Subject: Re: [huserben/TfsExtensions] Version 2 TiggerBuildTask Setting TriggeredBuildIds Environment Variable Differently Than Version 1 (#29)
hmm the variable in the new version actually only "lives" while the build is run, after this it should be emptied directly. The reason why the previous values are stored is if you want to trigger more than one build with different conditions (meaning you need 2 differently configured tasks) and await both of them later with the separate wait task.
So the value set in the variable should nto be anymore after the build finished.
Do you have a concrete issue or experienced a different behavior?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_huserben_TfsExtensions_issues_29-23issuecomment-2D332299501&d=DwMFaQ&c=KNVzINr6WAqWApikNSnyDeOu0ck0iFwcrMz92MxUhIs&r=gxQ9HPpTnuDsFzV7uUPCioWAKrXL3DVQsipSZpHLkII&m=Czz9XOgDEIiT2wYOefzkl9z_VgnRieuwC1H88pYsQUQ&s=zSITCLRKAUZ21cxsqkyTzLo-GyNsT80iQHs2mtbGfG8&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ANIM4VmCZBAzGJuubuzDW4NVQw4WSgQoks5smUhagaJpZM4PkbO8&d=DwMFaQ&c=KNVzINr6WAqWApikNSnyDeOu0ck0iFwcrMz92MxUhIs&r=gxQ9HPpTnuDsFzV7uUPCioWAKrXL3DVQsipSZpHLkII&m=Czz9XOgDEIiT2wYOefzkl9z_VgnRieuwC1H88pYsQUQ&s=k3NIZCfhUwrQz01MDA6SBzLX_0Tun6bHapFlWPqgSpA&e=.
The contents of this message may contain private, protected and/or privileged information. If you received this message in error, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained within. Please contact the sender and advise of the erroneous delivery by return e-mail or telephone. Thank you for your cooperation.
Hi
oh that makes sense, as PowerShell actually used a "persistent" variable. However the task will not be able to delete this value, because as far as I know this is not possible using node.js. However you could try to "clean" the environment variable before with a little powershell script/snippet and from then on it should be fine.
Could you test it with adding a Powershell script that executes this:
It should be enough to just run this once to reset the variable.
Hi @toddbrownmcis
did you have the chance to look into it and run the PowerShell script to clear the variable?
Thanks for your feedback
Yes, that fixed the issue. Thanks!
From: Benj Huser [mailto:notifications@github.com] Sent: Monday, October 2, 2017 12:33 PM To: huserben/TfsExtensions TfsExtensions@noreply.github.com Cc: Brown, Todd A. todd.brown@mcis.com; Mention mention@noreply.github.com Subject: Re: [huserben/TfsExtensions] Version 2 TiggerBuildTask Setting TriggeredBuildIds Environment Variable Differently Than Version 1 (#29)
did you have the chance to look into it and run the PowerShell script to clear the variable?
Thanks for your feedback
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_huserben_TfsExtensions_issues_29-23issuecomment-2D333605933&d=DwMCaQ&c=KNVzINr6WAqWApikNSnyDeOu0ck0iFwcrMz92MxUhIs&r=gxQ9HPpTnuDsFzV7uUPCioWAKrXL3DVQsipSZpHLkII&m=4ll1zDK9SFxY2V4qYcDCN3cGW8ouPJIlKTmm2-Wx-nc&s=uauVzbdS_dd3z7PPvg5-lQslpz6zzooOYrNrsrIA2Y0&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ANIM4U4fkgy53yiGunb5ShB-2DaRu2x2llks5soR5FgaJpZM4PkbO8&d=DwMCaQ&c=KNVzINr6WAqWApikNSnyDeOu0ck0iFwcrMz92MxUhIs&r=gxQ9HPpTnuDsFzV7uUPCioWAKrXL3DVQsipSZpHLkII&m=4ll1zDK9SFxY2V4qYcDCN3cGW8ouPJIlKTmm2-Wx-nc&s=2-ay2fOCgTuxjEIAmiWk6PTXDLH5pjgxoi4u-Z8ZPEY&e=.
The contents of this message may contain private, protected and/or privileged information. If you received this message in error, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained within. Please contact the sender and advise of the erroneous delivery by return e-mail or telephone. Thank you for your cooperation.
Hi
ok very good. I will leave the issue open until I documented the this as well on the overview page.
Edit: I updated the overview page with the info in case someone else has the same problem.
Version 2 TfsExtensions/BuildTasks/triggerbuildtask/index.js is setting TriggeredBuildIds environment variable to comma delimited string of previous value + newly triggered builds.
Version 1 TfsExtensions/BuildTasks/powershellTask/triggerbuildtask/triggerbuild.ps1 is setting TriggeredBuildIds environment variable to comma delimited string of newly tiggered builds.
I think Version 1 is doing it correctly since the previous value used in Version 2 is from the last time any Trigger Build task was run which may be several days ago and has nothing to do with the current task.