Skip to content

✨ feat(aci): add discord/msteam issue alert migration helper #83455

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

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

iamrajjoshi
Copy link
Member

continues #83123, adding migration helper utils for discord and msteams.

updated the base class a bit so it returns None by default for optional fields. also fixed a tiny bug in the base class blob sanitize function so i also remove the required attributes (since they are part of the first-class fields (integration_id, target_identifier, etc.) on the model)

MsTeams doesn't have a dataclass defined b/c we won't have anything special saved in data blob.

@iamrajjoshi iamrajjoshi self-assigned this Jan 14, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 14, 2025
@iamrajjoshi iamrajjoshi marked this pull request as ready for review January 14, 2025 22:25
@iamrajjoshi iamrajjoshi requested a review from a team as a code owner January 14, 2025 22:25
@iamrajjoshi iamrajjoshi changed the title ✨ feat: add discord/msteam issue alert migration helper ✨ feat(aci): add discord/msteam issue alert migration helper Jan 14, 2025
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 98.50746% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...try/workflow_engine/typings/notification_action.py 97.72% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #83455      +/-   ##
==========================================
+ Coverage   87.52%   87.54%   +0.02%     
==========================================
  Files        9405     9405              
  Lines      537144   537514     +370     
  Branches    21136    21136              
==========================================
+ Hits       470120   470572     +452     
+ Misses      66673    66591      -82     
  Partials      351      351              

Copy link
Member

@cathteng cathteng left a comment

Choose a reason for hiding this comment

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

can you remind me of the policy when migrating a list of actions, but one/some of them are malformed? will we migrate all or none, or only the valid ones?

# Remove excluded keys
return {k: v for k, v in self.action.items() if k not in EXCLUDED_ACTION_DATA_KEYS}
# Remove excluded keys and required fields
excluded_keys = EXCLUDED_ACTION_DATA_KEYS + self.required_fields
Copy link
Member

Choose a reason for hiding this comment

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

are all required fields guaranteed to be stored as fields on Action?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, required fields are the ones stores in integration_id, target_identifier, target_display

Copy link
Member

Choose a reason for hiding this comment

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

should there be some kind of assert for this?

@iamrajjoshi
Copy link
Member Author

can you remind me of the policy when migrating a list of actions, but one/some of them are malformed? will we migrate all or none, or only the valid ones?

we will only migrate the valid ones

@iamrajjoshi iamrajjoshi requested a review from cathteng January 15, 2025 17:25
# Remove excluded keys
return {k: v for k, v in self.action.items() if k not in EXCLUDED_ACTION_DATA_KEYS}
# Remove excluded keys and required fields
excluded_keys = EXCLUDED_ACTION_DATA_KEYS + self.required_fields
Copy link
Member

Choose a reason for hiding this comment

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

should there be some kind of assert for this?

@iamrajjoshi
Copy link
Member Author

should there be some kind of assert for this?

we assert here:

self.assert_action_attributes(
action, rule_data, integration_id_key, target_identifier_key, target_display_key
)

@iamrajjoshi iamrajjoshi merged commit c95fd96 into master Jan 15, 2025
49 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/issue-alert-migration-helper-messaging-2 branch January 15, 2025 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants