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

Make slack_webhook as non optional parameter #9

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Make slack_webhook as non optional parameter #9

merged 4 commits into from
Jul 25, 2024

Conversation

psibi
Copy link
Member

@psibi psibi commented Jul 25, 2024

Initially the CLI argument slack_webhook was optional, even though other options related to notification were required to be passed (Thanks to Kirill for raising this point to me):

  • app name
  • app version
  • notification context

I made the slack_webhook optional to convey the fact that the notification system is pluggable and you could instead optionally integrate other providers like Discord or Microsoft teams. Making it as non optional would indicate that this tool is tied to slack.

I discovered that this problem is solved by clap's ArgGroup, so I have converted the solution to that. This also makes sure that we pass atleast one parameter of the NotifyHook struct.

Initial the CLI argument slack_webhook was optional, even though other
options related to notificatin were required to be passed (Thanks to
Kirill for raising this point to me):

- app name
- app version
- notification context

I initially made the slack_webhook option to convey the fact that the
notification system is pluggable and you could instead optionally
integrate other providers like Discord or Microsoft teams. Making it
as non optional would indicate that this tool is tied to slack.

I discovered that this problem is solved by clap's ArgGroup, so I have
converted the solution to that. This also makes sure that we pass
atleast one parameter of the NotifyHook struct.
@psibi psibi requested review from snoyberg and qrilka July 25, 2024 14:09
src/cli.rs Outdated Show resolved Hide resolved
@psibi psibi requested a review from snoyberg July 25, 2024 14:53
@snoyberg snoyberg enabled auto-merge July 25, 2024 15:10
@snoyberg snoyberg merged commit 9f974bb into main Jul 25, 2024
7 checks passed
@snoyberg snoyberg deleted the slack-help branch July 25, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants