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

[PR #2235/bde08f92 backport][stable-9] Add generate_mark() function and corresponding unit test. #2239

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Feb 7, 2025

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.

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)
@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Feb 7, 2025
Copy link
Contributor

Build failed (gate pipeline). For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

https://ansible.softwarefactory-project.io/zuul/buildset/f56dc321612e4659a1ec291ae08d957d

✔️ ansible-galaxy-importer SUCCESS in 8m 04s (non-voting)
✔️ build-ansible-collection SUCCESS in 11m 30s
✔️ ansible-test-splitter SUCCESS in 4m 46s
✔️ integration-community.aws-1 SUCCESS in 56m 49s
✔️ integration-community.aws-2 SUCCESS in 14m 07s
✔️ integration-community.aws-3 SUCCESS in 15m 46s
integration-community.aws-4 RETRY_LIMIT in 1m 53s
✔️ integration-community.aws-5 SUCCESS in 14m 22s
✔️ integration-community.aws-6 SUCCESS in 14m 58s
✔️ integration-community.aws-7 SUCCESS in 14m 54s
✔️ integration-community.aws-8 SUCCESS in 14m 46s
✔️ integration-community.aws-9 SUCCESS in 14m 48s
✔️ integration-community.aws-10 SUCCESS in 5m 28s
✔️ integration-community.aws-11 SUCCESS in 16m 59s
Skipped 11 jobs

@alinabuzachis
Copy link
Contributor

regate

Copy link
Contributor

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

ansible-galaxy-importer FAILURE in 4m 40s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 34s
✔️ ansible-test-splitter SUCCESS in 4m 15s
✔️ integration-community.aws-1 SUCCESS in 23m 43s
✔️ integration-community.aws-2 SUCCESS in 14m 10s
✔️ integration-community.aws-3 SUCCESS in 16m 20s
✔️ integration-community.aws-4 SUCCESS in 15m 14s
✔️ integration-community.aws-5 SUCCESS in 16m 03s
✔️ integration-community.aws-6 SUCCESS in 18m 04s
✔️ integration-community.aws-7 SUCCESS in 16m 54s
✔️ integration-community.aws-8 SUCCESS in 15m 57s
✔️ integration-community.aws-9 SUCCESS in 15m 52s
✔️ integration-community.aws-10 SUCCESS in 6m 12s
✔️ integration-community.aws-11 SUCCESS in 15m 56s
Skipped 11 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 9e45658 into stable-9 Feb 13, 2025
67 of 83 checks passed
@softwarefactory-project-zuul softwarefactory-project-zuul bot deleted the patchback/backports/stable-9/bde08f92fb187fe1a789847bd670fca46ad50b3f/pr-2235 branch February 13, 2025 15:36
Copy link

Docs Build 📝

Thank you for contribution!✨

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants