Skip to content

Conversation

@SHuang-Broad
Copy link
Contributor

So that other commands can reuse its logic (notably, notify).

@SHuang-Broad SHuang-Broad requested a review from bshifaw April 29, 2022 19:08
Copy link
Contributor

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SHuang-Broad Looks fine. Minor comments. At some point we might want to move it to utils if people are going to call into it a lot.

ret_val = updated_ret_val

# Display status to user:
line_string = requested_status_json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why rename this here? Lets just print the requested_status_json after replacement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
Plus It isn't good practice to use type suffix when naming variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Push back a little: I didn't change this as it was in the original code. I used pycharm to refactor out a function.
Regardless, I'll update this PR with the requested changes, and move this to utils.

ret_val = 1
log.display_logo(io_utils.dead_turtle)
elif workflow_status == "Running":
elif workflow_status == cromshellconfig.WorkflowStatuses.Running.value[0]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird. I feel like there must be a better solution but we don't have to find it right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you elaborate? I'm hoping to do it correctly in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like there should be a less awkward way of matching against the enum values. We shouldn't have to decompose the list manually. Maybe we should overload the equality option in the enum to check all the list values so we don't have to do this awkward thing.


# Display status to user:
line_string = requested_status_json
print(line_string.replace(",", ",\n"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its fine as is but would be nice to use pretty_print_json()

return ret_val


def query_status(config, workflow_id: str) -> (str, str, int):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not now but later, would be good to add unit tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, I'll add unit test in this PR.

Copy link
Contributor Author

@SHuang-Broad SHuang-Broad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, let's make this PR correct and not merge yet.

return ret_val


def query_status(config, workflow_id: str) -> (str, str, int):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, I'll add unit test in this PR.

ret_val = 1
log.display_logo(io_utils.dead_turtle)
elif workflow_status == "Running":
elif workflow_status == cromshellconfig.WorkflowStatuses.Running.value[0]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you elaborate? I'm hoping to do it correctly in this PR.

@bshifaw bshifaw added the Cromshell 2 Issues related to Cromshell 2.0 label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cromshell 2 Issues related to Cromshell 2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants