Skip to content

Commit

Permalink
Use {datasetId}.v{versionNumber}.{versionMinorNumber} as ref instead …
Browse files Browse the repository at this point in the history
…of interal version id
  • Loading branch information
Xarthisius committed Oct 4, 2019
1 parent 8424d1c commit c3cfc67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion binderhub/repoproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ def get_resolved_ref(self):
assert resp["status"] == "OK"

self.identifier = resp["data"]["identifier"]
self.record_id = resp["data"]["latestVersion"]["id"]
self.record_id = "{datasetId}.v{major}.{minor}".format(
datasetId=resp["data"]["id"],
major=resp["data"]["latestVersion"]["versionNumber"],
minor=resp["data"]["latestVersion"]["versionMinorNumber"],
)
return self.record_id

def get_repo_url(self):
Expand Down
2 changes: 1 addition & 1 deletion binderhub/tests/test_repoproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def test_dataverse():
provider = DataverseProvider(spec=spec)
# have to resolve the ref first
ref = await provider.get_resolved_ref()
assert ref == 150599
assert ref == '3035124.v3.0'

slug = provider.get_build_slug()
assert slug == 'dataverse-dvn-2ftjclkp'
Expand Down

0 comments on commit c3cfc67

Please sign in to comment.