Skip to content
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

feat(event_source): add CodeDeploy Lifecycle Hook event #5219

Conversation

mw-root
Copy link
Contributor

@mw-root mw-root commented Sep 23, 2024

Issue number: #5171

Summary

This is a simple change to implement the lambda event type CodeDeployLifeCycleHookLambdaEvent.

This event only provides DeploymentId and LifecycleEventHookExecutionId (at least in my experience)

Changes

This adds a new DictWrapper inherited class to define the properties passed by CodeDeployment.

User experience

This allows users to use the new class as an event type in their lambda handler

from aws_lambda_powertools.utilities.data_classes import (
  event_source,
  CodeDeployLifeCycleHookEvent,
)

def lambda_handler(
    event: CodeDeployLifeCycleHookEvent, context: LambdaContext
) -> None:
  ...

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change? This is new functionality and is not a breaking change.

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.

@mw-root mw-root requested a review from a team September 23, 2024 22:55
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 23, 2024
@github-actions github-actions bot added the feature New feature or functionality label Sep 24, 2024
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.21%. Comparing base (32061f0) to head (1a56c94).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5219   +/-   ##
========================================
  Coverage    96.21%   96.21%           
========================================
  Files          228      229    +1     
  Lines        10746    10755    +9     
  Branches      2001     2003    +2     
========================================
+ Hits         10339    10348    +9     
  Misses         321      321           
  Partials        86       86           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leandrodamascena leandrodamascena linked an issue Sep 24, 2024 that may be closed by this pull request
2 tasks
@leandrodamascena leandrodamascena changed the title feat: Add CodeDeploy Lifecycle Hook event definition feat(event_source): add CodeDeploy Lifecycle Hook event Sep 24, 2024
@mw-root
Copy link
Contributor Author

mw-root commented Sep 24, 2024

Oh duh, I'll add tests.

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 24, 2024
@boring-cyborg boring-cyborg bot added the tests label Sep 24, 2024
@mw-root mw-root force-pushed the v3-add-codedeploy-lifecycle-hook-event-class branch from 7a2e9c6 to 9e1c810 Compare September 24, 2024 14:57
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Hey @mw-root! Thanks a lot for working and fixing this PR! Everything looks great for me, we just need to this new class in our documentation. If you have problems to run the documentation locally, please let me know and I can help.

mw-root and others added 5 commits September 24, 2024 12:40
…ycle_hook_event.py

Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: Mike W <12434761+mw-root@users.noreply.github.com>
Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: Mike W <12434761+mw-root@users.noreply.github.com>
…_lifecycle_hook_event.py

Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: Mike W <12434761+mw-root@users.noreply.github.com>
…_lifecycle_hook_event.py

Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: Mike W <12434761+mw-root@users.noreply.github.com>
Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: Mike W <12434761+mw-root@users.noreply.github.com>
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@mw-root
Copy link
Contributor Author

mw-root commented Sep 24, 2024

@leandrodamascena thanks again for your help.

Are docs auto-generated or should I add them by hand? I ran mkdocs build but didn't see any changes afterward.

@leandrodamascena
Copy link
Contributor

Are docs auto-generated or should I add them by hand?

Our documentation is not automatically generated, but we are working on it somewhere in the near future. You need to open https://github.com/aws-powertools/powertools-lambda-python/blob/develop/docs/utilities/data_classes.md, and add an example in the example folder. Check the VPC Lattice V2 in this documentation and you'll see how to do that.

I ran mkdocs build but didn't see any changes afterward.

If you have already created the Poetry environment, you can use make docs-local. If not, use make docs-local-docker to run it in Docker.

Please let me know if you have any additional question and I can help with that.

@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Sep 24, 2024
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Sep 24, 2024
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Just 2 small changes and we are good to merge! Go go go!! 🚀

Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: Mike W <12434761+mw-root@users.noreply.github.com>
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Sep 24, 2024
Co-authored-by: Leandro Damascena <lcdama@amazon.pt>
Signed-off-by: Mike W <12434761+mw-root@users.noreply.github.com>
Copy link

@leandrodamascena leandrodamascena self-requested a review September 24, 2024 17:21
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

APPROVED @mw-root! Thanks a lot for addressing all the feedback! 🥇

@mw-root
Copy link
Contributor Author

mw-root commented Sep 24, 2024

@leandrodamascena Thanks for all your help!

@leandrodamascena
Copy link
Contributor

@leandrodamascena Thanks for all your help!

We love it when we have people from the community helping us improve the project! It means the world to us.

I'm justing waiting the CI turns green to merge the PR.

@leandrodamascena leandrodamascena merged commit 8329bf3 into aws-powertools:develop Sep 24, 2024
11 checks passed
Copy link

boring-cyborg bot commented Sep 24, 2024

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@mw-root mw-root deleted the v3-add-codedeploy-lifecycle-hook-event-class branch September 24, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature New feature or functionality size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Add CodeDeploy Lifecycle hook event to data classes
2 participants