[API] Fix projects leader to sync enrichment to followers #2009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently we started seeing these tests almost constantly fail in CI:
In the investigation we saw that it only reproduces with the dockerized tests and it also reproduces with very old code leading to the conclusions that the cause for this bug is not in our code but some package that was updated (when testing in docker it rebuild the image and pull latest packages vs local which you usually have slightly older versions)
After some searching I found that Pydantic 1.9.0 -> 1.9.1 caused it, and after going over the changes this PR was the suspect - pydantic/pydantic#3642
I've changed the nop follower we're using in those tests to always use
.copy(deep=True)
of what it is getting and saw that indeed the test now fails even with 1.9.0This revealed and actual bug in our code, when the leader finds a project in the follower, it enriches it (as of now enrichment is just assigning the desired state to the status state) but then it doesn't update the project in that follower which is why the tests fail, so beside of changing the nop-follower to use deep copy, I fixed the leader to do this update