Skip to content

Commit

Permalink
Fix staging collection members
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Oct 28, 2024
1 parent dfb2757 commit bf0b7eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hypha/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.20.38.post9"
"version": "0.20.38.post10"
}
2 changes: 2 additions & 0 deletions hypha/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ async def _read_manifest(self, artifact, stage=False, increment_view_count=False
collection = []
for sub_artifact in sub_artifacts:
sub_manifest = sub_artifact.manifest
if sub_manifest is None:
continue
summary = {"_prefix": f"/{workspace}/{sub_artifact.prefix}"}
for field in summary_fields:
value = sub_manifest.get(field)
Expand Down
12 changes: 11 additions & 1 deletion tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,19 @@ async def test_artifact_manager_with_collection(minio_server, fastapi_server):
}

await artifact_manager.create(
prefix="collections/test-collection", manifest=collection_manifest, stage=False
prefix="collections/test-collection",
manifest=collection_manifest,
stage=False,
permissions={"*": "r", "@": "r+"},
)

# get the collection via http
response = requests.get(
f"{SERVER_URL}/{api.config.workspace}/artifacts/collections/test-collection"
)
assert response.status_code == 200
assert "test-collection" in response.json()["name"]

# Ensure that the collection exists
collections = await artifact_manager.list(prefix="collections")
assert "test-collection" in collections
Expand Down

0 comments on commit bf0b7eb

Please sign in to comment.