Project

General

Profile

Actions

Idea #3898

closed

[API] Job model has a single state attribute that can be updated and read instead of paying attention to running and success flags.

Added by Tom Clegg about 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
-
Target version:
Start date:
09/19/2014
Due date:
Story points:
0.5

Description

Before validation:
  • If state has changed to Running, set started_at to now
  • If state has changed to Failed or Complete, set finished_at to now
  • If state has changed to Cancelled, set cancelled_at to now
  • If state has changed at all, set running and success (see below)
  • If state has not changed, and any of {running, success, cancelled_at} have changed, update state accordingly
  • If state is nil, update state according to running, success, cancelled_at
Validation:
  • If state has changed to Running, and is_locked_by_uuid is nil, return false
Translating from running/success/cancelled_at to state:
running success cancelled_at state
any any not nil Cancelled
any false nil Failed
any true nil Complete
true nil nil Running
false nil nil Queued
Translating from state to running/success:
state running success
Queued false nil
Running true nil
Cancelled false false
Failed false false
Complete false true

Subtasks 4 (0 open4 closed)

Task #3906: Add state columnResolvedRadhika Chippada09/19/2014Actions
Task #3939: review 3898-job-state-attr-fixesResolvedWard Vandewege09/19/2014Actions
Task #3934: Review branch: 3898-job-state-attrResolvedPeter Amstutz09/19/2014Actions
Task #3951: review 3898-job-state-attr-TCResolved09/19/2014Actions
Actions

Also available in: Atom PDF