-
Notifications
You must be signed in to change notification settings - Fork 4
[IT-4483] Refactor get_synapse_owner_id #63
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
Conversation
Refactor get_synapse_owner_id method to get the owner ID from both synapse::ownerId and aws:servicecatalog:provisioningPrincipalArn tags with the former as the preffered option and the latter as the fallback option.
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.
Pull Request Overview
Refactor the get_synapse_owner_id method to prioritize the synapse:ownerId tag over the aws:servicecatalog:provisioningPrincipalArn tag, providing a fallback mechanism for owner identification.
- Updated function logic to check for
synapse:ownerIdfirst, then fall back to extracting ID from the provisioning principal ARN - Changed error handling from raising
ValueErrorto returningNonewhen no valid tags are found - Enhanced input validation with proper
TypeErrorfor unsupported input types
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| set_tags/utils.py | Refactored get_synapse_owner_id function to implement tag priority logic and improved error handling |
| tests/unit/utils/test_get_synapse_owner_id.py | Comprehensive test suite rewrite covering all scenarios including both tag types, priority behavior, and edge cases |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Add a script to allow admins to easily change supported service catalog provisioned product owners. This script will do the following: 1. Change owner at the service catalog product level 2. Update provisioned resource tags with the new owner info 3. Update bucket policies to allow the new owner read/write access to the bucket Limitations: 1. New users are able to stop, start, and restart the instance from the service catalog actions. However they will not be able to access an EC2 terminal session or notebook or webui session. Note: this script only works when executed with Admin access depends on #63
Update teh cfn-cr-synapse-tagger lambda to include a refactored get_synapse_owner_id method. depends on Sage-Bionetworks-IT/cfn-cr-synapse-tagger#63
Update teh cfn-cr-synapse-tagger lambda to include a refactored get_synapse_owner_id method. depends on Sage-Bionetworks-IT/cfn-cr-synapse-tagger#63
Refactor get_synapse_owner_id method to get the owner ID from both synapse::ownerId and aws:servicecatalog:provisioningPrincipalArn tags with the former as the preferred option and the latter as the fallback option.
This implements the following proposal in IT-4483: