-
Notifications
You must be signed in to change notification settings - Fork 61
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
Stop using Guice to inject InputStep
& context parameters
#69
Conversation
} catch (IOException | InterruptedException | TimeoutException x) { | ||
LOGGER.log(Level.WARNING, "failed to remove InputAction from " + run, x); | ||
LOGGER.log(Level.WARNING, "failed to remove InputAction from " + getContext(), x); |
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.
Looks reasonable, but here and elsewhere where you call getContext()
did you mean getRun()
? That would make more sense to me as a direct translation of the old run
variable.
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.
(I see what you mean about GitHub not letting you comment on a single line without leaving a "review". I clicked "leave a single comment", yet now it appears as "reviewed 18 minutes ago.")
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.
getRun()
would be the more direct equivalent, but might throw exceptions. getContext()
is good enough for logging purposes as its toString()
will include an identification of the build: https://github.com/jenkinsci/workflow-cps-plugin/blob/a9433432b33c65f58d9e7b4dc4aa83249672eaf7/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsStepContext.java#L596-L605 + https://github.com/jenkinsci/workflow-job-plugin/blob/969637446d3ba7ea2c1b26cb7ee1b9c44c6e4ebc/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java#L1003-L1005
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.
Got it, sounds good then.
It would be prudent for me to also add a |
Without using
Without using |
$ strings src/test/resources/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest/serialForm/jobs/p/builds/1/program.dat | sort | uniq | fgrep Step
>0org.jenkinsci.plugins.workflow.steps.StepContext
>1org.jenkinsci.plugins.workflow.cps.CpsStepContext
>2org.jenkinsci.plugins.workflow.steps.StepExecution
3><org.jenkinsci.plugins.workflow.support.steps.input.InputStep
>9org.jenkinsci.plugins.workflow.support.DefaultStepContextG
>Eorg.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution
>>org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl Possibly because |
Downstream of jenkinsci/workflow-step-api-plugin#81. Similar to #64 but should retain serial compatibility for steps running across the upgrade. Probably fixes jenkinsci/acceptance-test-harness#727.