Skip to content
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: use workflow status as enum instead of integers #204

Open
diegodelemos opened this issue Apr 1, 2019 · 1 comment
Open

refactor: use workflow status as enum instead of integers #204

diegodelemos opened this issue Apr 1, 2019 · 1 comment

Comments

@diegodelemos
Copy link
Member

diegodelemos commented Apr 1, 2019

Currently we are sending the workflow status changes from the workflow engines as the integer which represents the status, see for example in RWE Serial. This is happening because the enum which contains this statuses is inside REANA-DB and the workflow engines do not have DB as a dependency.

Even though it works it could easily lead to errors and it is definitely less readable. Also it would be more clear when dealing with the state-machine for workflow statuses.

A possible solution would be to move these enums (for Workflows and for Jobs) to REANA-Commons.

@diegodelemos
Copy link
Member Author

It would be great if we also change status enum real values from integer to strings. E.g.:

class WorkflowStatus(enum.Enum):
    """Enumeration of possible workflow statuses."""

-    created = 0
+    created = 'created'
...

This would:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Triage
Cluster future
Development

No branches or pull requests

2 participants