Add a hook to tag workflow SDK discovery. This will be used to track what SDKs are used#1850
Add a hook to tag workflow SDK discovery. This will be used to track what SDKs are used#1850
Conversation
…what SDKs are used
|
👋 nolag, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
✅ API Diff Results - No breaking changes |
There was a problem hiding this comment.
Pull request overview
This PR adds a hook mechanism to track SDK usage by introducing a SdkLabeler callback function to the ModuleConfig struct. The hook is invoked during module creation after SDK version discovery, allowing callers to tag metrics or logs with the discovered SDK import name.
Changes:
- Added
SdkLabeleroptional callback field toModuleConfigwith nil-safety defaulting to no-op - Invoked
SdkLabelerwith the discovered v2 import name after module initialization innewModule - Added comprehensive test coverage for nil-safety and callback invocation with NoDAG modules
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/workflows/wasm/host/module.go | Added SdkLabeler field to ModuleConfig, implemented nil-safety default, and invoked the callback with v2ImportName after SDK discovery |
| pkg/workflows/wasm/host/module_test.go | Added tests verifying nil SdkLabeler defaults to no-op and that it's called with discovered v2 import name |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
For usage, see this draft PR