-
Notifications
You must be signed in to change notification settings - Fork 401
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
Add generate_mark() function and corresponding unit test. #2235
Add generate_mark() function and corresponding unit test. #2235
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @chynasan,
Code looks fine, you're hitting a bunch of whitespace related sanity/formatting issues. I'd recommend running tox -m format
and tox -m lint
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixing whitespace errors as suggested Co-authored-by: Mandar Kulkarni <[email protected]>
Build failed (gate pipeline). For information on how to proceed, see https://ansible.softwarefactory-project.io/zuul/buildset/b389f4cd2ec246c6a43a3cd65a4d9468 ❌ ansible-galaxy-importer FAILURE in 4m 29s (non-voting) |
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 08s (non-voting) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Build succeeded (gate pipeline). ✔️ ansible-galaxy-importer SUCCESS in 3m 16s (non-voting) |
bde08f9
into
ansible-collections:main
Backport to stable-9: 💚 backport PR created✅ Backport PR branch: Backported as #2239 🤖 @patchback |
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)
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 Feature Pull Request COMPONENT NAME Function to generate a random string for AWS SSM CLI delimiting. Reviewed-by: Mark Chappell
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.