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

Big IAM code refactor #1998

Merged

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Feb 27, 2024

SUMMARY

Refactored code to use AnsibleIAMError and IAMErrorHandler as well as moving shared code into module_utils.iam

iam_role_info - Deprecate support for paths without leading and trailing \

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • iam_access_key
  • iam_access_key_info
  • iam_group
  • iam_instance_profile
  • iam_instance_profile_info
  • iam_managed_policy
  • iam_mfa_device_info
  • iam_role
  • iam_role_info
  • iam_user
  • iam_user_info
ADDITIONAL INFORMATION

Copy link

github-actions bot commented Feb 27, 2024

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/57d7914ed8564d2db181bb5b9bcd82c2

✔️ ansible-galaxy-importer SUCCESS in 4m 45s
✔️ build-ansible-collection SUCCESS in 15m 02s
✔️ ansible-test-splitter SUCCESS in 6m 54s
✔️ integration-amazon.aws-1 SUCCESS in 15m 26s
✔️ integration-amazon.aws-2 SUCCESS in 6m 32s
✔️ integration-amazon.aws-3 SUCCESS in 8m 36s
✔️ integration-amazon.aws-4 SUCCESS in 8m 30s
✔️ integration-amazon.aws-5 SUCCESS in 10m 23s
✔️ integration-amazon.aws-6 SUCCESS in 9m 15s
✔️ integration-amazon.aws-7 SUCCESS in 9m 35s
✔️ integration-amazon.aws-8 SUCCESS in 12m 56s
✔️ integration-community.aws-1 SUCCESS in 17m 59s
✔️ integration-community.aws-2 SUCCESS in 6m 45s
integration-community.aws-3 RETRY_LIMIT in 1m 42s
Skipped 33 jobs

@tremble tremble mentioned this pull request Feb 27, 2024
13 tasks
@tremble tremble added the backport-7 PR should be backported to the stable-7 branch label Feb 27, 2024
Copy link
Contributor

@hakbailey hakbailey left a comment

Choose a reason for hiding this comment

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

This all looks good to me, assuming the integration tests pass. I do wonder if we want to add unit tests for any of the new functions in iam module_utils?

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/d9b74e4be5f944eaa2f52bba94e69fdc

✔️ ansible-galaxy-importer SUCCESS in 5m 10s
✔️ build-ansible-collection SUCCESS in 15m 22s
✔️ ansible-test-splitter SUCCESS in 7m 06s
✔️ integration-amazon.aws-1 SUCCESS in 14m 55s
✔️ integration-amazon.aws-2 SUCCESS in 9m 25s
✔️ integration-amazon.aws-3 SUCCESS in 5m 21s
✔️ integration-amazon.aws-4 SUCCESS in 6m 21s
✔️ integration-amazon.aws-5 SUCCESS in 6m 34s
✔️ integration-amazon.aws-6 SUCCESS in 6m 24s
✔️ integration-amazon.aws-7 SUCCESS in 6m 33s
✔️ integration-amazon.aws-8 SUCCESS in 10m 24s
✔️ integration-community.aws-1 SUCCESS in 23m 05s
✔️ integration-community.aws-2 SUCCESS in 6m 53s
✔️ integration-community.aws-3 SUCCESS in 6m 51s
Skipped 33 jobs

@tremble
Copy link
Contributor Author

tremble commented Feb 27, 2024

This all looks good to me, assuming the integration tests pass. I do wonder if we want to add unit tests for any of the new functions in iam module_utils?

Yeah integration tests now pass (iam_access_key didn't run due to bad indentation on no_log)

Tracking unit tests with #2000 might get bundled with #2001

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5565fea26afe40808210285cbd90afe2

✔️ ansible-galaxy-importer SUCCESS in 5m 25s
✔️ build-ansible-collection SUCCESS in 15m 13s
✔️ ansible-test-splitter SUCCESS in 5m 42s
✔️ integration-amazon.aws-1 SUCCESS in 12m 58s
✔️ integration-amazon.aws-2 SUCCESS in 6m 28s
✔️ integration-amazon.aws-3 SUCCESS in 6m 22s
✔️ integration-amazon.aws-4 SUCCESS in 7m 43s
✔️ integration-amazon.aws-5 SUCCESS in 6m 35s
✔️ integration-amazon.aws-6 SUCCESS in 7m 25s
✔️ integration-amazon.aws-7 SUCCESS in 6m 36s
✔️ integration-amazon.aws-8 SUCCESS in 10m 01s
✔️ integration-community.aws-1 SUCCESS in 19m 28s
✔️ integration-community.aws-2 SUCCESS in 7m 07s
✔️ integration-community.aws-3 SUCCESS in 12m 17s
Skipped 33 jobs

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Feb 27, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/6e524640bf32400c834f2721a9c02ab6

✔️ ansible-galaxy-importer SUCCESS in 5m 30s
✔️ build-ansible-collection SUCCESS in 14m 36s
✔️ ansible-test-splitter SUCCESS in 5m 42s
✔️ integration-amazon.aws-1 SUCCESS in 15m 38s
✔️ integration-amazon.aws-2 SUCCESS in 9m 17s
✔️ integration-amazon.aws-3 SUCCESS in 6m 42s
✔️ integration-amazon.aws-4 SUCCESS in 10m 41s
✔️ integration-amazon.aws-5 SUCCESS in 8m 34s
✔️ integration-amazon.aws-6 SUCCESS in 5m 11s
✔️ integration-amazon.aws-7 SUCCESS in 10m 01s
✔️ integration-amazon.aws-8 SUCCESS in 12m 03s
✔️ integration-community.aws-1 SUCCESS in 24m 22s
✔️ integration-community.aws-2 SUCCESS in 8m 23s
✔️ integration-community.aws-3 SUCCESS in 6m 56s
Skipped 33 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit d3edef2 into ansible-collections:main Feb 27, 2024
40 checks passed
Copy link

patchback bot commented Feb 27, 2024

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/d3edef2333ceb3aaa826c1ef870accce9848d096/pr-1998

Backported as #2005

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Feb 27, 2024
Big IAM code refactor

SUMMARY
Refactored code to use AnsibleIAMError and IAMErrorHandler as well as moving shared code into module_utils.iam
iam_role_info - Deprecate support for paths without leading and trailing \
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

iam_access_key
iam_access_key_info
iam_group
iam_instance_profile
iam_instance_profile_info
iam_managed_policy
iam_mfa_device_info
iam_role
iam_role_info
iam_user
iam_user_info

ADDITIONAL INFORMATION

Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: GomathiselviS
Reviewed-by: Mark Chappell
Reviewed-by: Alina Buzachis
(cherry picked from commit d3edef2)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Feb 28, 2024
[PR #1998/d3edef23 backport][stable-7] Big IAM code refactor

This is a backport of PR #1998 as merged into main (d3edef2).
SUMMARY
Refactored code to use AnsibleIAMError and IAMErrorHandler as well as moving shared code into module_utils.iam
iam_role_info - Deprecate support for paths without leading and trailing \
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

iam_access_key
iam_access_key_info
iam_group
iam_instance_profile
iam_instance_profile_info
iam_managed_policy
iam_mfa_device_info
iam_role
iam_role_info
iam_user
iam_user_info

ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Apr 30, 2024
…mValidationError during policy deletion (#2068)

iam_managed_policy - fix ParamValidationError during policy deletion

SUMMARY
fixes: #2067
Introduced by #1998
A copy and paste mistake in #1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
iam_managed_policy
plugins/module_utils/iam.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis
patchback bot pushed a commit that referenced this pull request Apr 30, 2024
…mValidationError during policy deletion (#2068)

iam_managed_policy - fix ParamValidationError during policy deletion

SUMMARY
fixes: #2067
Introduced by #1998
A copy and paste mistake in #1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
iam_managed_policy
plugins/module_utils/iam.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis
(cherry picked from commit 970c303)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Apr 30, 2024
…mValidationError during policy deletion (#2068) (#2071)

[PR #2068/970c3032 backport][stable-7] iam_managed_policy - fix ParamValidationError during policy deletion

This is a backport of PR #2068 as merged into main (970c303).
SUMMARY
fixes: #2067
Introduced by #1998
A copy and paste mistake in #1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
iam_managed_policy
plugins/module_utils/iam.py
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
abraverm pushed a commit to abraverm/amazon.aws that referenced this pull request May 2, 2024
…mValidationError during policy deletion (ansible-collections#2068)

iam_managed_policy - fix ParamValidationError during policy deletion

SUMMARY
fixes: ansible-collections#2067
Introduced by ansible-collections#1998
A copy and paste mistake in ansible-collections#1998 resulted in ParamValidationErrors being triggered when deleting a managed policy which is still attached to a role or user.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
iam_managed_policy
plugins/module_utils/iam.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis
@tremble tremble deleted the iam-refactor branch June 12, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7 PR should be backported to the stable-7 branch mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants