feat(core): add --related-to flag to ado get for filtering by anchor resource type - #1305
feat(core): add --related-to flag to ado get for filtering by anchor resource type#1305AlessandroPomponio wants to merge 4 commits into
Conversation
…resource Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
a10096b to
8a827a7
Compare
michael-johnston
left a comment
There was a problem hiding this comment.
implementation looks good except for excluding the ability to filter on same kind (see comment).
Terminology in docs is not consistent: we have "related", "reachable", "linked" and use the term "anchor" which seems to give no additional meaning c.f.
"related to given resource" to "related to given anchor resource" - what does anchor tell me?
…latest Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
| # All operations related to a sample store | ||
| uv run ado get operations --related-to samplestore=STORE_ID | ||
|
|
||
| # All spaces related to a sample store (name only) |
There was a problem hiding this comment.
| # All spaces related to a sample store (name only) | |
| # All spaces related to a sample store (name only) using short name |
There was a problem hiding this comment.
It's probably more worth it to write samplestore in L222 rather than adding 3 words in a skill
| Filter `ado get` results to resources related to a specific source resource, | ||
| including multi-hop relationships (e.g. operations linked to a space that is | ||
| linked to a store). Specify the source as `kind=id` (shorthand aliases supported): |
There was a problem hiding this comment.
I suggest using a term along the following lines to refer to the allowed multi-hop relationships
- Depth & Graph-Oriented Terms
These terms focus on the fact that you are limiting the traversal depth of the tree/graph.
First-Order Hierarchy: Clearly communicates that you are only dealing with the primary, immediate relationships, not second-order recursive ones.
Level-1 Subgraph (or L1 Subgraph): A graph theory term that implies you are looking at a specific, restricted slice of the overall resource graph.
Shallow Resource Tree: Contrasts perfectly with "deep" or recursive searches.
- Search & Boundary-Oriented Terms
These terms are great if the primary use case is defining the scope for your search function.
Base (or Core) Search Envelope: "Envelope" perfectly captures the idea of a defined boundary that contains specific things but stops at a certain edge.
Core Resource Context: Implies that this set of relationships forms the foundational context for a resource, without getting into the weeds of extended lineage.
Primary Search Boundary: Very explicit about what the term is used for.
e.g.
| Filter `ado get` results to resources related to a specific source resource, | |
| including multi-hop relationships (e.g. operations linked to a space that is | |
| linked to a store). Specify the source as `kind=id` (shorthand aliases supported): | |
| Filter `ado get` results to resources related to a specific source resource, | |
| within the core resource search hierarchy. Specify the source as `kind=id` (shorthand aliases supported): |
There was a problem hiding this comment.
I think these are very complex terms that require very specific knowledge and might actually hinder general comprehension of what we're doing.
If I ask Bob "what is the hierarchy between ado resources top-to-bottom", it creates this diagram:
graph TD
SS["<b>SampleStore</b><br/><sub>samplestore</sub><br/>Persistent storage for entity measurements"]
AC["<b>ActuatorConfiguration</b><br/><sub>actuatorconfiguration</sub><br/>Parameters for a specific actuator"]
DS["<b>DiscoverySpace</b><br/><sub>discoveryspace</sub><br/>Entity + measurement space"]
OP["<b>Operation</b><br/><sub>operation</sub><br/>Runs an operator on a DiscoverySpace"]
DC["<b>DataContainer</b><br/><sub>datacontainer</sub><br/>Output data produced by an operation"]
SS -->|"sampleStoreIdentifier (1)"| DS
SS -->|"copyFrom[] (0..*)"| SS
AC -->|"actuatorConfigurationIdentifiers[] (0..*)"| OP
DS -->|"spaces[] (1)"| OP
OP -->|"OperationOutput.resources (0..*)"| DC
OP -->|"writes measurements back"| SS
Which I assume is what people will most likely think of, and I would refer to this as simply "the hierarchy". Beyond the hierarchy, I would refer to all possible relationships between resources as "the graph". I would however avoid going too mathematical or technical with the terms for the sake of general understanding
Summary
Adds a
--related-toflag toado getthat filters listed resources by their relationship to a given anchor resource (e.g. "show all operations linked to this sample store"). This makes it easy to navigate the resource graph without knowing individual identifiers upfront.High-level Changes
--related-toflag onado get: accepts akind=idpair (e.g.samplestore=store-abc123) and filters results to resources reachable from that anchor; shorthand aliases (e.g.store=) are supported.query-ado-dataandusing-ado-cliskills accordingly.Impact
Users can now filter
ado getresults by relationship to another resource directly from the CLI, removing the need for manual cross-referencing. The change is purely additive and has no impact on existing commands or behaviour.