Answer whether a workspace still matches the settings in force - #5
Merged
Conversation
A workspace created under settings that have since changed announced itself only by refusing an operation the operator had already chosen to run. Every fact needed to say so earlier is recorded in the workspace's own metadata, so the refusal was avoidable: the surface could have said which workspace was affected before anyone asked it to do anything. Nothing exposed that cheaply. `inspectWorkspace` answers a related question but runs a health check against the provider, which is far too expensive to do once per row of a list, and the fingerprint comparison folds in each workspace's own image digest, so it cannot be reproduced by comparing a single value elsewhere — reproducing it outside this package would be a second implementation free to drift from this one. `describeWorkspacePolicyState` reads the answer from the record and contacts nothing.
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.
Problem
A workspace created under settings that have since changed announces itself only by refusing an operation the operator had already chosen to run — and the refusal surfaces as a panel-level warning, so with more than one workspace you cannot tell which it refers to.
Every fact needed to say this earlier is already recorded in the workspace's own metadata. The refusal was avoidable.
Why a new method
inspectWorkspaceanswers a related question, but runs a health check against the provider — far too expensive to run once per row of a list.describeWorkspacePolicyStatereads the answer from the record and contacts nothing.Tests
Two cases in the existing suite: a matching workspace, and one whose fingerprint no longer matches — the second asserting no provider call is made, since that is the whole point.