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

chore(provider): PagerDuty scopes added and fix: mongodb connection check #1183

Merged
merged 4 commits into from
May 17, 2024

Conversation

KanvaBhatia
Copy link
Contributor

@KanvaBhatia KanvaBhatia commented May 16, 2024

Closes #1031 and #903

πŸ“‘ Description

Added validate_scopes for PagerdutyProvider.
Included the following scopes -

  1. incidents.read
  2. incidents.write
  3. webhook_subscriptions.read
  4. webhook_subscriptions.write
  • Scopes added and created validate_scopes
  • Edit Documentation - Add Scopes, Edit Inputs and Authentication Parameters

Also fixed mongodb always validating scopes.

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

β„Ή Additional Information

Pagerduty -
If api key is wrong (Unauthorized) -
image

If valid api key and authorized -
image

Mongodb -
If wrong URI -
image

If right URI -
image

Copy link

vercel bot commented May 16, 2024

@KanvaBhatia is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

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

Amazing, thanks! πŸ‘‘ two small comments and linter yelling about some unused variable and we’re set!

else:
scopes[scope.name] = response.reason
except Exception as e:
self.logger.error("Error validating scopes", extra={"error": str(e)})
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.logger.error("Error validating scopes", extra={"error": str(e)})
self.logger.exception("Error validating scopes")

@KanvaBhatia KanvaBhatia changed the title chore(provider): PagerDuty scopes added chore(provider): PagerDuty scopes added and fix: mongodb connection check May 17, 2024
@KanvaBhatia
Copy link
Contributor Author

Hey @talboren I by mistake pushed the mongodb changes also in the same branch and they became part of the same PR.
Added the details of that fix in the initial comment.
Fixed the unused variable e in mongodb provider and also logger.exception instead of logger.error.

Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
keep ⬜️ Ignored (Inspect) Visit Preview May 17, 2024 8:21am

@talboren
Copy link
Member

Hey @talboren I by mistake pushed the mongodb changes also in the same branch and they became part of the same PR. Added the details of that fix in the initial comment. Fixed the unused variable e in mongodb provider and also logger.exception instead of logger.error.

No worries! Looks great.

Copy link
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

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

LGTM

@talboren talboren merged commit 687f208 into keephq:main May 17, 2024
5 checks passed
@talboren talboren linked an issue May 17, 2024 that may be closed by this pull request
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.

validate_scopes for PagerDuty bug: MongoDB provider scope is always valid.
2 participants