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

Validation of package entries metadata #3286

Merged
merged 3 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/python/quilt3/workflows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def get_pkg_entries_for_validation(self, pkg):
return [
{
'logical_key': lk,
'size': e.size
'size': e.size,
"meta": e.meta,
}
for lk, e in pkg.walk()
]
Expand Down
13 changes: 8 additions & 5 deletions api/python/tests/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,26 +212,29 @@ def test_validate_pkg_entries_fail(self, get_pkg_entries_for_validation_mock):
class GetPkgEntriesForValidationTest(QuiltTestCase, WorkflowValidatorTestMixin):
def test(self):
entries_data = {
'b/a': bytes(1),
'a/b': bytes(2),
'c': bytes(3),
'b/a': (bytes(1), None),
'a/b': (bytes(2), {}),
'c': (bytes(3), {"test": "test"}),
}
pkg = Package()
for lk, data in entries_data.items():
pkg.set(lk, data)
for lk, (data, meta) in entries_data.items():
pkg.set(lk, data, meta=meta)

workflow_validator = self.get_workflow_validator()
assert workflow_validator.get_pkg_entries_for_validation(pkg) == [
{
'logical_key': 'a/b',
'size': 2,
"meta": {},
},
{
'logical_key': 'b/a',
'size': 1,
"meta": {},
},
{
'logical_key': 'c',
'size': 3,
"meta": {"test": "test"},
fiskus marked this conversation as resolved.
Show resolved Hide resolved
},
]
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Entries inside each section should be ordered by type:

## Catalog, Lambdas
!-->
sir-sigurd marked this conversation as resolved.
Show resolved Hide resolved
## Python API
* [Added] Validation of package entries metadata ([#3286](https://github.com/quiltdata/quilt/pull/3286))

## Catalog, Lambdas
* [Added] Add basic support for tasklist in Markdown ([#3339](https://github.com/quiltdata/quilt/pull/3339))
Expand Down