-
Notifications
You must be signed in to change notification settings - Fork 196
[JENKINS-51170] Enable the usage of the StepEnvironmentContributor extensionpoint #229
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
Conversation
Yes should suffice to update the parent (currently to 3.12) and mvn incrementals:incrementalify Could be done in this PR so far as I am concerned. |
(Somehow the CI build seems to be running even without the |
I got an error with access restrictions (DoNotUse). |
The incrementalization is blocked on jenkinsci/lib-access-modifier#12 |
Just switch to PR seems to have a bunch of test failures. |
92cc5b0
to
6796532
Compare
The hooks work so far for steps. The logic in jenkinsci/workflow-support-plugin#62 is actually sufficient. This PR only contains tests. I am not sure about also calling the hooks for Any opinions if this part is required/wanted/superfluous/etc? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, but looks OK given the upstreams.
src/test/java/org/jenkinsci/plugins/workflow/DynamicEnvironmentExpanderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jenkinsci/plugins/workflow/DynamicEnvironmentExpanderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jenkinsci/plugins/workflow/DynamicEnvironmentExpanderTest.java
Outdated
Show resolved
Hide resolved
6796532
to
495d886
Compare
027d4a5
to
a49d018
Compare
a49d018
to
0a459b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t-8ch Here is the change you need to fix the enforcer issue:
diff --git a/pom.xml b/pom.xml
index 97bd8cc5..1b796251 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
- <version>3.28</version>
+ <version>3.32</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Unfortunately, after fixing that, I get a lot of test failures that appear to be caused by the workflow-support patch (for example, try ArgumentsActionTestImpl#testArgumentDescriptions
). It looks like the addition of get(TaskListener.class)
is causing failures in some scenarios where the node is not active or has completed. Here is an example stack trace:
java.io.IOException: cannot start writing logs to a finished node org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode[id=3] echo in CpsFlowExecution[Owner[argumentDescription/1:argumentDescription #1]]
at org.jenkinsci.plugins.workflow.support.DefaultStepContext.getListener(DefaultStepContext.java:107)
at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:78)
at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:72)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:239)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:176)
Maybe workflow-support should call the old API in the cases where TaskListener.class
is not available, or pass TaskListener.NULL
or something, but I'm not sure what the best approach would be.
I see the following alternatives to aquire a listener:
Personally I think 3) seems to be the best. |
I implemented prototypes for all three scenarios and all of them pass the testsuites of |
Thanks for looking into all of the options! Given that the line immediately above the new line in |
Will do. I won't get around until tomorrow though. If you want feel free to take a shot at it. |
Sounds good but better do it in
No, do not do that. |
…tensionpoint Support the new StepEnvironmentContributor hook introduced in jenkinsci/workflow-step-api-plugin#36.
0a459b7
to
213af04
Compare
I went with 2 with a fallback to 1, as recommended by @jglick . The tests seem to be happy. |
Support the new StepEnvironmentContributor hook introduced in
jenkinsci/workflow-step-api-plugin#36.
This depends on jenkinsci/workflow-step-api-plugin#36.
The dependency version number used depends on the incrementalifyiation (JEP 305).
If requested I can perform this and submit another PR.