Add executionType #2210

Merged
merged 8 commits into from Nov 30, 2016

Projects

None yet

2 participants

@gschueler
Contributor

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@gmail.com>
b8850c6
@ctrlrsf ctrlrsf Whitespace fix
Signed-off-by: Rene Fragoso <ctrlrsf@gmail.com>
a1fbb01
@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@gmail.com>
0977965
@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@gmail.com>
5762d0c
@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@gmail.com>
ebfa83d
@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@gmail.com>
ad4249f
@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 <ctrlrsf@gmail.com>
44ffebf
@gschueler gschueler Merge branch 'issue/1811' of https://github.com/ctrlrsf/rundeck into …
…ctrlrsf-issue/1811
97a2f8a
@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
Details
@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