Skip to content

integrate with invenio-app-rdm#13

Open
mairasalazar wants to merge 4 commits intoinveniosoftware:mainfrom
mairasalazar:allow-reading-file-from-path
Open

integrate with invenio-app-rdm#13
mairasalazar wants to merge 4 commits intoinveniosoftware:mainfrom
mairasalazar:allow-reading-file-from-path

Conversation

@mairasalazar
Copy link
Collaborator

@mairasalazar mairasalazar commented Mar 6, 2026

❤️ Thank you for your review!

This PR allows integrating the Orcha workflow with InvenioRDM by:

  • Allowing a file URI to be passed instead of a URL.
  • Adding support for Server-Sent Events, to allow streaming.

@mairasalazar mairasalazar requested a review from yashlamba March 6, 2026 15:08
@mairasalazar mairasalazar force-pushed the allow-reading-file-from-path branch 2 times, most recently from c03fbb6 to 77626f8 Compare March 10, 2026 13:29
@mairasalazar mairasalazar changed the title refactor: read from path instead of url integrate with invenio-app-rdm Mar 10, 2026
@mairasalazar mairasalazar force-pushed the allow-reading-file-from-path branch from 77626f8 to ceddece Compare March 11, 2026 09:22
@mairasalazar mairasalazar force-pushed the allow-reading-file-from-path branch 2 times, most recently from 497936d to 1195026 Compare March 12, 2026 16:10
pdf_bytes = response.content
"""Read a file and extract its text content using the specified extractor."""
if settings.orcha_env in [Environment.LOCAL, Environment.DEV]:
with open(request.url, "rb") as f:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should rename it to request.source as it can now be a locale file path which is not an URL.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we can keep it as it is since the local file path is a temporary thing for local dev

return

except SQLAlchemyError as e:
print("Error in fetching from database (stream_workflow)", e)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should move to using logging, so we get the stack traces + observability.

The button added in
inveniosoftware/invenio-app-rdm#3355
allows triggering a workflow and passing a file path to it. In this
case, the activity must read from a file uri instead of the url.
@mairasalazar mairasalazar force-pushed the allow-reading-file-from-path branch from 1195026 to c80e161 Compare March 16, 2026 16:49
@mairasalazar mairasalazar force-pushed the allow-reading-file-from-path branch from c80e161 to b923845 Compare March 16, 2026 16:51
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