cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: asyncapi flag `--webhook`

Open imabp opened this issue 3 years ago • 4 comments

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?
  1. 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?
  1. 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.

  2. This also makes, CLI more extensible tool to integrate with various event driven services,

  • What is the motivation?
  1. 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 webhook flag to flags.ts

  • Will this be a breaking change? No.

  • How could it be implemented/designed? using flag.build

imabp avatar Feb 11 '22 18:02 imabp

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.

jonaslagoni avatar Feb 12 '22 11:02 jonaslagoni

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 😅

imabp avatar Feb 13 '22 04:02 imabp

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 🙂

jonaslagoni avatar Feb 13 '22 11:02 jonaslagoni

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:

github-actions[bot] avatar Jun 14 '22 00:06 github-actions[bot]

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:

github-actions[bot] avatar Nov 26 '22 00:11 github-actions[bot]