Skip to content

feat(flows): surface copyable webhook URL as a Monaco editor artifact#16619

Open
flcarre wants to merge 2 commits into
developfrom
claude/kind-mahavira-c6bf78
Open

feat(flows): surface copyable webhook URL as a Monaco editor artifact#16619
flcarre wants to merge 2 commits into
developfrom
claude/kind-mahavira-c6bf78

Conversation

@flcarre

@flcarre flcarre commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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 a type:, with its range and parent path. Generic foundation.
  • Editor artifact registry (ui/src/composables/monaco/artifacts/) — type → provider. The CodeLens provider in yamlLanguageConfigurator renders whatever descriptors a provider returns; it knows nothing about webhooks.
  • Webhook provider — the only provider shipped. Scoped to the triggers section (so a pluginDefaults entry of the same type can never trigger a false lens) and to blocks with a key.
  • Single 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).
  • The CodeLens is gray by default and turns the Kestra link purple (--ks-text-link) on hover.

Testing

  • Unit tests: extractTypedBlocks (path/section detection + pluginDefaults exclusion), webhookUrl (absolute URL), artifact registry + webhook provider.
  • Type-check (design-system + app + tests), lint, i18n check all green.
  • Manual QA in the live flow editor: lens renders above the webhook trigger, gray→purple on hover, click invokes the copy command.

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

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>
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🐋 Docker image

ghcr.io/kestra-io/kestra-pr:16619
docker 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To review

Development

Successfully merging this pull request may close these issues.

1 participant