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: Adding a new version of the PagerDuty integration which uses Events API v2 #105

Merged
merged 1 commit into from
May 8, 2023

Conversation

EricTendian
Copy link
Contributor

@EricTendian EricTendian commented Sep 14, 2022

This PR adds a new version of the PagerDuty service using the Events API v2 instead of the Incident Creation API. The previous API was not meant for use by automation, whereas the Events API matches existing patterns for how to trigger events/incidents in PagerDuty with an integration. I've added docs to note the new configuration.

To avoid a breaking change, this has a service name of pagerdutyv2 instead of pagerduty.

Fixes #89.

Signed-off-by: Eric Tendian <erictendian[at]gmail.com>

@EricTendian EricTendian force-pushed the pagerduty-v2 branch 2 times, most recently from c04d114 to 7347b12 Compare September 14, 2022 15:01
@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Patch coverage: 72.51% and project coverage change: +0.97 🎉

Comparison is base (c028d2f) 52.90% compared to head (102c997) 53.88%.

❗ Current head 102c997 differs from pull request most recent head 8c351f4. Consider uploading reports for the commit 8c351f4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
+ Coverage   52.90%   53.88%   +0.97%     
==========================================
  Files          33       34       +1     
  Lines        2807     2938     +131     
==========================================
+ Hits         1485     1583      +98     
- Misses       1101     1128      +27     
- Partials      221      227       +6     
Impacted Files Coverage Δ
pkg/services/services.go 27.31% <33.33%> (+1.80%) ⬆️
pkg/services/pagerdutyv2.go 75.40% <75.40%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@EricTendian EricTendian force-pushed the pagerduty-v2 branch 2 times, most recently from 223941c to 3076045 Compare September 15, 2022 00:57
@pasha-codefresh
Copy link
Member

Hey @EricTendian , i think we need move with idea to create it as new integration and not break existing one

@EricTendian EricTendian changed the title feat: Rewriting PagerDuty integration to use Events API v2 feat: Adding a new version of the PagerDuty integration which uses Events API v2 Apr 11, 2023
@EricTendian
Copy link
Contributor Author

@pasha-codefresh I finally got around to updating this, take a look and let me know if that is more what you're looking for.

data:
template.rollout-aborted: |
message: Rollout {{.rollout.metadata.name}} is aborted.
pagerduty:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be pagerdutyv2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

@jjtroberts
Copy link

Thank you @EricTendian for working on this. I'm looking forward to this capability once it is released.

Signed-off-by: Eric Tendian <erictendian@gmail.com>
@zachaller zachaller merged commit 2bb2fcd into argoproj:master May 8, 2023
mayzhang2000 pushed a commit that referenced this pull request May 9, 2023
Signed-off-by: Eric Tendian <erictendian@gmail.com>
zachaller added a commit that referenced this pull request Jul 12, 2023
* self-service from event

* chore: replace github.com/ghodss/yaml with sigs.k8s.io/yaml (#175)

At the time of making this commit, the package `github.com/ghodss/yaml`
is no longer actively maintained.

`sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively
maintained by Kubernetes SIG.

Reference: argoproj/argo-cd#13292 (comment)

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* feat: Adding new PagerDuty integration based on Events API v2 (#105)

Signed-off-by: Eric Tendian <erictendian@gmail.com>

* self-service from event

* self-service from event

* self-service from event

* self-service from event

* self-service from event

* clean up factory.go

* error handleing in factory.go

* error handleing in factory.go

* error handleing in factory.go

* error handleing in factory.go

* error handleing in factory.go

* error handleing in factory.go

* error handleing in factory.go

* better caching

* better caching

* refactor

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* unused

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* lint

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* bump ci

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* small fixes

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* rename

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* rename

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* rename

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* change log line

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* update tests

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* continue on error

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* continue on errors

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* add godoc

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* continue on error

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* fix error by going back to non namespace support

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* fix log

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

* improve log on error

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eric Tendian <erictendian@gmail.com>
Signed-off-by: zachaller <zachaller@users.noreply.github.com>
Co-authored-by: May Zhang <may_zhang@intuit.com>
Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Eric Tendian <erictendian@gmail.com>
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.

PagerDuty Service Integration - Incident Creation API
5 participants