Closed uwaheed88 closed 4 years ago
I realize now that this takes more design work and solving it right may be slightly more complex than what has been initially communicated.
I don't think our solution should change any URL structures, and I don't think it should be a superficial change. This is something deeper, and may even require a (small) fix to metastore-lib to handle. What I want is this:
revision_ref
parameter in URLs can specify either a revision ID (typically a sha1 or sha256) or a tag name. storage.fetch()
is called.Note that metastore-lib
already provides some methods of telling between a revision ID and a tag name, and we can just re-use those in ckanext-versioning
if needed. It may even make sense for storage backends to expose a new method, something like is_valid_revision_id(revision_ref: str) -> bool
to allow consuming code to check if something will be treated by the storage backend as if it was a revision ID or a tag (anything that is not a valid revision ID is assumed to be a tag).
Let me know if you want to further discuss this and come up with a design together.
@shevron Can you approve now as the tests have now passed?
Tested locally, works well. As a bonus, using the revision ID in the URL also works. 👍 Good job.
Issue: IVT-2794
blueprint.py
andhelper.py
to addtag_name
in the request parameter of version URL.plugin.py
to fetch the tag name from the request URL parameter and used to filter current_version on the basis ofrevision_ref
andtag_name
.This resolves #49