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

[PARTIALLY FIXED JENKINS-28632] Integration with Workflow to trigger a Workflow job #3

Merged
merged 7 commits into from Nov 29, 2015

Conversation

fbelzunc
Copy link
Contributor

This pull request partially integrates deployment-notification-plugin with Workflow plugin.

I will create a awaitDeployment step on a future pull request. For this moment, I am only interested on the trigger integration.

https://issues.jenkins-ci.org/browse/JENKINS-28632

@reviewbybees @jglick

@ghost
Copy link

ghost commented Nov 13, 2015

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@@ -67,13 +73,13 @@ public void checkAndFire(DeploymentFacet facet) {
if (b!=null) {
// pass all the current parameters if we can
ParametersAction action = b.getAction(ParametersAction.class);
job.scheduleBuild(job.getQuietPeriod(), new UpstreamDeploymentCause(b), action);
parameterizedJobMixIn.scheduleBuild2(5, action);
Copy link
Member

Choose a reason for hiding this comment

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

🐜 Use parameterizedJobMixIn.scheduleBuild(action) directly (it already uses the proper quiet period)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amuniz That is incorrect as scheduleBuild is not expecting an Action but a Cause.

Copy link
Member

Choose a reason for hiding this comment

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

Then use parameterizedJobMixIn.scheduleBuild2(parameterizedJobMixIn.getQuietPeriod(), new CauseAction(new UpstreamDeploymentCause(b)), action). Otherwise you are going to loose the UpstreamDeploymentCause (which I guess it's used somewhere later).

Copy link
Member

Choose a reason for hiding this comment

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

I think you are still loosing some information here, since new UpstreamDeploymentCause(b) is not passed to scheduleBuild2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, but scheduleBuild2 doesn't allow you to add the Cause.

http://javadoc.jenkins-ci.org/jenkins/model/ParameterizedJobMixIn.html

@amuniz @jglick Any suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

Did you try to wrap the cause in a CauseAction?

@amuniz
Copy link
Member

amuniz commented Nov 13, 2015

LGTM, but please fix the 🐜

@varmenise
Copy link

looks like there are some regressions though..

@jenkinsadmin
Copy link
Member

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

@fbelzunc
Copy link
Contributor Author

@varmenise I have no clue why the two tests failing are related with this plugin.

org.jvnet.hudson.test.junit.FailedTest.org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite org.jvnet.hudson.test.PluginAutomaticTestBuilder$CliSanityTest.testCliSanity
  • Any idea?

@@ -66,14 +73,13 @@ public void checkAndFire(DeploymentFacet facet) {
Run b = upstream.getBuildByNumber(n);
if (b!=null) {
// pass all the current parameters if we can
ParametersAction action = b.getAction(ParametersAction.class);
job.scheduleBuild(job.getQuietPeriod(), new UpstreamDeploymentCause(b), action);
parameterizedJobMixIn.scheduleBuild(new UpstreamDeploymentCause(b));
Copy link
Member

Choose a reason for hiding this comment

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

Why are you ceasing to copy along the current ParametersAction?

You want to use scheduleBuild2, not scheduleBuild.

Copy link
Member

Choose a reason for hiding this comment

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

@jglick Ouch, I thought just the opposite. Why is scheduleBuild2 better than scheduleBuild in this context?

@fbelzunc
Copy link
Contributor Author

@jglick @amuniz Can you review again please?

@fbelzunc
Copy link
Contributor Author

Just fixed the issue with the failed tests.

@fbelzunc
Copy link
Contributor Author

@jglick @amuniz Do you see any issue on this pull request?

@fbelzunc
Copy link
Contributor Author

@reviewbybees done

@fbelzunc fbelzunc changed the title [PARTIALLY FIXED JENKINS-28632] Integration with Workflow [PARTIALLY FIXED JENKINS-28632] Integration with Workflow to trigger a Workflow job Nov 29, 2015
fbelzunc added a commit that referenced this pull request Nov 29, 2015
[PARTIALLY FIXED JENKINS-28632] Integration with Workflow to trigger a Workflow Job
@fbelzunc fbelzunc merged commit 24c9e56 into jenkinsci:master Nov 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants