[JENKINS-29689] always try to reuse last environment#339
[JENKINS-29689] always try to reuse last environment#339guss77 wants to merge 1 commit intojenkinsci:masterfrom
Conversation
Otherwise the environment may not contain important variables such as JOB_NAME
|
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
|
I can't accept the change without a test which shows the problem. Tests are confirmation of the need for the change and a safety check reducing the risk of later removal of the change. Without the test which shows the problem, there is every probability that a later maintainer will change the code back, or alter it in some other way that causes the removal of the change you want. Tests also show greater comprehension of the code and help others see the intent of the change. |
|
Ok, I'll try to cook something up. |
|
This fix is incorrect - it solves the problem in some cases, but not others (specifically there is no change in the case where the previous build has failed for whatever reason). I'm still not sure how the EnvVars get built and why sometimes vars are missing, but I'll keep digging. Thanks for the help. |
Otherwise the environment may not contain important variables such as JOB_NAME.
I'm pretty sure this change is covered by existing test cases. I've also tested the change with new and existing projects, with and without "force workspace" and it looks to be working fine.