fix(event_sources): Update CodePipeline event source to include optional encryption_key field and make user_parameters field optional#2113
Conversation
The AWS CodePipeline Lambda Action does not require UserParameters to be set, and therefore will be missing from `action_configuration`. This test ensures the data class returns None. https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-Lambda.html
The User Parameters supplied can be arbitary text. This test ensures a JSON parse exception is raised if plain text is supplied as a User Parameter.
The AWS CodePipeline Lambda Action does not require UserParameters to be set, and therefore will be missing from the `action_configuration`. https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-Lambda.html This commit makes user_parameters optional (i.e. return None if the key isn't present).
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
Thank you so much for your contribution @neilramsay! As stated in our CONTRIBUTING guide all pull requests require an Issue first. We'll try to create one for you as soon as possible. |
|
@rubenfonseca I'll create issue. |
|
No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure. |
Thank you for creating the issue @neilramsay! I'll review this PR till tomorrow. |
There was a problem hiding this comment.
This PR looks good to me. Do you have any considerations before we merge it @neilramsay?
| class CodePipelineEncryptionKey(DictWrapper): | ||
| @property | ||
| def get_id(self) -> str: | ||
| return self["id"] | ||
|
|
||
| @property | ||
| def get_type(self) -> str: | ||
| return self["type"] | ||
|
|
||
|
|
There was a problem hiding this comment.
Hi @neilramsay! Looking at the documentation, I see that the encryptionKey field was missing. When you configure a codepipeline with a customer-managed KMS key, the codepipeline includes this field in the Lambda Event.
|
@leandrodamascena nothing extra to add to this PR prior to merge. |
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Issue number: #2117
Summary
The AWS CodePipeline Lambda Action does not require UserParametersto be set, and therefore will be missing from the
action_configuration.https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-Lambda.html
Changes
User experience
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
Not explicitly; runtime wise, this will not break any existing code that works.
It will create additional errors for those performing type checking, and haven't handled this case.
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.