Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-14606] - Fix issue with promoted build plugin #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

austriancoder
Copy link

The svn-tag plugin takes the environment variables from the ancestor build
and not the actual build that was triggered. The issue can be solved if the
environment variables from the actual build are put in the var map and then
the ancestor build adds/overrides its environment variables to the map. That
would not change the original behaviour of the svn-tag plugin but add the
wanted functionality for it to work well together with the promoted build plugin.

This is a fix for JENKINS-14606

Signed-off-by: Christian Gmeiner [email protected]

The svn-tag plugin takes the environment variables from the ancestor build
and not the actual build that was triggered. The issue can be solved if the
environment variables from the actual build are put in the var map and then
the ancestor build adds/overrides its environment variables to the map. That
would not change the original behaviour of the svn-tag plugin but add the
wanted functionality for it to work well together with the promoted build plugin.

This is a fix for JENKINS-14606

Signed-off-by: Christian Gmeiner <[email protected]>
@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@oleg-nenashev oleg-nenashev changed the title Fix issue with promoted build plugin [JENKINS-14606] - Fix issue with promoted build plugin Mar 22, 2016
EnvVars envVars = rootBuild.getEnvironment(buildListener);
EnvVars envVars = abstractBuild.getEnvironment(buildListener);
EnvVars rootVars = rootBuild.getEnvironment(buildListener);
envVars.putAll(rootVars);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will cause a mess in common env vars like BUILD_NUMBER.
The inclusion order is correct, so the change should not break the original behavior of the plugin.

@oleg-nenashev
Copy link
Member

The change looks good for me. It would be useful to see some functional tests

@austriancoder
Copy link
Author

How shall functional tests look like?

@oleg-nenashev
Copy link
Member

@austriancoder
Something like that: https://github.com/jenkinsci/svn-tag-plugin/blob/master/src/test/java/hudson/plugins/svn_tag/SvnTagPluginTest.java#L14-L26

Actually I would expect a test, which

  1. Initializes a project with Promotion Process with SVN Tag action
  2. Runs the main build and asserts its status
  3. Runs promotion process and ensures that Promoted process gets a right value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants