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

feat: api webhooks #2543

Merged
merged 63 commits into from
Nov 15, 2023
Merged

feat: api webhooks #2543

merged 63 commits into from
Nov 15, 2023

Conversation

NarayanBavisetti
Copy link
Collaborator

@NarayanBavisetti NarayanBavisetti commented Oct 26, 2023

Webhooks

A webhook triggers a HTTP POST request on the specified url, whenever there is a change in an event. Like a new project is created, updated or deleted then a webhook can be triggered to receive the required payload.

By default ENABLE_WEBHOOK is set to true.

Creating a webhook

url You are required to provide a url in which you want the payloads to be triggered.

is_active To make a webhook active and inactive

Webhook Header

"Content-Type": "application/json",
"User-Agent": "Autopilot",
"X-Plane-Delivery": "f819eff4-cd50-4987-bc97-e5be1e04c94f",
"X-Plane-Event": "project",
"X-Plane-Signature": "7896ae9addb1f73931132b4f3e052bf12c410b837b24898e75dcd660c7"
X-Plane-Delivery It is a randomly generated UUID for uniquely identifying the payload
X-Plane-Event It describes the event for which the webhook triggered
X-Plane-Signature A signature is generated based on the secret and the payload

Currently Plane supports the following events for which webhook can be trigged:

  • Project
  • Issue
  • Cycle
  • Module
  • Issue Comment
Screenshot 2023-11-10 at 3 53 45 PM Screenshot 2023-11-10 at 3 54 13 PM Screenshot 2023-11-10 at 3 54 50 PM

APIs

APIs serve as a gateway to access the internals of Plane. To use these APIs, you need the generated API Tokens. These tokens should be included in every request to the Plane API in the header as X-Api-Key. To activate these APIs, set the environment variable ENABLE_API to 1 in your .env file. Also, specify the base URL of your instance as BASE_API_URL in the same .env file.

api-tokens-list
token-create
token-detail

@vercel
Copy link

vercel bot commented Oct 26, 2023

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

Name Status Preview Comments Updated (UTC)
plane-dev 🔄 Building (Inspect) Visit Preview 💬 Add feedback Nov 15, 2023 10:26am
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
plane ⬜️ Ignored (Inspect) Visit Preview Nov 15, 2023 10:26am
plane-sh ⬜️ Ignored (Inspect) Visit Preview Nov 15, 2023 10:26am
plane-sh-dev ⬜️ Ignored (Inspect) Visit Preview Nov 15, 2023 10:26am
plane-sh-stage ⬜️ Ignored (Inspect) Visit Preview Nov 15, 2023 10:26am
plane-staging ⬜️ Ignored (Inspect) Visit Preview Nov 15, 2023 10:26am

@sriramveeraghanta
Copy link
Contributor

Update the docker file with the newly added ENV variables for self hosting setup

@sriramveeraghanta sriramveeraghanta marked this pull request as draft October 27, 2023 10:10
@NarayanBavisetti NarayanBavisetti added the 🔄migrations Contains Migration changes label Oct 27, 2023
@sriramveeraghanta sriramveeraghanta modified the milestones: 0.14-dev, v0.15 Nov 3, 2023
@codenoid
Copy link

codenoid commented Nov 7, 2023

hi, how It's going

@NarayanBavisetti
Copy link
Collaborator Author

hi, how It's going

Hey @codenoid, Thanks for checking in! The feature is almost ready for release in 0.15v. Out of curiosity, how do you plan on using the new feature?

@codenoid
Copy link

@NarayanBavisetti

  • Sending notification to a slack/telegram channel/group if there is any new update (issue closed/open/comment/change on priority/ etc)
  • send the update to my home pc so I can print the new issue using my thermal printer

rahulramesha and others added 2 commits November 10, 2023 15:46
* feat: workspace webhook store, services integeration and rendered webhook list and create

* chore: handled webhook update and rengenerate token in workspace webhooks

* feat: regenerate key and delete functionality

---------

Co-authored-by: Ramesh Kumar <rameshkumar@rameshs-MacBook-Pro.local>
Co-authored-by: gurusainath <gurusainath007@gmail.com>
Co-authored-by: Ramesh Kumar Chandra <rameshkumar2299@gmail.com>
@makeplane makeplane deleted a comment from NarayanBavisetti Nov 10, 2023
@theparthacus
Copy link
Collaborator

theparthacus commented Nov 13, 2023

@NarayanBavisetti

  • Sending notification to a slack/telegram channel/group if there is any new update (issue closed/open/comment/change on priority/ etc)
  • send the update to my home pc so I can print the new issue using my thermal printer
  • perfect, @codenoid. show us how that looks.
  • we would also like to see this, but perhaps a video of the entire thing---send to printer, print---if you don't mind.

@codenoid
Copy link

sure, I could do that @theparthacus

@sriramveeraghanta sriramveeraghanta marked this pull request as ready for review November 14, 2023 14:18
@pablohashescobar pablohashescobar modified the milestones: v0.15, 0.14-dev Nov 15, 2023
@sriramveeraghanta sriramveeraghanta merged commit 79347ec into develop Nov 15, 2023
9 of 12 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat/api_webhooks branch November 15, 2023 10:27
sriramveeraghanta added a commit that referenced this pull request Dec 7, 2023
* dev: initiate external apis

* dev: external api

* dev: external public api implementation

* dev: add prefix to all api tokens

* dev: flag to enable disable api token api access

* dev: webhook model create and apis

* dev: webhook settings

* fix: webhook logs

* chore: removed drf spectacular

* dev: remove retry_count and fix api logging for get requests

* dev: refactor webhook logic

* fix: celery retry mechanism

* chore: event and action change

* chore: migrations changes

* dev: proxy setup for apis

* chore: changed retry time and cleanup

* chore: added issue comment and inbox issue api endpoints

* fix: migration files

* fix: added env variables

* fix: removed issue attachment from proxy

* fix: added new migration file

* fix: restricted wehbook access

* chore: changed urls

* chore: fixed porject serializer

* fix: set expire for api token

* fix: retrive endpoint for api token

* feat: Api Token screens & api integration

* dev: webhook endpoint changes

* dev: add fields for webhook updates

* feat: Download Api secret key

* chore: removed BASE API URL

* feat: revoke token access

* dev: migration fixes

* feat: workspace webhooks (#2748)

* feat: workspace webhook store, services integeration and rendered webhook list and create

* chore: handled webhook update and rengenerate token in workspace webhooks

* feat: regenerate key and delete functionality

---------

Co-authored-by: Ramesh Kumar <rameshkumar@rameshs-MacBook-Pro.local>
Co-authored-by: gurusainath <gurusainath007@gmail.com>
Co-authored-by: Ramesh Kumar Chandra <rameshkumar2299@gmail.com>

* fix: url validation added

* fix: seperated env for webhook and api

* Web hooks refactoring

* add show option for generated hook key

* Api token restructure

* webhook minor fixes

* fix build errors

* chore: improvements in file structring

* dev: rate limiting the open apis

---------

Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
Co-authored-by: LAKHAN BAHETI <lakhanbaheti9@gmail.com>
Co-authored-by: rahulramesha <71900764+rahulramesha@users.noreply.github.com>
Co-authored-by: Ramesh Kumar <rameshkumar@rameshs-MacBook-Pro.local>
Co-authored-by: gurusainath <gurusainath007@gmail.com>
Co-authored-by: Ramesh Kumar Chandra <rameshkumar2299@gmail.com>
Co-authored-by: Nikhil <118773738+pablohashescobar@users.noreply.github.com>
Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
Co-authored-by: rahulramesha <rahulramesham@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants