Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123020
D6617.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Subscribers
None
D6617.diff
View Options
diff --git a/swh/deposit/api/private/deposit_update_status.py b/swh/deposit/api/private/deposit_update_status.py
--- a/swh/deposit/api/private/deposit_update_status.py
+++ b/swh/deposit/api/private/deposit_update_status.py
@@ -13,7 +13,7 @@
from ...models import DEPOSIT_STATUS_DETAIL, DEPOSIT_STATUS_LOAD_SUCCESS, Deposit
from ..common import APIPut, ParsedRequestHeaders
-MANDATORY_KEYS = ["origin_url", "revision_id", "directory_id", "snapshot_id"]
+MANDATORY_KEYS = ["origin_url", "release_id", "directory_id", "snapshot_id"]
class APIUpdateStatus(APIPrivateView, APIPut):
@@ -85,7 +85,7 @@
if status == DEPOSIT_STATUS_LOAD_SUCCESS:
origin_url = data["origin_url"]
directory_id = data["directory_id"]
- revision_id = data["revision_id"]
+ release_id = data["release_id"]
dir_id = CoreSWHID(
object_type=ObjectType.DIRECTORY, object_id=hash_to_bytes(directory_id)
)
@@ -93,8 +93,8 @@
object_type=ObjectType.SNAPSHOT,
object_id=hash_to_bytes(data["snapshot_id"]),
)
- rev_id = CoreSWHID(
- object_type=ObjectType.REVISION, object_id=hash_to_bytes(revision_id)
+ rel_id = CoreSWHID(
+ object_type=ObjectType.RELEASE, object_id=hash_to_bytes(release_id)
)
deposit.swhid = str(dir_id)
@@ -105,7 +105,7 @@
object_id=hash_to_bytes(directory_id),
origin=origin_url,
visit=snp_id,
- anchor=rev_id,
+ anchor=rel_id,
path="/",
)
)
diff --git a/swh/deposit/client.py b/swh/deposit/client.py
--- a/swh/deposit/client.py
+++ b/swh/deposit/client.py
@@ -213,7 +213,7 @@
update_status_url,
status,
status_detail=None,
- revision_id=None,
+ release_id=None,
directory_id=None,
origin_url=None,
):
@@ -222,14 +222,14 @@
Args:
update_status_url (str): the full deposit's archive
status (str): The status to update the deposit with
- revision_id (str/None): the revision's identifier to update to
+ release_id (str/None): the release's identifier to update to
directory_id (str/None): the directory's identifier to update to
origin_url (str/None): deposit's associated origin url
"""
payload = {"status": status}
- if revision_id:
- payload["revision_id"] = revision_id
+ if release_id:
+ payload["release_id"] = release_id
if directory_id:
payload["directory_id"] = directory_id
if origin_url:
diff --git a/swh/deposit/config.py b/swh/deposit/config.py
--- a/swh/deposit/config.py
+++ b/swh/deposit/config.py
@@ -44,7 +44,7 @@
DEPOSIT_STATUS_LOAD_SUCCESS = "done"
DEPOSIT_STATUS_LOAD_FAILURE = "failed"
-# Revision author for deposit
+# Release author for deposit
SWH_PERSON = {
"name": "Software Heritage",
"fullname": "Software Heritage",
diff --git a/swh/deposit/tests/api/test_deposit_private_update_status.py b/swh/deposit/tests/api/test_deposit_private_update_status.py
--- a/swh/deposit/tests/api/test_deposit_private_update_status.py
+++ b/swh/deposit/tests/api/test_deposit_private_update_status.py
@@ -39,13 +39,13 @@
status_detail = "it works!"
origin_url = "something"
directory_id = "42a13fc721c8716ff695d0d62fc851d641f3a12b"
- revision_id = "47dc6b4636c7f6cba0df83e3d5490bf4334d987e"
+ release_id = "47dc6b4636c7f6cba0df83e3d5490bf4334d987e"
snapshot_id = "68c0d26104d47e278dd6be07ed61fafb561d0d20"
full_body_info = {
"status": DEPOSIT_STATUS_LOAD_SUCCESS,
"status_detail": status_detail,
- "revision_id": revision_id,
+ "release_id": release_id,
"directory_id": directory_id,
"snapshot_id": snapshot_id,
"origin_url": origin_url,
@@ -56,7 +56,7 @@
f"{expected_swhid}"
f";origin={origin_url}"
f";visit=swh:1:snp:{snapshot_id}"
- f";anchor=swh:1:rev:{revision_id}"
+ f";anchor=swh:1:rel:{release_id}"
f";path=/"
)
@@ -115,13 +115,13 @@
origin_url = "something"
directory_id = "42a13fc721c8716ff695d0d62fc851d641f3a12b"
- revision_id = "47dc6b4636c7f6cba0df83e3d5490bf4334d987e"
+ release_id = "47dc6b4636c7f6cba0df83e3d5490bf4334d987e"
snapshot_id = "68c0d26104d47e278dd6be07ed61fafb561d0d20"
new_status = DEPOSIT_STATUS_LOAD_SUCCESS
full_body_info = {
"status": new_status,
- "revision_id": revision_id,
+ "release_id": release_id,
"directory_id": directory_id,
"snapshot_id": snapshot_id,
"origin_url": origin_url,
diff --git a/swh/deposit/tests/conftest.py b/swh/deposit/tests/conftest.py
--- a/swh/deposit/tests/conftest.py
+++ b/swh/deposit/tests/conftest.py
@@ -586,7 +586,7 @@
)
origin = "https://hal.archives-ouvertes.fr/hal-01727745"
directory_id = "42a13fc721c8716ff695d0d62fc851d641f3a12b"
- revision_id = hash_to_bytes("548b3c0a2bb43e1fca191e24b5803ff6b3bc7c10")
+ release_id = hash_to_bytes("548b3c0a2bb43e1fca191e24b5803ff6b3bc7c10")
snapshot_id = hash_to_bytes("e5e82d064a9c3df7464223042e0c55d72ccff7f0")
deposit.swhid = f"swh:1:dir:{directory_id}"
deposit.swhid_context = str(
@@ -595,7 +595,7 @@
object_id=hash_to_bytes(directory_id),
origin=origin,
visit=CoreSWHID(object_type=ObjectType.SNAPSHOT, object_id=snapshot_id),
- anchor=CoreSWHID(object_type=ObjectType.REVISION, object_id=revision_id),
+ anchor=CoreSWHID(object_type=ObjectType.RELEASE, object_id=release_id),
path=b"/",
)
)
diff --git a/swh/deposit/tests/loader/common.py b/swh/deposit/tests/loader/common.py
--- a/swh/deposit/tests/loader/common.py
+++ b/swh/deposit/tests/loader/common.py
@@ -43,13 +43,13 @@
self,
update_status_url,
status,
- revision_id=None,
+ release_id=None,
directory_id=None,
origin_url=None,
):
payload = {"status": status}
- if revision_id:
- payload["revision_id"] = revision_id
+ if release_id:
+ payload["release_id"] = release_id
if directory_id:
payload["directory_id"] = directory_id
if origin_url:
diff --git a/swh/deposit/tests/loader/test_client.py b/swh/deposit/tests/loader/test_client.py
--- a/swh/deposit/tests/loader/test_client.py
+++ b/swh/deposit/tests/loader/test_client.py
@@ -215,7 +215,7 @@
deposit_client.status_update(
"/update/status",
DEPOSIT_STATUS_LOAD_SUCCESS,
- revision_id="some-revision-id",
+ release_id="some-release-id",
status_detail="foo bar",
)
@@ -225,12 +225,12 @@
json={
"status": DEPOSIT_STATUS_LOAD_SUCCESS,
"status_detail": "foo bar",
- "revision_id": "some-revision-id",
+ "release_id": "some-release-id",
},
)
-def test_status_update_with_no_revision_id(mocker):
+def test_status_update_with_no_release_id(mocker):
"""Reading metadata can fail for some reasons
"""
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 17, 4:06 PM (2 d, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219256
Attached To
D6617: Use release instead of revision as anchor in SWHID context instead.
Event Timeline
Log In to Comment