Skip to content

[sbc] StateBackedComponent class #31424

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

Open
wants to merge 1 commit into
base: benpankow/persist-load-context
Choose a base branch
from

Conversation

OwenKephart
Copy link
Contributor

@OwenKephart OwenKephart commented Jul 30, 2025

Summary & Motivation

This creates a new StateBackedComponent class that takes advantage of the new StateStore object.

Subclasses of StateBackedComponent will implement two methods:

build_defs_from_state: given a path to a state file, they will return a Definitions object. two things to note here:

  • this is a filepath, not an in-memory object. this helps for potential cases like dbt where we just need to forward the path to some other tool rather than paying the cost of reading it all into memory.
  • this is an optional filepath. this gives the user control over what happens in the case that no state currently exists. in our current system / integrations, we always automatically invoke the "rebuild state" functionality when there is no existing state, but this is likely not the right thing to do in the new world where we expect to be able to deploy an initial version of our code before any state has been stored and not have that lock up the code server for minutes as it rebuilds that initial state.

write_state_to_path: the user code is given a path in which to write some state. The reason that the path is passed into this method is so that the framework can control the lifecycle of this path (i.e. making sure it gets cleaned up after we upload it).

How I Tested These Changes

Changelog

Insert changelog entry or delete this section.

Copy link
Contributor Author

OwenKephart commented Jul 30, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@OwenKephart OwenKephart force-pushed the benpankow/persist-load-context branch from 9cd14f2 to b54a941 Compare July 30, 2025 23:27
@OwenKephart OwenKephart force-pushed the 07-29-_sbc_statebackedcomponent_class branch from d3d155a to 4cc1db0 Compare July 30, 2025 23:27
@OwenKephart OwenKephart marked this pull request as ready for review July 30, 2025 23:33
@OwenKephart OwenKephart force-pushed the benpankow/persist-load-context branch from b54a941 to af35cdb Compare July 30, 2025 23:49
@OwenKephart OwenKephart force-pushed the 07-29-_sbc_statebackedcomponent_class branch from 4cc1db0 to 3391773 Compare July 30, 2025 23:49
@OwenKephart OwenKephart force-pushed the 07-29-_sbc_statebackedcomponent_class branch from 3391773 to 928ca52 Compare July 31, 2025 00:53
@OwenKephart OwenKephart force-pushed the benpankow/persist-load-context branch from af35cdb to 3352ae0 Compare July 31, 2025 01:30
@OwenKephart OwenKephart force-pushed the 07-29-_sbc_statebackedcomponent_class branch 2 times, most recently from 2d9f5d3 to daa5054 Compare July 31, 2025 20:30
@OwenKephart OwenKephart force-pushed the benpankow/persist-load-context branch from 3352ae0 to ac8f7bc Compare July 31, 2025 20:30
@OwenKephart OwenKephart force-pushed the benpankow/persist-load-context branch from ac8f7bc to e995e00 Compare July 31, 2025 21:55
@OwenKephart OwenKephart force-pushed the 07-29-_sbc_statebackedcomponent_class branch from daa5054 to 329250c Compare July 31, 2025 21:55
@OwenKephart OwenKephart force-pushed the 07-29-_sbc_statebackedcomponent_class branch from 329250c to 5ce0ebb Compare August 5, 2025 21:31
@OwenKephart OwenKephart force-pushed the benpankow/persist-load-context branch from e995e00 to f7e4bb7 Compare August 5, 2025 21:31
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.

1 participant