Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

feat: add CLI debugging commands #81

Merged
merged 2 commits into from
May 6, 2020
Merged

Conversation

alexmt
Copy link
Collaborator

@alexmt alexmt commented May 4, 2020

PR add set of CLI commands that simplify configuring notification controller:

  • get configured triggers/template
argocd-notifications tools trigger get
argocd-notifications tools trigger get --name on-sync-failed
argocd-notifications tools template get
  • eval trigger condition
argocd-notifications tools trigger run 
  on-sync-failed  \         #trigger name
  guestbook                 #app name ( or local app file path )
  • print notification to console
argocd-notifications tools template notify \
  app-sync-succeeded  \     #template name
  guestbook                 #app name ( or local app file path )
  • send the notification to the specified recipient
argocd-notifications tools template notify \
  app-sync-succeeded  \     #template name
  guestbook \               #app name ( or local app file path ) 
  --recipient slack:argocd-notifications

All commands have --config-map and --secret flags to use local config map, secret files instead of real config map/secret

Progress:

  • implementation
  • tests
  • documentation

@codecov
Copy link

codecov bot commented May 4, 2020

Codecov Report

Merging #81 into master will decrease coverage by 1.78%.
The diff coverage is 45.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #81      +/-   ##
==========================================
- Coverage   55.45%   53.66%   -1.79%     
==========================================
  Files          20       24       +4     
  Lines         990     1295     +305     
==========================================
+ Hits          549      695     +146     
- Misses        361      497     +136     
- Partials       80      103      +23     
Impacted Files Coverage Δ
cmd/bot.go 0.00% <0.00%> (ø)
cmd/main.go 0.00% <0.00%> (ø)
notifiers/notifiers.go 0.00% <ø> (ø)
shared/settings/settings.go 58.90% <0.00%> (-13.98%) ⬇️
cmd/tools/context.go 19.04% <19.04%> (ø)
cmd/tools/tools.go 36.95% <36.95%> (ø)
cmd/controller.go 31.37% <50.00%> (-1.39%) ⬇️
cmd/tools/trigger.go 56.52% <56.52%> (ø)
cmd/tools/template.go 62.72% <62.72%> (ø)
notifiers/webhook.go 71.05% <100.00%> (+1.60%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c70eb0...8fbc47e. Read the comment docs.

@alexmt alexmt force-pushed the tools branch 2 times, most recently from 62b047e to 2355e1a Compare May 6, 2020 02:03
@alexmt alexmt marked this pull request as ready for review May 6, 2020 02:09
@alexmt alexmt merged commit 0deb181 into argoproj-labs:master May 6, 2020
@alexmt alexmt deleted the tools branch May 6, 2020 04:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant