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

fix mongodb transport obsolete calls #1694

Merged
merged 3 commits into from Apr 18, 2023

Conversation

fmigneault
Copy link
Contributor

changes

  • replace obsolete collection remove by delete_one
  • add test mock spec to check valid methods corresponding to the real objects
    (AttributeError raised if real class does not have this attribute/method)

tests

Validated with latest celery using celery inspect calls that were failing before this fix.

references

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

you used delete one and delete many, on theory they seem to be OK. but I'm not sure about the CI failures. can you please recheck?

@fmigneault
Copy link
Contributor Author

fmigneault commented Apr 13, 2023

The CI failures seems unrelated to the changes (failing dependency install of codecov).
I've successfully executed the test suite locally with pytest for everything related to mongodb.

@fmigneault
Copy link
Contributor Author

you used delete one and delete many

In the case of delete matching by _id, it should be guaranteed to be unique.
Other deletes were comparing only against queue, which is not technically unique, hence the use of delete_many just in case.

@auvipy auvipy closed this Apr 13, 2023
@auvipy auvipy reopened this Apr 13, 2023
@auvipy
Copy link
Member

auvipy commented Apr 13, 2023

restarted the builld

@fmigneault
Copy link
Contributor Author

@auvipy
Copy link
Member

auvipy commented Apr 13, 2023

uggh have to find out what to clean from the CI

@auvipy
Copy link
Member

auvipy commented Apr 13, 2023

but pytest-cov should not be affected

@fmigneault
Copy link
Contributor Author

pytest-cov works, it is only the coverage uploader that fails.
I use the following approach in multiple repositories: https://github.com/crim-ca/weaver/blob/master/.github/workflows/tests.yml#L134-L141

@auvipy auvipy added this to the 5.3 milestone Apr 15, 2023
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

can you please pull from main branch?

@fmigneault fmigneault requested a review from auvipy April 17, 2023 15:27
@auvipy auvipy merged commit f86f1fc into celery:main Apr 18, 2023
12 of 13 checks passed
@auvipy
Copy link
Member

auvipy commented Apr 18, 2023

thanks a lot

@fmigneault fmigneault deleted the fix-mongodb-transport branch April 18, 2023 15:58
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.

Broken MongoDB transport with pymongo>=4
2 participants