Skip to content

Report Durable Functions JavaScript SDK version in binding metadata - #369

Open
Varshitha Bachu (bachuv) wants to merge 1 commit into
mainfrom
vabachu/report-durable-sdk-version
Open

Varshitha Bachu (bachuv) wants to merge 1 commit into
mainfrom
vabachu/report-durable-sdk-version

Conversation

@bachuv

Copy link
Copy Markdown
Contributor

Summary

What changed?

  • Generate SDK name and version constants from packages/azure-functions-durable/package.json before builds and tests.
  • Add durableSdkName and durableSdkVersion to the metadata produced by addDurableGrpcMetadata.
  • Continue reporting durableRequiresGrpc on orchestration, activity, entity, and Durable Client bindings.
  • Update unit tests to verify that the reported SDK identity matches the package metadata and that the original binding is not mutated.

Why is this change needed?

  • Allows the Durable Functions extension to identify the exact JavaScript SDK package and version during function indexing.
  • Enables structured telemetry for JavaScript SDK adoption without relying on client requests or parsing a user-agent header.
  • Generates the values from package.json so the reported identity remains synchronized with the published package.

Issues / work items


Project checklist

  • Release notes are not required for the next release
    • Otherwise: Notes added to CHANGELOG.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • Breaking change?
    • No

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s): GitHub Copilot
  • AI-assisted areas/files:
  • What you changed after AI output:

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Notes for reviewers

  • src/version.ts is generated during the npm prebuild, pretest, and pretest:unit lifecycle steps and is not committed.
  • package.json remains the source of truth for both the SDK package name and version.
  • The corresponding Durable Functions extension change can consume this metadata during function indexing and emit structured SDK usage telemetry

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 metadata generation and propagation are consistent and appropriately tested.

Review effort: Balanced
Findings: None

What changed in this PR

Adds package identity metadata to Durable Functions bindings for extension telemetry and indexing.

Changes:

  • Generates SDK name and version constants from package.json.
  • Adds SDK identity to Durable gRPC metadata.
  • Tests metadata values and binding immutability.
File Description
packages/​azure-functions-durable/​test/​unit/​durable-grpc.spec.ts Verifies SDK metadata and immutability.
packages/​azure-functions-durable/​src/​durable-grpc.ts Adds SDK identity to binding metadata.
packages/​azure-functions-durable/​package.json Generates version constants before builds and tests.

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

@YunchuWang

Copy link
Copy Markdown
Member

Non-blocking: assert SDK identity on the exported binding helpers

In trigger.spec.ts, please extend the existing orchestration, activity, entity, and durable-client binding tests to assert durableSdkName and durableSdkVersion against package.json. They currently assert only the binding type and durableRequiresGrpc. The new shared-helper test is useful, but assertions on the exported binding helpers would also protect against a binding path dropping or bypassing the identity metadata.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants