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

Add a generic resolveHash method to VersionStore #7305

Closed
wants to merge 1 commit into from

Conversation

adutra
Copy link
Contributor

@adutra adutra commented Jul 29, 2023

Required for #7268.

For context: the existing hashOnReference method has the down side of throwing ReferenceNotFound if the hash is not reachable from the given NamedRef – even if the hash exists. This makes supporting relative hashes across the board harder to implement and could introduce unwanted behavioral changes in existing endpoints.

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Not yet sure I understand the reasoning here. But let's wait for the PR proposed for #7268. Other than that, we'd have two very similar methods then, does it make sense to keep the relativeLookups parameter for hashOnReference after this PR and and the one for #7268?

@adutra
Copy link
Contributor Author

adutra commented Jul 31, 2023

Not yet sure I understand the reasoning here. But let's wait for the PR proposed for #7268. Other than that, we'd have two very similar methods then, does it make sense to keep the relativeLookups parameter for hashOnReference after this PR and and the one for #7268?

Indeed the intent will become clear with #7268 I hope. And yes, we'd need both, since sometimes we need to resolve the hash AND check that it belongs to the given named ref, but some other times (DETACHED cases mostly), we only need to resolve the hash.

@adutra
Copy link
Contributor Author

adutra commented Jul 31, 2023

Closing this, you were right: it turns out hashOnReference is enough for all cases. Sorry for the noise.

@adutra adutra closed this Jul 31, 2023
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.

2 participants