Add executionType #2210

merged 8 commits into from Nov 30, 2016


None yet

2 participants


updated from #1835

ctrlrsf and others added some commits Apr 29, 2016
@ctrlrsf ctrlrsf Add job.executionType context variable
Currently there's no way to differentiate whether a job was ran by a user
and a job ran by the scheduler by looking at the job context variables.

With this change, we'll have a job.executionType context variable that will
indicate what invoked the job.

Possible values of job.executionType:
  adhoc = adhoc command
  user = job initiated by a user
  scheduled = job triggered by the scheduler

This is a first stab at this problem to get the ball rolling.

Please review for correctness and let me know if anything
else is needed.

Addresses issue rundeck#1811

Signed-off-by: Rene Fragoso <>
@ctrlrsf ctrlrsf Whitespace fix
Signed-off-by: Rene Fragoso <>
@ctrlrsf ctrlrsf Don't set executionType explicitly from ExecutionJob
Feedback from PR suggested that executionType be set at
time that Execution object is created.

Signed-off-by: Rene Fragoso <>
@ctrlrsf ctrlrsf Set executionType when Execution is first created
With this change we set executionType to "user" when it is first
created. If we're creating a scheduled execution, set executionType
to "scheduled".

Signed-off-by: Rene Fragoso <>
@ctrlrsf ctrlrsf Pass through executionType parameter if job is retried
If a job is retried, a new Execution is created. We need to pass through
the executionType parameter of the previous Execution object.

Signed-off-by: Rene Fragoso <>
@ctrlrsf ctrlrsf Set executionType to "user" when Run Now button is used to run job
With this change we're defaulting the Execution.executionType variable
to "scheduled" whenever an Execution object is created.

If a job is ran by a user from the web UI using the Run Now button,
Execution.executionType will be set to "user" instead.

Signed-off-by: Rene Fragoso <>
@ctrlrsf ctrlrsf Add tests for Execution.executionType property
- Modifies testCreateExecutionSimple to confirm default "scheduled"
  executionType is set
- Adds testCreateExecutionSimpleUserExecutionType to confirm
  Execution can be created with executionType set to "user"

Signed-off-by: Rene Fragoso <>
@gschueler gschueler Merge branch 'issue/1811' of into …
@gschueler gschueler added this to the 2.7.0 milestone Nov 30, 2016
@gschueler gschueler merged commit db2c443 into rundeck:master Nov 30, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
@gschueler gschueler deleted the gschueler:ctrlrsf-issue/1811 branch Nov 30, 2016
@gschueler gschueler removed the in progress label Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment