Skip to content

[Rust] Type-safe workflow and activity configuration #7254

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

Merged
merged 4 commits into from
Aug 14, 2025
Merged

Conversation

bdash
Copy link
Contributor

@bdash bdash commented Aug 11, 2025

This introduces binaryninja::workflow::activity::Config and related types that can be used for describing the configuration of workflow activity. This makes it possible to see what configuration options are available and eliminates errors due to typos in JSON string literals. Subsequent commits update the SVD and Warp plug-ins to use the new types.

I'm open to feedback on naming and exactly where this should live. The nested activity module isn't great, but it makes clear that this is for configuring activities and not the workflow more generally.

@emesare
Copy link
Member

emesare commented Aug 11, 2025

Other than the comments I left (all of which are not blocking, pick what you want) LGTM

@emesare emesare linked an issue Aug 11, 2025 that may be closed by this pull request
@bdash bdash force-pushed the rust-activity-config branch from 44c105e to 831fff1 Compare August 12, 2025 19:43
@bdash bdash changed the title [Rust] Type-safe activity configuration [Rust] Type-safe workflow and activity configuration Aug 12, 2025
@bdash
Copy link
Contributor Author

bdash commented Aug 12, 2025

Updated to:

  1. Add a lot of documentation to the new activity configuration types.
  2. Rework Workflow so that a WorkflowBuilder type is used for all of its mutating methods.

@bdash
Copy link
Contributor Author

bdash commented Aug 12, 2025

Fixed the formatting issues.

@emesare emesare self-requested a review August 12, 2025 19:48
bdash added 4 commits August 13, 2025 19:25
This makes it possible to see what structure the configuration takes and
eliminates errors due to typos in JSON string literals.
`Workflow::new` is replaced by `Workflow::build` that returns a
`Builder` type that supports the operations that mutate a workflow, such
as registering activities.

`Workflow::instance` is replaced by `Workflow::get` to make clear that
it is intended to look up an existing workflow.

`Workflow::cloned` is introduced to wrap the common pattern of
retrieving an existing workflow and cloning it with the same name in
order to modify it.

`Builder::activity_before` / `Builder::activity_after` are introduced to
wrap the common pattern of registering an activity then inserting it
before or after a given activity.
@bdash bdash force-pushed the rust-activity-config branch from 589994e to a898e96 Compare August 14, 2025 02:31
@bdash bdash merged commit a898e96 into dev Aug 14, 2025
9 of 10 checks passed
@bdash bdash deleted the rust-activity-config branch August 14, 2025 02:33
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.

Improve workflow API ergonomics in Rust API
2 participants