feat(flows): surface copyable webhook URL as a Monaco editor artifact#16619
Open
flcarre wants to merge 2 commits into
Open
feat(flows): surface copyable webhook URL as a Monaco editor artifact#16619flcarre wants to merge 2 commits into
flcarre wants to merge 2 commits into
Conversation
Adds an extensible Monaco editor artifact mechanism keyed by plugin type. A CodeLens above each Webhook trigger block lets users copy the webhook execution URL directly from the flow YAML editor, instead of digging it out of the Triggers panel. - extractTypedBlocks(): generic, section-aware extraction of every YAML block carrying a type, with its range and parent path - editor artifact registry (type -> provider) + Webhook provider scoped to the triggers section - single webhookUrl() util, consolidating the three duplicated builders (WebhookCurl, TriggerAvatar, artifact) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
🐋 Docker imagedocker run --pull=always --rm -it -p 8080:8080 --user=root -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp ghcr.io/kestra-io/kestra-pr:16619 server local |
- extend FlowRun.vue to use WEBHOOK_TRIGGER_TYPE constant (missed in initial PR) - URL-encode namespace, id and key in webhookUrl() (keys can contain slashes or spaces) - add extractTypedBlocksWithMeta() to avoid double YAML parse per CodeLens refresh - use extractTypedBlocksWithMeta in yamlLanguageConfigurator (single parse path) - update editorArtifacts.spec.ts to import WEBHOOK_TRIGGER_TYPE instead of hardcoding - add tests: URL encoding, extractTypedBlocksWithMeta Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an extensible Monaco editor artifact mechanism keyed by plugin type, and uses it to ship the first artifact: a CodeLens above each Webhook trigger block in the flow YAML editor that copies the webhook execution URL.
Before, the webhook URL was only reachable via the Triggers tab → trigger details panel → "Copy URL". A G2 reviewer reported it as missing entirely because it was too buried. Now it sits right where you write the trigger.
How
The rendering layer is generic and decoupled from any single plugin — exactly the "Monaco editor artifacts based on plugin-types" direction discussed on the issue:
extractTypedBlocks(source)(topology /flowYamlUtils) — section-aware extraction of every YAML block carrying atype:, with its range and parent path. Generic foundation.ui/src/composables/monaco/artifacts/) —type → provider. The CodeLens provider inyamlLanguageConfiguratorrenders whatever descriptors a provider returns; it knows nothing about webhooks.triggerssection (so apluginDefaultsentry of the same type can never trigger a false lens) and to blocks with akey.webhookUrl()util — consolidates the three previously-duplicated URL builders (WebhookCurl.vue,TriggerAvatar.vue, the new artifact) and guarantees an absolute URL (the old builders could emit a relative/ui/...URL that wasn't usable in curl).--ks-text-link) on hover.Testing
extractTypedBlocks(path/section detection +pluginDefaultsexclusion),webhookUrl(absolute URL), artifact registry + webhook provider.Follow-up
This ships the registry as the seam; the future direction (plugins declaring their own
artifacts:— CodeLens links per plugin type without frontend hardcoding, and full widgets per type for infra/cloud-status use cases) is tracked separately.Closes https://github.com/kestra-io/kestra-ee/issues/8401
🤖 Generated with Claude Code