Skip to content

Conversation

lillie-dae
Copy link
Collaborator

@lillie-dae lillie-dae commented Sep 6, 2022

Description

Ability to list Workflow Instance's for a given PayloadId
Also Fixes #411

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • All tests passed locally.
  • Documentation comments included/updated.

Additional

Example requests:
http://localhost:5000/workflowinstances?payloadId=b732a1bc-aab6-45ce-a690-0ea6b9f86e17

http://localhost:5000/workflowinstances?status=created&payloadId=b732a1bc-aab6-45ce-a690-0ea6b9f86e17

http://localhost:5000/workflowinstances?status=created&payloadId=b732a1bc-aab6-45ce-a690-0ea6b9f86e17&pageSize=1000001

Example Response:

{
    "pageNumber": 1,
    "pageSize": 2,
    "firstPage": "/workflowinstances?pageNumber=1&pageSize=2",
    "lastPage": "/workflowinstances?pageNumber=8&pageSize=2",
    "totalPages": 8,
    "totalRecords": 15,
    "nextPage": "/workflowinstances?pageNumber=2&pageSize=2",
    "previousPage": null,
    "data": [
        {
            "id": "0221291c-a994-4a7b-8ec6-42fbaa25185e",
            "ae_title": "Multi_Task_1",
            "workflow_id": "d662639b-30aa-4271-8fcf-b51e6745e72b",
            "payload_id": "b732a1bc-aab6-45ce-a690-0ea6b9f86e17",
            "start_time": "2022-09-06T09:36:03.995Z",
            "status": "Created",
            "bucket_id": "monai",
            "input_metadata": {
                "": ""
            },
            "tasks": [
                {
                    "execution_id": "da69dfb4-10bb-455d-bb6b-32d3eb5e993d",
                    "workflow_instance_id": "",
                    "task_type": "Multi_task",
                    "task_start_time": "0001-01-01T00:00:00Z",
                    "execution_stats": {},
                    "task_plugin_arguments": {},
                    "task_id": "b971c259-c3d5-4ddf-93b2-56c83fb7b474",
                    "previous_task_id": "",
                    "status": "Dispatched",
                    "reason": "None",
                    "input_artifacts": {},
                    "output_artifacts": {},
                    "output_directory": "payloadId/workflows/workflowInstanceId/executionId/",
                    "result": {},
                    "input_parameters": {},
                    "next_timeout": "0001-01-01T00:00:00Z",
                    "timeout_interval": 0
                }
            ]
        }
    ],
    "succeeded": true,
    "errors": null,
    "message": null
}

@lillie-dae lillie-dae self-assigned this Sep 6, 2022
@codecov
Copy link

codecov bot commented Sep 6, 2022

Codecov Report

Merging #405 (a832ab5) into develop (ed22a80) will increase coverage by 0.06229%.
The diff coverage is 90.59829%.

❗ Current head a832ab5 differs from pull request most recent head 6962d36. Consider uploading reports for the commit 6962d36 to get more accurate results

Impacted file tree graph

@@                 Coverage Diff                 @@
##             develop        #405         +/-   ##
===================================================
+ Coverage   56.96598%   57.02827%   +0.06228%     
===================================================
  Files            125         125                 
  Lines          15669       15708         +39     
  Branches        1661        1664          +3     
===================================================
+ Hits            8926        8958         +32     
- Misses          6470        6477          +7     
  Partials         273         273                 
Flag Coverage Δ
unittests 57.02827% <90.59829%> (+0.06228%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...Manager/Common/Services/WorkflowInstanceService.cs 0.00000% <0.00000%> (ø)
...atabase/Repositories/WorkflowInstanceRepository.cs 0.00000% <0.00000%> (ø)
...flowManager/WorkflowManager/Services/UriService.cs 0.00000% <0.00000%> (ø)
...wManager/Controllers/WorkflowInstanceController.cs 80.43478% <87.50000%> (+2.38600%) ⬆️
...rkflowExecuter/Services/WorkflowExecuterService.cs 69.64706% <100.00000%> (ø)
...anager.Tests/Controllers/PayloadControllerTests.cs 100.00000% <100.00000%> (ø)
...sts/Controllers/WorkflowInstanceControllerTests.cs 100.00000% <100.00000%> (ø)
...vices/DataRetentionService/DataRetentionService.cs 94.11765% <0.00000%> (+2.94118%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed22a80...6962d36. Read the comment docs.

@jackschofield23
Copy link
Contributor

Does this support the ability to disable pagination? I think Aide need the list of workflows all in one call. This could be done with another query param

Copy link
Contributor

@jackschofield23 jackschofield23 left a comment

Choose a reason for hiding this comment

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

Does this support the ability to disable pagination? I think Aide need the list of workflows all in one call. This could be done with another query param

@jackschofield23 jackschofield23 self-assigned this Sep 7, 2022
@jackschofield23 jackschofield23 force-pushed the AC-487-get-triggered-workflows-by-payload-api-endpoint branch from 5910f14 to 89cf1b3 Compare September 7, 2022 13:33
@jackschofield23 jackschofield23 force-pushed the AC-487-get-triggered-workflows-by-payload-api-endpoint branch 2 times, most recently from 5e0b45d to 1378d51 Compare September 8, 2022 08:50
@RemakingEden
Copy link
Member

Adding integration tests to this

@jackschofield23 jackschofield23 force-pushed the AC-487-get-triggered-workflows-by-payload-api-endpoint branch from 1378d51 to 66f8aba Compare September 8, 2022 12:49
@RemakingEden RemakingEden force-pushed the AC-487-get-triggered-workflows-by-payload-api-endpoint branch from 790d5a5 to be743ee Compare September 8, 2022 13:16
lillie-dae and others added 6 commits September 8, 2022 15:46
Signed-off-by: Lillie Dae <lillie.dae@answerdigital.com>
Signed-off-by: Jack Schofield <jack.schofield@answerdigital.com>
Signed-off-by: Lillie Dae <lillie.dae@answerdigital.com>
Signed-off-by: Jack Schofield <jack.schofield@answerdigital.com>
Signed-off-by: Lillie Dae <lillie.dae@answerdigital.com>
Signed-off-by: Jack Schofield <jack.schofield@answerdigital.com>
Signed-off-by: Jack Schofield <jack.schofield@answerdigital.com>
Signed-off-by: Jack Schofield <jack.schofield@answerdigital.com>
Signed-off-by: RemakingEden <joss.sparkes@gmail.com>
Signed-off-by: Jack Schofield <jack.schofield@answerdigital.com>
@jackschofield23 jackschofield23 force-pushed the AC-487-get-triggered-workflows-by-payload-api-endpoint branch from a832ab5 to 6962d36 Compare September 8, 2022 14:46
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

41.4% 41.4% Coverage
0.0% 0.0% Duplication

@neildsouth neildsouth merged commit 895f006 into develop Sep 8, 2022
@RemakingEden RemakingEden deleted the AC-487-get-triggered-workflows-by-payload-api-endpoint branch September 8, 2022 15:03
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.

WorkflowInstanceIds array in payload shows workflow id

4 participants