Skip to content

Report a parked block's last check and return its result - #364

Merged
nbenn merged 3 commits into
mainfrom
362-dormant-status
Sep 29, 2026
Merged

nbenn merged 3 commits into
mainfrom
362-dormant-status

Conversation

@nbenn

@nbenn nbenn commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • A parked block now reads the status its last check reached (ready, failed, waiting or unset) while nothing that check read has changed, stale once something has, and unevaluated without a check, which also covers a board block that is not built yet. The dormant status goes: it reported that nothing was computing the block rather than what a run would find, so a consumer could not tell a current parked block from one that failed, cannot run, was edited since or never ran. This is the first work item of https://github.com/orgs/BristolMyersSquibb/discussions/488 and replaces the direction this PR first took, which kept dormant with a narrower meaning.
  • The check record from that first direction stays. Each check of a needed block, whether it runs the block or finds that it cannot, records the expression, state and eval trigger, which block feeds each data input and what each of those held, and now also the status it reached. A parked block compares against that record, an upstream counting as changed when it no longer holds what the block consumed from it or reads stale or unevaluated itself. An expression built from input data, such as blockr.dm's dm_select, cannot be rebuilt while its inputs are withheld, so for such a block the state it is built from is compared instead. The block server now owns the status reactive, status in its return list in place of failed, and board_server() installs it as the block's rv$eval slot.
  • A parked block's result() returns what its last check left rather than NULL, so a block reading ready hands back the result that status describes (A block that is off screen returns NULL from result(), even after it has run #363). A block last found unable to run holds NULL. Output rendering follows the status for a parked block as well, which keeps the render observer from validating it against withheld inputs now that a parked upstream reads its held ready.
  • The check, not the render observer, records why a block cannot run. A block checked off screen by an evaluate request now carries the status-phase reason, and one fixed off screen drops it once it runs. Before, the first read dormant with no conditions and the second kept its old note.
  • Rebased onto main after Fold front-end demand into the one multi-owner claim set #337, with the tests holding blocks eager instead of required. The unreleased 0.1.4 NEWS entries that named dormant (Dormant downstream block's status stays stale after an upstream change (deferred eval surfaces no dirty signal) #310, Provide a channel to evaluate a dormant block without making it visible #318, Collapsed stacks evaluate once before gating engages #343) are corrected in place.

Migration

Before After
A parked block reads dormant, whatever its last run found It reads its last check's status while that is current, stale once it is not
A block that never ran reads dormant, and an unbuilt one has no status Both read unevaluated
A parked block's result() is NULL It is the result the block's last check left
An evaluate request waits while a block reads dormant or stale It waits while a block reads unevaluated or stale, so a request for a current parked block is spent at once

Downstream, blockr.dock's block_status_badge() maps dormant to NA and so keeps the last badge; with this change it draws the held status instead, and BristolMyersSquibb/blockr.dock#485 drops the dormant case. In blockr.assistant, eval_deferred() and the status notes list dormant; reading the held statuses there is BristolMyersSquibb/blockr.assistant#165.

Fixes #362
Fixes #363

@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
R/block-server.R 96.55% 3 Missing ⚠️
Files with missing lines Coverage Δ
R/block-class.R 96.16% <ø> (ø)
R/board-server.R 97.67% <100.00%> (+0.09%) ⬆️
R/plugin-code.R 100.00% <ø> (ø)
R/block-server.R 96.68% <96.55%> (+0.04%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbenn

nbenn commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

Reworking this for https://github.com/orgs/BristolMyersSquibb/discussions/488. The check record stays, but a parked block now reports its last check's outcome while nothing it read has changed, stale once something has, and unevaluated without a check, so dormant goes instead of taking a narrower meaning. The reason a block cannot run moves into the check, and #363 is folded in, since a parked block reading ready has to return its held result. The title and description follow with the rework.

A parked block read dormant whether its last run still held, it had been
edited since, or it had never run, so a consumer could not tell which
off-screen blocks need a run. Every check of a needed block, including one
that finds it cannot run, is now recorded and compared against once parked.
A parked block now reads the status its last check reached while nothing that
check read has changed, `stale` once something has, and `unevaluated` without
a check, which also covers a block that is not built yet. The check, not the
render observer, records why a block cannot run, so a block checked off screen
carries the reason.
A parked block that reads `ready` has to hand back the result that status
describes, so `result()` returns what the block's last check left rather than
`NULL`. A block last found unable to run holds no result.
@nbenn
nbenn force-pushed the 362-dormant-status branch from 8dffc05 to 034c39b Compare September 29, 2026 12:23
@nbenn nbenn changed the title Make dormant mean current and add an unevaluated status Report a parked block's last check and return its result Sep 29, 2026
@nbenn
nbenn marked this pull request as ready for review September 29, 2026 12:46
@nbenn
nbenn added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit a3efbe9 Sep 29, 2026
10 checks passed
@nbenn
nbenn deleted the 362-dormant-status branch September 29, 2026 13:02
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.

A block that is off screen returns NULL from result(), even after it has run An edited or never-run block that is off screen reads dormant, not stale

1 participant