Repository navigation
Show enforceable node assignment in nodes list, show, and claim - #75
Merged
Merged
Conversation
nodes show prints assignment (advisory, or required for an account or a group) and private when the server says so. The nodes list gains an ACCESS column from claim_block and private. nodes claim prints the node_reserved line and exits 1. Assignee decodes as the server's object, with a string fallback so an older payload still lists. Co-authored-by: austpryb <austpryb@users.noreply.github.com>
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.
Summary
graphwatch follows enforcer-graph PR #503 (
cabee17b9b601ed771b0dfeeb100661720b2bb18): a node read carriesassignment_mode(advisory|required),private,viewer_can_claim, andclaim_block(null|node_reserved). A claim of someone else's required node is 409{"error":"node_reserved","detail":"this node is reserved for its assignee"}.This repo has no vendored graph spec. The client reads those fields off the node payload;
--jsonprints the server's bytes unchanged.nodes showprintsassignment:afterassignee:(advisory,required (only <assignee> can run this), orrequired (only the <group> group can run this)).private:is printed only when true, same asreclaimable:.nodesadds anACCESScolumn afterTIER:reserved,local,reserved,local, or-, fromclaim_blockandprivate. Plain ASCII. On a terminal the table header is bold, which is the colour tables already use; the cells are not recoloured.nodes claim <graph> <key|id>is one POST to the named claim. A 409node_reservedprintsgraphwatch: node <key> is reserved for <assignee>; only they can run it (node_reserved)on stderr (orsomeone elsewhen the node has no name) and exits 1. Assignee is the server's{account_id, group_slug}object, with a string fallback so an older payload still lists (this also unblocksdecide, which was failing to decode that object).private: truedoes not append "(local Qwen only)": that phrase is not a server field, and the line followsreclaimable:.Not merged. Not deployed.
Tests
go test ./...andgo vet ./.... Goldens:testdata/nodes_show_advisory.txttestdata/nodes_show_required_account.txttestdata/nodes_show_required_group.txttestdata/nodes_show_private.txttestdata/nodes_list_access.txttestdata/claim_node_reserved.txttestdata/claim_node_reserved_unnamed.txtOpen in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.