-
Notifications
You must be signed in to change notification settings - Fork 399
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
[PR #2235/bde08f92 backport][stable-9] Add generate_mark() function and corresponding unit test. #2239
Conversation
SUMMARY I created a function inside of the Connection class to generate a random string to replace existing repetitive code. Since this functionality was only currently used in this particular class and still relies on the MARK_LENGTH variable, I did not pull it out as a separate/common utility. This function generates a random string of characters based on a globally-defined MARK_LENGTH variable, which seem to be used to bookend SSM CLI input. This existed in the previous iteration of this code, and I did not change it because I was not able to ascertain why 26 was chosen as the length in the first place, and I did not want to make a prescriptive decision around that. There is an existing unit test that calls "5" as the MARK_LENGTH, so I assume that would have worked as well, but did not want to make breaking changes to the existing unit test. This may be something for a future TODO if the team wants to clarify/standardize a length for this string. I wrote a unit test for this and confirmed that it passes, though I mainly did that for my own benefit and practice, and don't believe that this function really required any unit testing given what it's doing. Fixes #ACA-2096 ISSUE TYPE Feature Pull Request COMPONENT NAME Function to generate a random string for AWS SSM CLI delimiting. Reviewed-by: Mark Chappell Reviewed-by: Mandar Kulkarni <[email protected]> Reviewed-by: GomathiselviS <[email protected]> Reviewed-by: Bianca Henderson <[email protected]> Reviewed-by: Bikouo Aubin Reviewed-by: Mike Graves <[email protected]> (cherry picked from commit bde08f9)
Build failed (gate pipeline). For information on how to proceed, see https://ansible.softwarefactory-project.io/zuul/buildset/f56dc321612e4659a1ec291ae08d957d ✔️ ansible-galaxy-importer SUCCESS in 8m 04s (non-voting) |
regate |
Build succeeded (gate pipeline). ❌ ansible-galaxy-importer FAILURE in 4m 40s (non-voting) |
9e45658
into
stable-9
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
This is a backport of PR #2235 as merged into main (bde08f9).
SUMMARY
I created a function inside of the Connection class to generate a random string to replace existing repetitive code. Since this functionality was only currently used in this particular class and still relies on the MARK_LENGTH variable, I did not pull it out as a separate/common utility.
This function generates a random string of characters based on a globally-defined MARK_LENGTH variable, which seem to be used to bookend SSM CLI input.
This existed in the previous iteration of this code, and I did not change it because I was not able to ascertain why 26 was chosen as the length in the first place, and I did not want to make a prescriptive decision around that. There is an existing unit test that calls "5" as the MARK_LENGTH, so I assume that would have worked as well, but did not want to make breaking changes to the existing unit test. This may be something for a future TODO if the team wants to clarify/standardize a length for this string.
I wrote a unit test for this and confirmed that it passes, though I mainly did that for my own benefit and practice, and don't believe that this function really required any unit testing given what it's doing.
Fixes #ACA-2096
ISSUE TYPE
COMPONENT NAME
Function to generate a random string for AWS SSM CLI delimiting.