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

Eng 2733 implement v2 list workflow route #1213

Merged
merged 14 commits into from
Apr 18, 2023

Conversation

eunice-chan
Copy link
Contributor

Describe your changes and why you are making these changes

Implement the list workflow route

Related issue number (if any)

ENG 2733

Loom demo (if any)

Passed the test added to integration_tests/backend/test_reads.py
Sample output:

[{'id': '74cde64b-1c4c-42f9-8c47-93c88f0a71a8', 'user_id': '18b349cf-8c40-4efa-89a6-666ea64aa801', 'name': 'Churn Prediction', 'description': '', 'schedule': {'trigger': 'manual', 'cron_schedule': '', 'disable_manual_trigger': False, 'paused': False, 'source_id': '00000000-0000-0000-0000-000000000000'}, 'created_at': '2023-04-07T11:00:41.184375-07:00', 'retention_policy': {'k_latest_runs': -1}, 'notification_settings': {'settings': None}}, {'id': '8f8db27f-7885-4156-a90e-f40742753fc3', 'user_id': '18b349cf-8c40-4efa-89a6-666ea64aa801', 'name': 'review_strlen', 'description': '', 'schedule': {'trigger': 'manual', 'cron_schedule': '', 'disable_manual_trigger': False, 'paused': False, 'source_id': '00000000-0000-0000-0000-000000000000'}, 'created_at': '2023-04-07T11:01:00.326198-07:00', 'retention_policy': {'k_latest_runs': -1}, 'notification_settings': {'settings': None}}]

Checklist before requesting a review

  • I have created a descriptive PR title. The PR title should complete the sentence "This PR...".
  • I have performed a self-review of my code.
  • I have included a small demo of the changes. For the UI, this would be a screenshot or a Loom video.
  • If this is a new feature, I have added unit tests and integration tests.
  • I have run the integration tests locally and they are passing.
  • I have run the linter script locally (See python3 scripts/run_linters.py -h for usage).
  • [N/A] All features on the UI continue to work correctly.
  • Added one of the following CI labels:
    • run_integration_test: Runs integration tests
    • skip_integration_test: Skips integration tests (Should be used when changes are ONLY documentation/UI)

@eunice-chan eunice-chan added the run_integration_test Triggers integration tests label Apr 14, 2023
@@ -17,6 +17,9 @@


class TestBackend:
V2_GET_WORKFLOWS_TEMPLATE = "/api/v2/workflows"

GET_WORKFLOWS_TEMPLATE = "/api/workflows"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep the v1 route around if we are moving over to v2?

Who else is using this route? Is it just our SDK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using it for testing the endpoint (assert len(v1_resp) == len(v2_resp)). I think in the future we would want to remove it but I think while it is not deprecated it may be nice using it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually on second thought I've decided to remove the dependency on V1.

@agiron123
Copy link
Contributor

Code here looks good on my end. I'll defer to @likawind if there are any backend concerns that he may have.

Copy link
Contributor

@agiron123 agiron123 left a comment

Choose a reason for hiding this comment

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

🚢

Copy link
Contributor

@likawind likawind left a comment

Choose a reason for hiding this comment

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

Great work! Try to rebase on main as we moved around some codes in UI. Also, to follow naming of other files let's use <routeName><Method> to name files and objects, we should use workflows_get and WorkflowsGet in various places

@eunice-chan
Copy link
Contributor Author

List_StorageMigration, which is what I was referencing, doesn't seem to follow the naming convention of so we may want to make a task for that.

I've updated the naming. I am a little confused when to use Workflows GetWorkflows WorkflowsGet but I tried to follow the WorkflowGet example as closely as possible. Would appreciate a review to check I am using the correct convention everywhere.

@eunice-chan eunice-chan requested a review from likawind April 17, 2023 16:16
Copy link
Contributor

@likawind likawind left a comment

Choose a reason for hiding this comment

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

Looks good! WorkflowsGet is the right convention. Workflows is the resource name and Get is the http method name. Let's try to run run_linters.py and see if it helps resolves python formattings

@eunice-chan eunice-chan merged commit 65be02e into main Apr 18, 2023
@vsreekanti vsreekanti deleted the eng-2733-m3-implement-v2-list-workflow-route branch April 18, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run_integration_test Triggers integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants