Skip to content

fix(publishing): guard reserved bundle paths - #5573

Merged
feltech merged 1 commit into
mainfrom
feat/5326-improve-publish-util-reuseabilty
Sep 21, 2026
Merged

feltech merged 1 commit into
mainfrom
feat/5326-improve-publish-util-reuseabilty

Conversation

@feltech

@feltech feltech commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Part of #5323 / #5326.

Fail loudly if the bundled workflow or a static file referenced by the workflow has a file name that clashes with a file reserved by the bundle.

Allow the list of reserved files to be extended by external publishers by adding an optional additional_reserved_paths when calling the package_to_folder() helper.

Return a more useful value from package_to_folder(), containing the final workflow path. This is technically a breaking change, but no known publisher makes use of this value. External publishers can then use this to stop reconstructing the entrypoint workflow path. It will be especially useful if/when no longer flattening the workflow #5324, and when disambiguating subflows alongside the entrypoint workflow in #5180.


📚 Documentation preview 📚: https://griptape-nodes--5573.org.readthedocs.build/en/5573/

@feltech
feltech requested a balanced review from Copilot September 16, 2026 16:42
@feltech feltech self-assigned this Sep 16, 2026
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Reserved-path checks still miss parent-path and bundled-library collisions that can corrupt published bundles.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds collision protection for reserved workflow bundle paths and returns structured packaging metadata.

Changes:

  • Validates entrypoint and static-file destinations against reserved paths.
  • Adds extensible publisher-specific reservations.
  • Introduces PackagedBundle and documents the breaking return-type change.
File summaries
File Description
workflow_packager.py Adds collision validation and structured results.
publishing/__init__.py Exports the new public API.
test_workflow_packager.py Adds unit coverage for reservations and results.
test_workflow_bundle.py Updates end-to-end tests for PackagedBundle.
MIGRATION.md Documents the return-type migration.
docs/guides/publishing.md Documents publisher integration.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/griptape_nodes/retained_mode/publishing/workflow_packager.py
Comment thread src/griptape_nodes/retained_mode/publishing/workflow_packager.py
@feltech
feltech force-pushed the feat/5326-improve-publish-util-reuseabilty branch from 507f59d to 068c248 Compare September 17, 2026 09:24
@feltech
feltech requested a balanced review from Copilot September 17, 2026 09:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Parent-directory segments can bypass the new reserved-path collision guard.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/griptape_nodes/retained_mode/publishing/workflow_packager.py Outdated
Part of #5323 / #5326.

Fail loudly if the bundled workflow or a static file referenced by the workflow
has a file name that clashes with a file reserved by the bundle.

Allow the list of reserved files to be extended by external publishers by adding
an optional `additional_reserved_paths` when calling the `package_to_folder()`
helper.

Return a more useful value from `package_to_folder()`, containing the final
workflow path. This is technically a breaking change, but no known publisher
makes use of this value. External publishers can then use this to stop
reconstructing the entrypoint workflow path.  It will be especially useful
if/when no longer flattening the workflow #5324, and when disambiguating
subflows alongside the entrypoint workflow in #5180.
@feltech
feltech force-pushed the feat/5326-improve-publish-util-reuseabilty branch from 068c248 to bb01b31 Compare September 17, 2026 10:07
@feltech
feltech requested a balanced review from Copilot September 17, 2026 10:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new result contract can expose absolute publishing-machine library paths for sandbox or non-JSON libraries.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

return library_paths
return PackagedBundle(
entrypoint_workflow_path=entrypoint_workflow_path,
library_paths=tuple(Path(library_path) for library_path in library_paths),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a separate issue with library copying behaviour. Note that sandbox libraries do have JSON paths. But nevertheless it is possible for a library to be registered as by directory rather than by .json file.

In the case of a library registered by directory, we could/should still copy the directory into the bundle, rather than skip it. But that's a different issue orthogonal to this PR.

In the meantime, we report the library list exactly as it was before this PR.

I think PackagedBundle documenting that paths are relative to the bundle is still reasonable, since it is understood that only applies if the path itself is relative.

@feltech
feltech requested review from a team and collindutter and removed request for a team September 17, 2026 11:26

@collindutter collindutter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat

@feltech
feltech added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit b632ce4 Sep 21, 2026
28 checks passed
@feltech
feltech deleted the feat/5326-improve-publish-util-reuseabilty branch September 21, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants