-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor srm srv for detail states and comment #839
Conversation
# sequence status in SUCCEEDED: | ||
# if transition from STARTED to SUCCEEDED, set comment to "Sequence complete" | ||
# if transition from FAILED to SUCCEEDED, set comment to "Conversion re-triggered, and sequence completed.' | ||
if sequence.status == SequenceStatus.SUCCEEDED: | ||
previous_state = State.objects.filter(sequence=sequence).order_by('-timestamp').first() | ||
if previous_state is not None and SequenceStatus.from_seq_run_status(previous_state.status) == SequenceStatus.STARTED: | ||
comment = "Sequence completed. Now in state " + status + " ." | ||
if previous_state is not None and SequenceStatus.from_seq_run_status(previous_state.status) == SequenceStatus.FAILED: | ||
comment = "Conversion re-triggered, and sequence completed. Now in state " + status + " ." | ||
|
||
# sequence status in FAILED: | ||
# if transition from SUCCEEDED to FAILED, set comment to "Sequence completed. But failed in post analysis process." | ||
# if transition from STARTED to FAILED, set comment to "Sequence failed. Now in state " + status + " ." | ||
if sequence.status == SequenceStatus.FAILED: | ||
previous_state = State.objects.filter(sequence=sequence).order_by('-timestamp').first() | ||
if previous_state is not None and SequenceStatus.from_seq_run_status(previous_state.status) == SequenceStatus.SUCCEEDED: | ||
comment = "Sequence completed. But failed in post analysis process." | ||
else: | ||
comment = "Sequence failed. Now in state " + status + " ." | ||
|
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.
All this is to set a comment?
I don't think that's needed. With the separation of state and status, it should be quite clear what's going on.
I'd preserve the comments for irregular, unpredictable, manual user added text rather than being auto-populated.
(if something is predictable and can be auto-generated I always feel it should be in a structured format and not in free text, and with the state / status we have that already)
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.
yes, sure, these can be removed as redundant for states.
Sequence Run Manager service refactor
fix #848