-
Notifications
You must be signed in to change notification settings - Fork 65
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
DRIVERS-2723: ensure atlas cluster names are unique #351
DRIVERS-2723: ensure atlas cluster names are unique #351
Conversation
# - the string cannot be > 64 characters long, so we hash the name to shorten it and maintain its uniqueness (hashes do have collisions but infrequently | ||
# enough that hashing suffices here) | ||
# - we convert it to hex encoding because cluster names must be alphanumeric (hyphens are allowed) | ||
transform="process.stdout.write(require('crypto').createHash('md5').update(process.argv[1]).digest().toString('hex'))" |
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.
I couldn't find a hashing CLI tool that would reliably be available across all distros in CI.
Node should be pre-installed on every distro.
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.
Node patch run on affected variants: https://spruce.mongodb.com/version/6503802d32f417b863191cf2/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC
Just realised you already linked one and didn't need to start my own. :)
LGTM
The previous changes to make cluster names unique did not actually produce unique cluster names. each task id starts with the project name, so piping the task_id into
base64 | head -c 8
produces the same string for each evergreen project.This PR does two things:
execution
expansion is also included, to ensure function names are unique across restartspatch in Node showing unique cluster names for both tasks that use these scripts in CI: https://spruce.mongodb.com/version/65035e55d6d80a62019a64bc/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC