Skip to content

CDRIVER-4519 Replace manual OCSP venv creation with activate-ocspvenv.sh #1163

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

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

eramongodb
Copy link
Contributor

Related to CDRIVER-4519, followup to #1155.

Replaces manual Python lookup and package upgrade routines with a sourcing of the activate-ocspvenv.sh script and removes the unused SKIP_PIP_INSTALL variable.

Verified by this patch.

@eramongodb eramongodb self-assigned this Dec 14, 2022
@@ -1055,7 +1055,7 @@ def to_dict(self):
test_column = 'TEST_4' if self.test == 'cache' else self.test.upper()

commands.append(shell_mongoc(
'TEST_COLUMN=%s CERT_TYPE=%s USE_DELEGATE=%s sh .evergreen/run-ocsp-responder.sh' % (
'TEST_COLUMN=%s CERT_TYPE=%s USE_DELEGATE=%s bash .evergreen/run-ocsp-responder.sh' % (
Copy link
Member

@jmikola jmikola Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually tripped me up while working on mongodb/mongo-php-driver#1391. I was wondering why neither the shell: bash option on the shell.exec command nor the #!/usr/bin/env bash line in the script were still leading to errors about unsupported shell syntax in the venv and find-python scripts.

On a separate note, I did some significant refactoring to the run-ocsp-responder.sh script in that PR if you'd like to adapt it here. I imagine libmongoc previously clones the drivers-evergreen-tools repo, so I decided to reference $DRIVERS_TOOLS and $PROJECT_DIRECTORY directly in that script.


Writing this comment reminded me that I neglected to add $DRIVERS_TOOLS and $PROJECT_DIRECTORY and to the script's doc header as required env vars, so I'll make sure I do so before merging.

I think your script has the same issue with referring to $CDRIVER_ROOT and $CDRIVER_BUILD.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I will prefer to leave the changes minimal for now.

$CDRIVER_ROOT and $CDRIVER_BUILD are defined at the top of the file and defaults to the current working directory if not already set. As far as I can tell, these variables are never set prior to invocation of this script from within the mongoc directory in all C Driver Evergreen tests, so the assumptions used here should not be an issue, unlike what may have been in the PHP Driver.

I imagine libmongoc previously clones the drivers-evergreen-tools repo

This is not always guaranteed; it depends on the given task and functions invoked, which is why this PR uses a check+clone.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$CDRIVER_ROOT and $CDRIVER_BUILD are defined at the top of the file...

Ah, missed that since it was outside the diff. Sounds like a good approach I might actually want to incorporate into PHP then :)

@eramongodb eramongodb merged commit 5915ff9 into mongodb:master Dec 16, 2022
@eramongodb eramongodb deleted the cdriver-4519 branch December 16, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants