Skip to content

DELETE - Add S3 Key module for PowerScale (ECS02C-808)#241

Open
ShrinidhiRao15 wants to merge 12 commits into
mainfrom
usr/shrinidhirao15/s3_key
Open

DELETE - Add S3 Key module for PowerScale (ECS02C-808)#241
ShrinidhiRao15 wants to merge 12 commits into
mainfrom
usr/shrinidhirao15/s3_key

Conversation

@ShrinidhiRao15
Copy link
Copy Markdown
Contributor

Summary

This PR adds the s3_key module for managing S3 keys on Dell PowerScale.

JIRA Story: ECS02C-808
Reference PR: #208
Reference Branch: https://github.com/fpfuetsch/ansible-powerscale/tree/feature-207-s3key-support

Purpose

Created from the commits in PR #208 for Jenkins testing of the s3_key module.

Changes

  • Add s3_key plugin module for PowerScale S3 key management
  • Unit tests and mock API for s3_key module
  • Sample playbook for s3_key operations
  • Module documentation (docs/modules/s3_key.rst)
  • Sanity and linting fixes

Testing

This branch is intended for Jenkins CI/CD pipeline testing.

fpfuetsch and others added 7 commits April 2, 2026 15:48
Signed-off-by: fpfuetsch <54020707+fpfuetsch@users.noreply.github.com>
Signed-off-by: fpfuetsch <54020707+fpfuetsch@users.noreply.github.com>
Signed-off-by: fpfuetsch <54020707+fpfuetsch@users.noreply.github.com>
Signed-off-by: fpfuetsch <54020707+fpfuetsch@users.noreply.github.com>
Signed-off-by: fpfuetsch <54020707+fpfuetsch@users.noreply.github.com>
- Fix shared mock state leakage across unit tests by using deepcopy
  for params and fresh MagicMock instances for protocol_api methods
- Add 6 new unit tests: 404 handling, idempotency (if_not_present),
  check mode (create/delete), generic exception, key rotation response
- Add mock data for rotation response (S3_CREATE_KEY_WITH_ROTATION_RESPONSE)
- Fix typo in module docstring ("exisitng" -> "existing")
- Add RST documentation for s3_key module (docs/modules/s3_key.rst)

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 98.42767% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.56%. Comparing base (af844f7) to head (f03d38c).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
plugins/modules/s3_key.py 96.69% 3 Missing and 1 partial ⚠️
tests/unit/plugins/module_utils/mock_s3_key_api.py 95.65% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   90.41%   90.56%   +0.14%     
==========================================
  Files         143      146       +3     
  Lines       16969    17287     +318     
  Branches     2354     2376      +22     
==========================================
+ Hits        15343    15656     +313     
- Misses        959      962       +3     
- Partials      667      669       +2     
Flag Coverage Δ
units 90.56% <98.42%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ShrinidhiRao15 and others added 5 commits April 2, 2026 21:22
Add three new test cases to address coverage findings from
build 916 report (ECS02C-990):

- test_prereqs_validation_failure: covers lines 196-197
  (validate_module_pre_reqs returning all_packages_found=False)
- test_get_s3_key_returns_none: covers line 218
  (get_s3_key API returning None)
- test_create_s3_key_falsy_response: covers line 268
  (create_s3_key API returning falsy/None response)

Also adds PREREQS_VALIDATE_FAILURE fixture to mock_s3_key_api.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Address three categories of CheckMarx security issues:

Use_Of_Hardcoded_Password:
- Replace hardcoded secret key in RETURN doc sample with masked value
- Replace hardcoded secret keys in test mock data with masked values

Information_Exposure_Through_an_Error_Message:
- Separate detailed error info (via utils.determine_error) from user-facing
  fail_json messages. Raw error details are logged for debugging but no
  longer included in the Ansible task failure output.

Filtering_Sensitive_Logs:
- Remove logging of s3_key_params dict which could contain sensitive SDK
  objects. Log operation context (user, access_zone) instead.
- Remove explicit no_log=False on existing_key_expiry_minutes parameter.

All 19 unit tests pass with these changes.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Replace f-string interpolation in LOG.error() calls with lazy %
formatting as required by pylint. Affects 4 error handler sites
in get_key_details, create_key, and delete_key methods.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The existing_key_expiry_minutes parameter name triggers Ansible's
validate-modules no-log-needed check due to the 'key' substring.
Restore explicit no_log=False to acknowledge it is not a secret.
This is the standard pattern used across the collection (e.g.
info.py filter_key, subnet.py ranges).

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ShrinidhiRao15 ShrinidhiRao15 changed the title Add S3 Key module for PowerScale (ECS02C-808) DELETE - Add S3 Key module for PowerScale (ECS02C-808) Apr 3, 2026
@ShrinidhiRao15
Copy link
Copy Markdown
Contributor Author

To be deleted as the code change made here has been merged into customer PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants