-
Notifications
You must be signed in to change notification settings - Fork 77
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
Zendesk request override get tasks #5429
Conversation
Adding an override that checks on the status of the tickets, and skips the delete in case the user still has open tickets
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I'm not sure on which of the Two PR's the Changelog should be updated. Putting them here for now |
fides
|
Project |
fides
|
Branch Review |
refs/pull/5429/merge
|
Run status |
|
Run duration | 00m 38s |
Commit |
|
Committer | Bruno Gutierrez Rios |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
4
|
View all changes introduced in this branch ↗︎ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5429 +/- ##
==========================================
- Coverage 85.47% 85.41% -0.06%
==========================================
Files 384 385 +1
Lines 24119 24152 +33
Branches 2625 2630 +5
==========================================
+ Hits 20615 20630 +15
- Misses 2950 2967 +17
- Partials 554 555 +1 ☔ View full report in Codecov by Sentry. |
Is it possible that Codecov is missing the test coverage because we are missing the Zendesk_config.yml file? |
## Uplifted from Connectors-logitech | ||
## See https://github.com/ethyca/connectors-logitech/blob/main/connectors/zendesk/zendesk_request_overrides.py#L95 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to mention customer's names in this public repo
|
||
|
||
@register("zendesk_logitech_tickets_read", [SaaSRequestType.READ]) | ||
def zendesk_logitech_tickets_read( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, let's just call it zendesk_tickets_read
def zendesk_logitech_tickets_read( | |
def zendesk_tickets_read( |
@@ -40,7 +40,7 @@ def zendesk_erasure_identity_email() -> str: | |||
class ZendeskClient: | |||
def __init__(self, secrets: Dict[str, Any]): | |||
self.base_url = f"https://{secrets['domain']}" | |||
self.auth = secrets["username"], secrets["api_key"] | |||
self.auth = secrets["username"] + "/token", secrets["api_key"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented on this somewhere else too, but if we don't have a migration in place to migrate the username, we should just leave things as they are. I agree this is cleaner, but we would break existing integrations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, i think we should add it to the hoverable description on the config. Something that points to the user that they hadd to add the "/token" at the end without lookinv over the Zendesk Docs
CHANGELOG.md
Outdated
@@ -21,6 +21,9 @@ The types of changes are: | |||
- Added DataHub integration config [#5401](https://github.com/ethyca/fides/pull/5401) | |||
- Added keepalive settings to the Redshift integration [#5433](https://github.com/ethyca/fides/pull/5433) | |||
|
|||
### Changed | |||
- Adding a Request Override on Zendesk Ticket's that checks for the tickets statuses on a Delete Request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Adding a Request Override on Zendesk Ticket's that checks for the tickets statuses on a Delete Request | |
- Preventing erasures for the Zendesk integration if there are any open tickets [#5429](https://github.com/ethyca/fides/pull/5429) |
""" | ||
if policy.get_rules_for_action(action_type=ActionType.erasure): | ||
for ticket in tickets: | ||
## TODO: Check with Ramp that the Statuses list is the expected one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, let's avoid putting customer names in the comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we move to fidesplus, we're ok 😄
( | ||
access_results, | ||
erasure_results, | ||
) = await zendesk_runner.non_strict_erasure_request( | ||
access_policy=policy, | ||
erasure_policy=erasure_policy_string_rewrite, | ||
identities={"email": zendesk_erasure_identity_email}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simplify this since we're not using the results
( | |
access_results, | |
erasure_results, | |
) = await zendesk_runner.non_strict_erasure_request( | |
access_policy=policy, | |
erasure_policy=erasure_policy_string_rewrite, | |
identities={"email": zendesk_erasure_identity_email}, | |
) | |
await zendesk_runner.non_strict_erasure_request( | |
access_policy=policy, | |
erasure_policy=erasure_policy_string_rewrite, | |
identities={"email": zendesk_erasure_identity_email}, | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small change and we're good to go!
""" | ||
if policy.get_rules_for_action(action_type=ActionType.erasure): | ||
for ticket in tickets: | ||
if ticket["status"] in ["new", "open", "pending", "hold", "solved"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave this some more thought, we can be a bit safer about this. Let's just halt the request if any ticket is not set to "closed". It's better to check for an explicit "closed" than to try to enumerate over all statuses that can be considered open.
if ticket["status"] in ["new", "open", "pending", "hold", "solved"]: | |
if ticket["status"] != "closed": |
fides
|
Project |
fides
|
Branch Review |
main
|
Run status |
|
Run duration | 00m 38s |
Commit |
|
Committer | Bruno Gutierrez Rios |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
4
|
View all changes introduced in this branch ↗︎ |
Closes LA#32
Pairs With FidesPlus#1685
Description Of Changes
Creating a new Request Override that would check for the status of the ticket on a delete request and halt it if there is an open ticket
Currently we are using a default list to determine if a ticket is open. Basically, anything that its not "closed" its open. The list is ["new", "open", "pending", "hold", "solved"]
It could be a parametrized list on the future, but the current fides iteration does not support indicating a multi-select field from the config.yml file
Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.md