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

Change sync code to use new model #77

Merged
merged 1 commit into from May 31, 2016
Merged

Conversation

asmacdo
Copy link
Contributor

@asmacdo asmacdo commented May 20, 2016

Adds some fields that were necessary for sync, syncs in the new way, and
heavily modify docblocks to explain.

https://pulp.plan.io/issues/135

Adds some fields that were necessary for sync, syncs in the new way, and
heavily modify docblocks to explain.

closes pulp#135
author = StringField()
filename = StringField(required=True)
md5_digest = StringField()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not crazy about having the md5_digest and _checksum and _checksum_type.

While you're in here, can we change this to a dictionary called checksums or something where the keys are the checksum algorithm and the value is the hex digest? I think this is also happening in the pulp_rpm plugin so if you do this make sure they match. It's not as nice as unifying our file and checksum modeling, but it'll be consistent at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I added this field is because _checksum and _checksum_type are both "Pulp fields", but md5_digest is a pure "Python field" in that it is a mirror of the field from PyPI. We generate our own checksum for later (not md5). I thought that it seemed like it made sense to save the PyPI checksum as well as our own, so that the client would be in a position to check that it matches both. Additionally, looking forward, when we are doing Pulp-Pulp syncs we can use either checksum, but I at least wanted the option of being able to naively syncing from another Pulp server without having to do anything different than we would I we were syncing from PyPI.

That all said, I think that it would be possible (and acceptable) to remove the md5_digest and save only a single checksum onto the object. I would like to have the pulp-pulp sync working before spending too much effort on that decision. Lets make sure to have a discussion before the final merge of the feature branch.

@jeremycline
Copy link
Contributor

Just the one comment. Since this is going into a feature branch and will be reviewed as a whole, I didn't do a complete examination to make sure you didn't miss a _filename to filename, and I'm okay with the code having TODOs in it.

@asmacdo asmacdo merged commit 8eec44e into pulp:all-types May 31, 2016
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.

None yet

2 participants