Skip to content

Implement new wizard run system #85854

Closed
Closed

Description

@fercgomes

This is a brand new wizard run tracking system, which supports both:

  • Local runs: syncs state from the user's local machine
  • Cloud runs: spawns a worker (temporal + sandbox) that runs the wizard

New concept: Wizard Worker. A wizard worker is an isolated sandbox running on our infrastructure, which we use to download the user's project (either via a git repository, or a zip upload), and run the wizard there.

For its first release, we keep the same sync system (task list updates).

To-do:

  • API implementation
  • Make state transition and worker step atomic.
  • Move serializers/deserializers to class methods
  • Files should have one concern. Do not mix configuration, with service code, with serializing.
  • Hoist constant variables to a config file
  • Make wizard version configurable.
  • Add endpoint for a Wizard Registry
  • Review naming for service boundaries
  • Review the new cancellation/reliability/queue ordering/idempotency/fingerprint changes
  • Review the reconciliations system. Why do we need to track whether a run was dispatched?
  • Review the WizardWorker model. Should we save the provisioned sandbox data?
  • Review the hardcoded daily limits? Why didn't it use the throttlers?
  • Sandbox/temporal usage??
  • Hook up the Wizard's handoff to the PR description.
  • Provision a artifacts bucket https://github.com/PostHog/posthog-cloud-infra/pull/10081
  • Artifacts bucket, chart PR https://github.com/PostHog/charts/pull/14662
  • Check auth access patterns. Do we have the right scopes?
  • Check MCP access patterns Should we expose it?
  • Server-side instrumentation
  • Observability and monitoring
  • Add a lifecycle hook system: attach temporal activities pre/post lifecycle stages. Use-case: email-sending.
  • Remove all references to opaque Exception's
  • Review naming of logic folder files, like "lifecycle". It is unclear which files are exposing public methods
  • Cloud runs SLOs and SLA
  • Squash migrations
  • Review scaling policy for wizard temporal worker
  • We have domain limiters, but we also need http-level limiting
  • Surface wizard errors to the wizard run
  • Add instructions about repository requirements (e.g. SDK required)
  • Fix git signing issue
  • Show link to github repository
  • Add git diff component (+ -)
  • Compatible instrumentation
  • Hide local runs until we have state sync from local runs

Open questions:

  1. How will we couple the wizard run status, with the wizard state itself?

Rollout order

PR stack

Review each PR in stack order. The UI PR is the final layer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions