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

TSPS-325 Support for adding more CLI commands #164

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

mmorgantaylor
Copy link
Collaborator

@mmorgantaylor mmorgantaylor commented Nov 21, 2024

Description

Fix an error in our openapi.yml as well as don't require the description field in the PipelineRun object returned by getAllPipelineRuns. This wasn't actually making the field required anyway in our response - the following is the response to getAllPipelineRuns before this change:

{
  "pageToken": "IyMjNDEjIyMgLSAyMDI0LTExLTIwVDEzOjE5OjMxLjQ4MTc4NQ==",
  "results": [
    {
      "jobId": "82d391bf-d5e7-49c9-819e-71b5b9584365",
      "status": "SUCCEEDED",
      "description": "local run for download testing second attempt"
    },
    {
      "jobId": "6e99d57e-977b-4464-91f3-df7c8c5c4bf0",
      "status": "PREPARING"
    },
    {
      "jobId": "3582c093-5093-4193-b9e4-62c6334a62da",
      "status": "PREPARING"
    },

But making it not required allows the autogenerated Python client to accept this response rather than failing it on validation when a description is not present.

Goes with CLI PR: DataBiosphere/terra-scientific-pipelines-service-cli#14

Jira Ticket

in support of https://broadworkbench.atlassian.net/browse/TSPS-325

@mmorgantaylor mmorgantaylor marked this pull request as ready for review November 21, 2024 20:57
@mmorgantaylor mmorgantaylor marked this pull request as draft November 21, 2024 21:03
@mmorgantaylor mmorgantaylor marked this pull request as ready for review November 21, 2024 21:17
Copy link
Collaborator

@jsotobroad jsotobroad left a comment

Choose a reason for hiding this comment

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

small nits

.timeCompleted(
pipelineRun.getStatus().isCompleted()
? pipelineRun.getUpdated().toString()
: null))
Copy link
Collaborator

Choose a reason for hiding this comment

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

does setting it to null change the default behavior of not being in the response if there is no value? I'm pretty sure it doesnt since its starts out as null but just curious

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this has the same effect as just not setting timeCompleted at all if the run isn't completed. here's what's in the API response:

    {
      "jobId": "30d0ec3d-06e0-41ef-944a-846704926037",
      "status": "RUNNING",
      "description": "local test jobmapkeys refactor and hooks, fixed wdl version",
      "timeSubmitted": "2024-10-08T13:34:39.289930"
    },

do you prefer that we not set it, rather than set it to null? it seems like it might make the logic a little gnarlier since I don't know if you can call a .timeCompleted() inside an if statement?

Copy link
Collaborator

Choose a reason for hiding this comment

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

nope this is great, i was just double checking the response was the same even though it should have been obvious to me that it was

@@ -733,14 +733,18 @@ components:
description: |
Object containing the job id, status, and user-provided description of a Pipeline Run.
Copy link
Collaborator

Choose a reason for hiding this comment

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

can update this description

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good call thanks!

Copy link

sonarcloud bot commented Nov 22, 2024

@mmorgantaylor mmorgantaylor merged commit 5d78be2 into main Nov 25, 2024
14 checks passed
@mmorgantaylor mmorgantaylor deleted the TSPS-325_support_more_cli_commands branch November 25, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants