Skip to content

JS: Recognize Workflow SDK 'use workflow' and 'use step' directives - #22713

Merged
jketema merged 1 commit into
mainfrom
js/workflow-sdk-directives
Sep 30, 2026
Merged

jketema merged 1 commit into
mainfrom
js/workflow-sdk-directives

Conversation

@jketema

@jketema jketema commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #22701.

The js/unknown-directive query flagged the Workflow SDK function directives 'use workflow' and 'use step' as unknown, suggesting their removal (which would change durable workflow/step behavior).

This adds UseWorkflowDirective and UseStepDirective as KnownDirectives, alongside the existing use server/use client/use cache directives, with test coverage in the Directives library test and the UnknownDirective query test.

@jketema
jketema requested a review from a team as a code owner September 30, 2026 13:14
Copilot AI balanced review requested due to automatic review settings September 30, 2026 13:14
@jketema
jketema marked this pull request as draft September 30, 2026 13:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The exact-match implementation satisfies the issue and is covered by positive and negative tests.

Review effort: Balanced
Findings: None

What changed in this PR

Recognizes Workflow SDK directives to prevent false positives from js/unknown-directive.

Changes:

  • Adds exact-match known directive classes for use workflow and use step.
  • Adds positive, negative, and regression test coverage.
  • Adds a JavaScript library change note.
File Description
javascript/​ql/​lib/​semmle/​javascript/​Stmt.qll Defines both known directives.
javascript/​ql/​test/​library-tests/​Directives/​tst.js Adds directive fixtures.
javascript/​ql/​test/​library-tests/​Directives/​KnownDirective.expected Updates expected recognized directives.
javascript/​ql/​test/​query-tests/​Expressions/​UnknownDirective/​UnknownDirective.js Tests valid directives and misspellings.
javascript/​ql/​test/​query-tests/​Expressions/​UnknownDirective/​UnknownDirective.expected Records expected typo alerts.
javascript/​ql/​lib/​change-notes/​2026-09-30-workflow-sdk-directives.md Documents the analysis improvement.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Fixes #22701

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jketema
jketema force-pushed the js/workflow-sdk-directives branch from 8087646 to f49ebeb Compare September 30, 2026 13:32
@jketema
jketema marked this pull request as ready for review September 30, 2026 13:34
@jketema
jketema merged commit b07d44a into main Sep 30, 2026
22 checks passed
@jketema
jketema deleted the js/workflow-sdk-directives branch September 30, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recognize Workflow SDK use workflow and use step directives

3 participants