-
Notifications
You must be signed in to change notification settings - Fork 251
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
Make GraphProcessor trace optional #460
base: main
Are you sure you want to change the base?
Conversation
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.
Can you run lint and prettier fix? It seems CI is missing setup for them, which will need to be fixed in a separate PR
@@ -75,7 +76,7 @@ export function coreCreateProcessor(project: Project, options: RunGraphOptions) | |||
throw new Error(`Graph not found, and no main graph specified.`); | |||
} | |||
|
|||
const processor = new GraphProcessor(project, graphId as GraphId, options.registry); | |||
const processor = new GraphProcessor(project, graphId as GraphId, options.registry, options.includeTrace); |
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.
I think it would be preferred for optional properties to be grouped into an options object so they can be specified in any order, but this class is exported out of core which technically makes it part of the public interface. While I think most users would use it through createGraphProcessor we can't update this without a breaking change, but we can at least note this for the future
if(this.#includeTrace){ | ||
this.#emitter.emit( | ||
'trace', | ||
`Node ${node.title} has required inputs nodes: ${inputNodes.map((n) => n.title).join(', ')}`, | ||
); | ||
} |
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.
Also we should consider adding a small util to wrap this so future calls to emitting trace don't miss the check
includeTrace
only exists as an override for a user who would like to disable traces for their graph runs.