-
-
Notifications
You must be signed in to change notification settings - Fork 0
Preserve per-tag directory structure when constructing bundle paths (merges into #96) #102
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -261,11 +261,17 @@ def create_bundle(inputs: BundleInputs) -> dict[str, Any]: | |
| "evaluations": evaluations, | ||
| } | ||
|
|
||
| manifest_path = resolve_within_root(manifest_dir, f"{tag}.yaml") | ||
| tag_path = Path(tag) | ||
| tag_manifest_dir = resolve_within_root(manifest_dir, str(tag_path.parent)) if tag_path.parent != Path(".") else manifest_dir | ||
| tag_bundle_dir = resolve_within_root(bundle_dir, str(tag_path.parent)) if tag_path.parent != Path(".") else bundle_dir | ||
| tag_manifest_dir.mkdir(parents=True, exist_ok=True) | ||
| tag_bundle_dir.mkdir(parents=True, exist_ok=True) | ||
|
|
||
| manifest_path = tag_manifest_dir / f"{tag_path.name}.yaml" | ||
| with manifest_path.open("w", encoding="utf-8") as handle: | ||
| yaml.safe_dump(manifest, handle, sort_keys=False) | ||
|
|
||
| bundle_path = resolve_within_root(bundle_dir, f"{tag}.zip") | ||
| bundle_path = tag_bundle_dir / f"{tag_path.name}.zip" | ||
|
Comment on lines
+264
to
+274
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Creating bundles now writes manifests and archives into nested directories based on the tag (e.g., Useful? React with 👍 / 👎. |
||
| with ZipFile(bundle_path, "w") as archive: | ||
| for source, arcname in bundle_files: | ||
| archive.write(source, arcname) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for creating nested directories from namespaced tags is flawed. The implementation in
evidence/packager.pyincorrectly parses the tag string, and as a result, the assertions in the corresponding test intests/test_evidence_bundle.pywill fail. The code does not produce the intended directory structure.Prompt for AI agents