feat: asyncapi flag `--webhook`
Reason/Context
Please try answering few of those questions
We need to know from the community, if there is a need and use case, then only I want to work on this.
- Why we need this improvement?
- There is no way, how to send notifications to multiple systems, (slack, discord, any webhook service) when any command fails in an in house CI, without exposing logs.
- How will this change help?
-
This will help to send success/fail messages to various notification services, like discord, slack, where every user is not having access to CI Logs, but need to know whether the command is successful or not.
-
This also makes, CLI more extensible tool to integrate with various event driven services,
- What is the motivation?
- Twitter went down on FEB 11, 23:45 IST, and I was not notified about it.
Description
Please try answering few of those questions
-
What changes have to be introduced? A
webhookflag toflags.ts -
Will this be a breaking change? No.
-
How could it be implemented/designed? using
flag.build
Interesting 🤔 Quick question, would checking the exit code not be enough to build your in-house CI to do something when errors occur?
#!/bin/bash
asyncapi ...
if [ $? -eq 0 ]
then
echo "CLI ran ok"
exit 0
else
echo "CLI failed, lets notify externals" >&2
curl -X POST -H "Content-Type: application/json" -d '{ ... }' http://localhost:8080
exit 1
fi
This of course is not only limited to bash, but any other language.
Even though introducing webhook makes it easier, I worry it won't be possible to customize it well enough to make it useful. I.e. what if you want to use a custom payload? Content-type? Multiple requests?
Just a thought 🙂 But we would probably need to add examples and extensive documentation to quickly enable the user to know about this.
Yes you are right @jonaslagoni. The flag is not useful, for customization It is more for simpler needs, and reduce the code required from developer.
Will wait for your final remarks, before closing this. @jonaslagoni 😅
Will wait for your final remarks, before closing this. @jonaslagoni 😅
I am not a code owner of the CLI, so am just challenging your idea 😄 Not my decision by any means 🙂
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: