-
Notifications
You must be signed in to change notification settings - Fork 81
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
Improve optimize sync conditions #902
Conversation
73a26ab
to
2cee81c
Compare
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.
This should be a test case as well. To test it we need to allow passing arguments to the deb_sync_repository
fixture and adapt the deb_init_and_sync
fixture to use the arguments as well. The actual test case should be relatively simple then.
@hstct I wonder if there is some simple way to assert that certain log statements have or have not happened. |
Checking for specific log statements is somewhat messy. We can just check the task if content has been skipped or not. |
In Here we check if the release file and the package indices have not been skipped in the sync: https://github.com/pulp/pulp_deb/blob/main/pulp_deb/tests/functional/api/test_sync.py#L226-L227 |
85fbfc5
to
99b7220
Compare
log.info(_("Falling back to optimize=False behaviour since mirror=True is set!")) | ||
log.info(_("See https://github.com/pulp/pulp_deb/issues/631 for more information.")) | ||
self.optimize = False | ||
self.sync_info["sync_options"]["optimize"] = False |
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.
This will likely run into the same edge case as above if we manage to get here on the repositories first sync.
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.
This one should be fine, since this is self.sync_info
and not previous_sync_info
and self.sync_info
was explicitly seeded with the field a few lines further up.
ea6e7cf
to
76a7e21
Compare
closes pulp#903 This PR achieves the following: - Do not disable optimize if we are switching from mirror to not mirror between two syncs. We can optmize in this case. - Log additional reasons why we did not optimize in certain cases. - Improve the readability of optimize conditions.
76a7e21
to
1854a42
Compare
Backport to 3.0: 💚 backport PR created✅ Backport PR branch: Backported as #908 🤖 @patchback |
Improve optimize sync conditions (cherry picked from commit 8ca8fbe)
…dc7508fe2c7afe741cd89c7f3d8e5/pr-902 [PR #902/8ca8fbe4 backport][3.0] Improve optimize sync conditions
This PR achieves the following: