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

[WIP] Refactor Some Command-Related Methods in aws_ssm.py #2248

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

beeankha
Copy link

@beeankha beeankha commented Feb 17, 2025

SUMMARY

🚧 This PR is still a work in progress and not yet ready for review 🚧

This work is part of the currently ongoing AWS SSM Connection Refactoring & Plugin Promotion effort and related to ansible-collections/amazon.aws#2394.

Fixes ACA-2095

ISSUE TYPE
  • Feature Pull Request
TASK LIST
  • The _exec_transport_commands method is refactored to accept a single structured object that contains the necessary command data. This object is a custom object with a clear structure that defines the commands and their parameters (Commands is a tuple containing lists of command dictionaries).
  • Create a custom dataclass to hold command output.
  • Create a custom dataclass to hold command results.
  • The _generate_commands function returns a list of typed dictionaries with clear metadata (command strings, method, headers).
  • _exec_transport_commands accepts a list of typed dictionaries as an argument and returns the custom CommandResults object.
  • Python type hints are added to the method signature and the structured object to improve readability, facilitate static analysis, and clearly define the expected structure and data types.
  • Docstrings should be added to any refactored methods and the structured object (if custom), clarifying the purpose, structure, inputs, outputs, and any edge cases or special handling (if applicable).
  • Unit tests have been created to ensure that the refactored _generate_commands method outputs the expected structured command object.
  • Add a changelog file.

@beeankha beeankha added the WIP Work in progress label Feb 17, 2025
@beeankha beeankha self-assigned this Feb 17, 2025
Copy link
Contributor

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/ansible-collections/community.aws for 2248,f0da9b82ad297cf0279d614cc1031dcf568760e3

…ries containing commands; add type hinting and docstring
…ate_commands() and _exec_transport_commands(); add type hinting and docstring
@beeankha beeankha force-pushed the refactor-exec-transport-command-method branch from b46d9dc to 17a29e9 Compare February 17, 2025 17:18
Copy link
Contributor

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

ansible-galaxy-importer FAILURE in 4m 42s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 25s
✔️ ansible-test-splitter SUCCESS in 4m 02s
integration-community.aws-1 FAILURE in 58m 33s
integration-community.aws-2 FAILURE in 25m 09s
integration-community.aws-3 FAILURE in 25m 35s
integration-community.aws-4 FAILURE in 27m 15s
integration-community.aws-5 FAILURE in 26m 27s
integration-community.aws-6 FAILURE in 26m 48s
integration-community.aws-7 FAILURE in 24m 43s
integration-community.aws-8 FAILURE in 25m 47s
integration-community.aws-9 FAILURE in 24m 38s
✔️ integration-community.aws-10 SUCCESS in 6m 37s
integration-community.aws-11 FAILURE in 28m 50s
Skipped 11 jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant