Skip to content

restruct sentry proj - #79

Closed
bkodes wants to merge 4 commits into
temporalio:mainfrom
bkodes:main
Closed

restruct sentry proj#79
bkodes wants to merge 4 commits into
temporalio:mainfrom
bkodes:main

Conversation

@bkodes

@bkodes bkodes commented Jul 24, 2023

Copy link
Copy Markdown

The code in /sentry currently does not run.

Cannot access http.client.IncompleteRead.__mro_entries__ from inside a workflow. If this is code from a module not used in a workflow or known to only be us
ed deterministically from a workflow, mark the import as pass through.

Separating the workflow code into its own file resolves the issue

What was changed

Moved greetings workflow to workflows.py and import workflow within worker

Why?

So others can reference this sample and have no issue running it without alterations being made

Checklist

  1. Closes

  2. How was this tested:

Followed run instructions in README.md. Outputs:

cmd: poetry run python starter.py
output: Workflow result: Hello, World!
  1. Any docs updates needed?

No

@CLAassistant

CLAassistant commented Jul 24, 2023

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cretz cretz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Moving workflows to a separate file is definitely a good thing these days. Just need to get that activity back in there and I think we'll be good.

Comment thread sentry/workflows.py
@bkodes
bkodes requested a review from cretz July 24, 2023 20:25

@cretz cretz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please make sure you run poe lint before pushing (poe format will fix the formatting issues)

Comment thread sentry/workflows.py Outdated
Comment thread sentry/workflows.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you should update the starter.py to reference the workflow from this file and not through the worker.py file

Comment thread sentry/worker.py Outdated
bkodes and others added 2 commits July 24, 2023 17:15
Co-authored-by: Chad Retz <chad.retz@gmail.com>
Co-authored-by: Chad Retz <chad.retz@gmail.com>
@brianstrauch

brianstrauch commented Jul 30, 2026

Copy link
Copy Markdown
Member

The restructure you proposed here has since landed in main — the sentry sample now has sentry/workflow.py and sentry/activity.py as separate modules imported by sentry/worker.py, and the sandbox import error is handled explicitly with workflow.unsafe.imports_passed_through(). Most of that came in via the Sentry V2 SDK rework (#140) and follow-up refactors.

Since the change is no longer applicable to the current sample, I'm closing this out.

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.

4 participants