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

fix(aws): handle none type attributes #5216

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

sergargar
Copy link
Member

@sergargar sergargar commented Sep 26, 2024

Description

Handle None type attributes in checks:

  • organizations_scp_check_deny_regions
  • ecr_repositories_not_publicly_accessible

Also, fix typo in work accessible.

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sergargar sergargar requested review from a team as code owners September 26, 2024 18:44
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Sep 26, 2024
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 79.06977% with 9 lines in your changes missing coverage. Please review.

Project coverage is 89.10%. Comparing base (ff05ce4) to head (62b0882).
Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
...ny_regions/organizations_scp_check_deny_regions.py 77.77% 8 Missing ⚠️
...ws/services/organizations/organizations_service.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5216      +/-   ##
==========================================
- Coverage   89.11%   89.10%   -0.01%     
==========================================
  Files         986      989       +3     
  Lines       30290    30400     +110     
==========================================
+ Hits        26992    27087      +95     
- Misses       3298     3313      +15     

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

Copy link
Member

Choose a reason for hiding this comment

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

Could you please add tests for the following lines:

  • 74
  • 82 to 85
  • 88 to 90

If we are changing the logic of the check we should cover those scenarios.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jfagoagas the logic of the check was not changed, only the following line was added:
if org.policies is not None: # Access denied to list policies

Copy link
Member

Choose a reason for hiding this comment

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

Yes but even with that I think those lines are not being tested, you should add a test to verify when org.policies is None, don't you?

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, test was added!

@jfagoagas jfagoagas self-requested a review September 30, 2024 09:58
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

Great one, thanks @sergargar 🚀

@jfagoagas jfagoagas merged commit 3d2f1a3 into master Sep 30, 2024
9 of 11 checks passed
@jfagoagas jfagoagas deleted the PRWLR-4943-fix-errors-pre-release branch September 30, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants