hash icon indicating copy to clipboard operation
hash copied to clipboard

H-1323: Add `/workers` page, update flow run routes

Open CiaranMn opened this issue 1 year ago β€’ 1 comments

🌟 What is the purpose of this PR?

The PR introduces a /workers page which lists all active worker runs. These may be 'goals' which are research-driven flows (the /goals page to be introduced in the next PR), or other flows.

It also updates the routes for viewing:

  1. Flow definitions to /@[namespace]/flows/[id]
  2. Worker runs (flows or goals) to /@[namespace]/workers/[id]

These routes have essentially the same UI for now so they share a component. I've also updated the context providers so that we poll for all flow runs with fewer details (that doesn't require the event history) on a slower schedule, and the single selected flow run more frequently.

πŸ”— Related links

πŸ” What does this change?

As well as the main changes above:

  • Throws errors without a cause from run-workflow-run.ts because the cause causes Temporal to not fail the workflow properly
  • Update the persistFlow activity to use the provided webId instead of always the user

Pre-Merge Checklist πŸš€

🚒 Has this modified a publishable library?

This PR:

  • [x] does not modify any publishable blocks or libraries, or modifications do not need publishing

πŸ“œ Does this require a change to the docs?

The changes in this PR:

  • [x] are internal and do not require a docs change

πŸ•ΈοΈ Does this require a change to the Turbo Graph?

The changes in this PR:

  • [x] do not affect the execution graph

πŸ›‘ What tests cover this?

  • None yet.

CiaranMn avatar May 17 '24 17:05 CiaranMn

Codecov Report

Attention: Patch coverage is 0% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 21.23%. Comparing base (4c0810c) to head (fc3bd24).

Files Patch % Lines
libs/@local/hash-backend-utils/src/flows.ts 0.00% 16 Missing :warning:
...sh-ai-worker-ts/src/workflows/run-flow-workflow.ts 0.00% 10 Missing :warning:
.../hash-isomorphic-utils/src/flows/frontend-paths.ts 0.00% 7 Missing :warning:
apps/hash-api/src/ai/infer-entities-websocket.ts 0.00% 2 Missing :warning:
...ctivities/flow-activities/persist-flow-activity.ts 0.00% 1 Missing :warning:
...orphic-utils/src/flows/example-flow-definitions.ts 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4479      +/-   ##
==========================================
- Coverage   21.52%   21.23%   -0.29%     
==========================================
  Files         451      454       +3     
  Lines       14953    15156     +203     
  Branches     2216     2267      +51     
==========================================
  Hits         3218     3218              
- Misses      11694    11897     +203     
  Partials       41       41              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 17 '24 17:05 codecov[bot]