Expose source_type and source_link on DuoWorkflow GraphQL type

What does this MR do and why?

Exposes the two new database columns added in !247849 (merged) via the GraphQL API.

Adds to the DuoWorkflow GraphQL type:

  • sourceType (DuoWorkflowSourceType enum, nullable, experiment 19.4): the external system that initiated the session (e.g. SLACK). Backed by the source_type smallint enum column.
  • sourceLink (String, nullable, experiment 19.4): the URL or deep link to the location where the session was triggered from. Backed by the source_link text column.

A new DuoWorkflowSourceType enum type is introduced, dynamically derived from the model's source_types hash so it stays in sync automatically as new values are added.

References

Closes #627235 (closed)

How to set up and validate locally

  1. In a rails console, create a workflow with source_type and source_link set:
    w = Ai::DuoWorkflows::Workflow.last
    w.update_columns(source_type: 1, source_link: 'https://example.slack.com/archives/C123')
  2. Query via GraphQL:
     query workflowSources {
       duoWorkflowWorkflows(first: 10) {                                                                                                            
         nodes {
           sourceType
           sourceLink
         }
       }
     }
  3. Verify sourceType: "SLACK" and sourceLink: "https://example.slack.com/archives/C123" are returned.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Roman Eisner

Merge request reports

Loading
Loading