Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional config to webhooks in engine #5817

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nischitpra
Copy link
Contributor

@nischitpra nischitpra commented Dec 20, 2024

PR-Codex overview

This PR focuses on enhancing webhook functionality by adding support for a new WEBHOOK_CONFIG feature, allowing users to provide configuration for webhooks in a structured format.

Detailed summary

  • Added "WEBHOOK_CONFIG" to the features list.
  • Introduced an optional config field in EngineWebhook and CreateWebhookInput.
  • Integrated useEngineSystemHealth to check for WEBHOOK_CONFIG support.
  • Updated AddWebhookButton to handle config input.
  • Modified WebhooksTable to display config if supported.
  • Enhanced DeleteWebhookModal and TestWebhookModal to show config if present.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Dec 20, 2024

⚠️ No Changeset found

Latest commit: f765214

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ❌ Failed (Inspect) Dec 31, 2024 10:15am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Dec 31, 2024 10:15am
thirdweb_playground ⬜️ Skipped (Inspect) Dec 31, 2024 10:15am
wallet-ui ⬜️ Skipped (Inspect) Dec 31, 2024 10:15am

Copy link

graphite-app bot commented Dec 20, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.18%. Comparing base (fa26eef) to head (f765214).
Report is 38 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5817      +/-   ##
==========================================
+ Coverage   53.34%   55.18%   +1.83%     
==========================================
  Files        1101     1123      +22     
  Lines       59124    59611     +487     
  Branches     4825     5031     +206     
==========================================
+ Hits        31541    32895    +1354     
+ Misses      26864    25996     -868     
- Partials      719      720       +1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from fa26eef
packages 52.83% <ø> (+2.27%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

see 74 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented Dec 20, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.09 KB (+0.02% 🔺) 902 ms (+0.02% 🔺) 509 ms (-30.47% 🔽) 1.5 s
thirdweb (cjs) 110.84 KB (0%) 2.3 s (0%) 1.6 s (+21.11% 🔺) 3.8 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 109 ms (+62.85% 🔺) 220 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 45 ms (+26.15% 🔺) 55 ms
thirdweb/react (minimal + tree-shaking) 19.12 KB (0%) 383 ms (0%) 355 ms (+34.78% 🔺) 738 ms

@vercel vercel bot temporarily deployed to Preview – docs-v2 December 20, 2024 02:02 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 20, 2024 02:02 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 20, 2024 02:02 Inactive
Copy link
Contributor

This PR has been inactive for 30 days. It is now marked as stale and will be closed in 5 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Dec 29, 2024
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 31, 2024 09:29 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 31, 2024 09:29 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 December 31, 2024 09:29 Inactive
return (
<>
<TWTable
title="webhooks"
data={activeWebhooks}
columns={columns}
columns={columns || []}
Copy link
Contributor

@arcoraven arcoraven Dec 31, 2024

Choose a reason for hiding this comment

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

Is columns ever falsy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I had to move columns into a memo

@@ -118,7 +118,8 @@ type EngineFeature =
| "CONTRACT_SUBSCRIPTIONS"
| "IP_ALLOWLIST"
| "HETEROGENEOUS_WALLET_TYPES"
| "SMART_BACKEND_WALLETS";
| "SMART_BACKEND_WALLETS"
| "WEBHOOK_CONFIG";
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the webhook CRUD APIs backward compatible, as in if config is provided, an older Engine will just silently ignore it?

If so I'm debating if it's simpler to just show the config field for all Engines (and if anything make a small footnote that config is only used for low wallet balance alerts after Engine version v2.x.x).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah old engine will not process the config as its not processed at all.

If we show it all engine, it could act as a nudge to upgrade the engine which is good I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants