Drop synthetic-job / event-stream-bridge framing for 7a-2+#558
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #558 +/- ##
=======================================
Coverage 99.12% 99.12%
=======================================
Files 77 77
Lines 10033 10033
=======================================
Hits 9945 9945
Misses 88 88
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the transparent install flow architecture documentation to remove the “synthetic FirmwareJob + event-stream bridge” framing and describe the newer “one FirmwareJob per build, source-routed runner” model for slices 7a-2+.
Changes:
- Adds rationale explaining why the synthetic-job / event-translation bridge approach was unnecessary.
- Renumbers and rewrites the in-flight slices as 7a-2a / 7a-2b / 7a-3 / 7a-4 to match the first-class
FirmwareJob.sourceshape. - Updates the described event flow so
OFFLOADER_JOB_*stays as wire fan-out, while the runner privately consumes it and continues emittingJOB_*for the install dialog.
e45b810 to
84fa1a1
Compare
The arch.md description of the transparent install flow's implementation slices used a "synthetic offloader-side FirmwareJob + event-stream bridge" framing inherited from the original design doc. That shape was reverse-engineered from "what's the minimum change to avoid touching the install dialog's subscriber?" — a bad starting point. It created two FirmwareJobs per remote build (one on each side), a bridge that re-fired OFFLOADER_JOB_* events as JOB_* against a synthetic id, and a separate RAM-only id mapping. Extra ceremony for a problem that doesn't exist: lockstep frontend deployment means the install dialog can learn the new field (`job.source_label`) in the same coordinated PR that lands the source-routed runner. Replaced the 7a-2 / 7a-3 / 7a-4 section with the first-class shape: - One `FirmwareJob` per build, the runner branches on `source` to pick its pipeline (local subprocess vs peer-link `submit_job` dispatch). - Same `JOB_*` lifecycle events fire either way; the install dialog stays on its existing subscriber. - `OFFLOADER_JOB_*` events stay as the wire-layer fan-out (5c-3 keeps them for the explicit Send-builds dialog that hangs around as the power-user surface); the runner consumes them privately to update its single FirmwareJob. Renumbered slices to reflect the new shape: - 7a-2a: `FirmwareJob.source` / `source_pin_sha256` / `source_label` field additions (in flight as #556). - 7a-2b: source-routed runner (renamed from "event-stream bridge"; the bridge concept disappears entirely). - 7a-3: `firmware/install` integration unchanged in spirit but now constructs a regular FirmwareJob with source=REMOTE rather than a synthetic wrapper. - 7a-4: cancel translation also simplifies — the runner's cancel hook fires remote_build/cancel_job directly, no id translation between two FirmwareJobs. Added explanatory paragraph above the slices about why the synthetic framing was wrong, so future readers don't have to reconstruct the reasoning from PR history. Issue #106's § Transparent install flow gets the same drop in a separate edit (the issue body is the source of truth for the full design; this PR brings arch.md into alignment). No code change.
84fa1a1 to
f58fe49
Compare
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
Drops the "synthetic offloader-side FirmwareJob + event-stream
bridge" framing from
docs/ARCHITECTURE.md's description ofthe transparent install flow's 7a-2 / 7a-3 / 7a-4 slices.
That shape was inherited from the original design doc and
reverse-engineered from "what's the minimum change to avoid
touching the install dialog's subscriber?" — a bad starting
point. It created two FirmwareJobs per remote build (one on
each side), a bridge that re-fired
OFFLOADER_JOB_*events asJOB_*against a synthetic id, and a separate RAM-only idmapping. Extra ceremony for a problem that doesn't exist —
lockstep frontend deployment means the install dialog can
learn the new field (
job.source_label) in the samecoordinated PR that lands the source-routed runner.
What's replacing it
One
FirmwareJobper build, the runner branches onsourceto pick its pipeline (local subprocess vs peer-linksubmit_jobdispatch). SameJOB_*lifecycle events fireeither way; the install dialog stays on its existing
subscriber.
OFFLOADER_JOB_*events remain as the wire-layerfan-out (5c-3 keeps them for the explicit Send-builds dialog
that hangs around as the power-user surface); the runner
consumes them privately to update its single FirmwareJob.
Renumbered slices to reflect the new shape:
FirmwareJob.source/source_pin_sha256/source_labelfield additions. In flight as Add FirmwareJob.source / source_label fields (7a-2a) #556."event-stream bridge"; the bridge concept disappears
entirely). The firmware queue's
_run_jobgains a branch onjob.source; LOCAL keeps the existingesphome runsubprocess; REMOTE calls
PeerLinkClient.submit_jobandsubscribes to
OFFLOADER_JOB_*filtered to its dispatch'sjob_id, updating the same FirmwareJob's status as wire
events arrive.
firmware/installintegration. Unchanged inspirit but now constructs a regular FirmwareJob with
source=REMOTErather than a synthetic wrapper.cancel hook fires
remote_build/cancel_jobdirectly. Noid translation between two FirmwareJobs because there
aren't two.
Added a leading paragraph above the slices that explains why
the synthetic framing was wrong, so future readers don't have
to reconstruct the reasoning from PR history.
Related coordinated changes
first-class shape. This PR's arch.md description references
the fields it adds.
truth for the full design; a follow-up edit will bring its
body into alignment with this PR's framing (no PR needed —
just
gh issue edit).Related issue or feature:
(transparent install flow). Companion to model PR Add FirmwareJob.source / source_label fields (7a-2a) #556.
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable — N/A; docs-only.components.jsonhas not been hand-edited.docs/ARCHITECTURE.mdand/ordocs/API.md— this PR is the architecture-level reflection.