Skip to content

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

Open
austriancoder wants to merge 1 commit into
jenkinsci:masterfrom
austriancoder:master
Open

[JENKINS-14606] - Fix issue with promoted build plugin#13
austriancoder wants to merge 1 commit into
jenkinsci:masterfrom
austriancoder:master

Conversation

@austriancoder

Copy link
Copy Markdown

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 christian.gmeiner@gmail.com

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 <christian.gmeiner@gmail.com>
@jenkinsadmin

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

@austriancoder

Copy link
Copy Markdown
Author

How shall functional tests look like?

@oleg-nenashev

Copy link
Copy Markdown
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