Skip to content

subscription interface #862

@oliver-sanders

Description

@oliver-sanders

Context: The result of a few conversations about isolating views from GraphQL and filtering which hadn't been written to an issue.

The current subscription interface:

  • The UI has multiple "views" each of which requires a different slice of the same data.
  • The data requirements of a view might change as a user interacts with it.
  • We currently merge the subscriptions to avoid duplicate request / storage / handling of data.
  • We have one subscription for all workflows (dashboard, gscan).
  • And one subscription per workflow.

Possible simplification:

  • Rather than having views provide a GraphQL query in full have them provide a list of the fields they require for each object (workflow, task, etc).
  • Have the workflow service construct / merge this into a subscription.
  • Later on we can add extra fields for filtering.

For example a simple tree view might provide the following subscription:

subscription = {
  'workflow': [
    'id',
    'status'
  ],
  'task': [
    'id',
    'status'
  ],
  'job': [
    'id',
    'status'
  ],
  'task-filter': [
    'failed',
    'submit-failed'
  ]
}

Which the workflow service could construct into:

workflow {
  id
  status
  task(states: ["failed", "submit-failed"]) {
    id
    status
  }
  job {
    id
    status
  }
}

If a second subscription came along with a blank task-filter we could handle that intelligently in the UI code:

-  task(states: ["failed", "submit-failed"]) {
+  task {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions