Skip to content

Recognize Workflow SDK use workflow and use step directives #22701

Description

@iuriifavi

Summary

The js/unknown-directive query (also surfaced by GitHub Code Quality) reports Workflow DevKit's required function directives 'use workflow' and 'use step' as unknown. Its generated autofix advice says to delete or replace them. Doing so changes the function's durable workflow/step behavior.

Workflow SDK documents both directives: https://workflow-sdk.dev/

Minimal reproduction

export async function exampleWorkflow() {
  'use workflow';
  return await exampleStep();
}

async function exampleStep() {
  'use step';
  return 42;
}

Run the JavaScript Code Quality suite containing js/unknown-directive. Both directive prologues receive Unknown directive findings.

Expected behavior

Recognize these two exact Workflow SDK directives as known, or otherwise avoid suggesting their removal in projects using Workflow SDK. Continue detecting actual misspellings and unrelated unknown directives.

Actual impact

In our private repository, github-code-quality[bot] has repeatedly commented on required workflow and step declarations, including tests. Some proposed fixes would silently remove durability or misclassify a step as a workflow. They can be dismissed individually as false positives, but they recur on changed lines.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions