-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Add support for handling PR updates in asana task attachments #212
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
base: master
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
vn6
left a comment
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.
functionality looks good! just a couple comments to clean up the logic here
src/asana/helpers.py
Outdated
| ] | ||
|
|
||
| # Update the attachments mapping in DynamoDB | ||
| dynamodb_client.update_attachments_for_github_node(github_node_id, new_attachments) |
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.
this can be simplified to just use the current_asset_ids instead of creating a new list for new_attachments (though would need to fix types)
| dynamodb_client.update_attachments_for_github_node(github_node_id, new_attachments) | |
| dynamodb_client.update_attachments_for_github_node(github_node_id, current_asset_ids) |
and change the for loop above to just go through assets_to_create
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 am not sure I got your point but I feel like current implementation is good enough. We can't change the types for update_attachments function since it need the full attachments information, not just asset_ids. I've renamed some of the variables to make things more clear but don't really see that it can be simplified further. Also, attachments count should be really low, no more than around 10, so I don't think it will have any performance impact either.
7ef0ccc to
9bcaf06
Compare
9bcaf06 to
741b957
Compare

Description
This PR introduces support for handling updates of PR description/comments and updating corresponding attachments in asana task.
Test
Added unit tests are passing, added tests for all new functions.
Pull Request synchronized with Asana task
Pull Request: #212