vriteio / vrite

Open-source developer content platform
https://vrite.io
Other
1.63k stars 65 forks source link

Feat: add deploy button to trigger a webhook #26

Closed kcoderhtml closed 9 months ago

kcoderhtml commented 1 year ago

I personally use Netlify to host my sites, but if I do some shuffling of my pages, then 3-4 or more builds can all be triggered. An optional addition to the webhooks could be to have a period that it waits for any more changes before triggering.

areknawo commented 1 year ago

Yeah, that can be a problem in certain cases. I have a few ideas on how to fix it, with different pros and cons.

I was thinking of a system where Webhooks run in 30s or 1 min after the actual event, with the user getting a Notification in the dashboard with options to "Run now" or "Cancel". That said, with Webhooks being triggered on the backend (also in response to changes made through API), it's a bit tricky to implement.

Other solution would be some sort of batching, where the wait period is longer, but all changes made in certain time window come as one. That said, in case you want the Webhooks to run immediately (or relatively fast), batching will stand in the way.

It's possible to add a different button/trigger that could be connected to a different Webhook and run manually, e.g. on click. The drawbacks are - you lose a degree of automation, and have to use this trigger instead of just working with the content.

kcoderhtml commented 1 year ago

I was thinking of a combination of the batching and the delay methods. An event would trigger the countdown of 1-1/2 m and the counter would reset if an event happened during that time period. You could also display this as a bar across the top of the screen that will go down with the timer, as well as buttons for cancel and run now.

As for the button to deploy, it could be an optional feature.

areknawo commented 1 year ago

Will think on this and likely implement some kind of combination of all mentioned solutions. That said, it's not on the immediate roadmap for now.

kcoderhtml commented 1 year ago

Awesome! Thanks.

areknawo commented 9 months ago

I thought deeply about implementing it in v0.4. Ultimately I decided not to, due to the following reasons:

Your issue should instead be handled by a system like Changesets (#57) - a WIP concept for applying multiple changes to a workspace at once;

kcoderhtml commented 9 months ago

That seems like a perfect solution! That basically accomplishes what I wanted with the webhooks button.