-
Notifications
You must be signed in to change notification settings - Fork 2
Update-PfbLegalHoldEntity -Name is a mandatory but unusable selector: a held entity has no name, and the array rejects a request selected only by it #139
Copy link
Copy link
Open
Labels
area:wire-contractWhat a shipped cmdlet actually sends: dead keys, selectors, missing required keys, ID rules.What a shipped cmdlet actually sends: dead keys, selectors, missing required keys, ID rules.needs:live-testCannot close on mocked tests alone. Requires live verification against an array.Cannot close on mocked tests alone. Requires live verification against an array.priority:P0Can damage a customer array or breaks the module outright. Drop other work.Can damage a customer array or breaks the module outright. Drop other work.size:SOne sitting. Single file or a mechanical change.One sitting. Single file or a mechanical change.source:livetestOpened from evidence measured against a real array.Opened from evidence measured against a real array.status:design-approvedDesign reviewed and approved by the maintainer. Implementation may start.Design reviewed and approved by the maintainer. Implementation may start.
Description
Activity
Metadata
Metadata
Assignees
Labels
area:wire-contractWhat a shipped cmdlet actually sends: dead keys, selectors, missing required keys, ID rules.What a shipped cmdlet actually sends: dead keys, selectors, missing required keys, ID rules.needs:live-testCannot close on mocked tests alone. Requires live verification against an array.Cannot close on mocked tests alone. Requires live verification against an array.priority:P0Can damage a customer array or breaks the module outright. Drop other work.Can damage a customer array or breaks the module outright. Drop other work.size:SOne sitting. Single file or a mechanical change.One sitting. Single file or a mechanical change.source:livetestOpened from evidence measured against a real array.Opened from evidence measured against a real array.status:design-approvedDesign reviewed and approved by the maintainer. Implementation may start.Design reviewed and approved by the maintainer. Implementation may start.
Update-PfbLegalHoldEntitymakes-Namemandatory and sends it asnamesonPATCH /legal-holds/held-entities. A held entity has no name. The array does not acceptnamesas a selector for this operation, and the parameter's mandatory-ness makes it look like the primary one.The spec says the key is declared
Unlike the
New-PfbNlmReclamationcase,namesis not an undeclared key here —PATCH /legal-holds/held-entitiesgenuinely declaresnames(query, optional) in every version from REST 2.17 through 2.28, alongsideids,file_system_names,file_system_ids,pathsandrecursive.But the object it would select has no name to match.
#/components/schemas/LegalHoldHeldEntitydeclares exactly four properties in 2.26:No
name, noid. A held entity is identified by the combination of the hold, the file system and the path — which is why the operation carriesfile_system_namesandpathsas separate keys rather than a single composite selector.This is already known for the read side:
Tests/Fixtures/PfbSelectorWaivers.psd1waivesGET /legal-holds/held-entitiesin the selector rail with the note "its items carry no name (file_system, legal_hold, path, status)." The waiver covers the read; the write side inherited the same declared-but-unusable key with a mandatory parameter in front of it.Measured on a live array
FB-A, Purity//FB 4.8.2, REST 2.26, against a harness-created file system with a harness-created hold applied to it.
Naming only the hold — which is what a caller following the cmdlet's mandatory
-Namewould do:Note what that error is not. It is not "no such entity" and not "invalid name" — the array reports the selector as absent, having been sent
names=<hold>. That is consistent with FlashBlade dropping a key it cannot apply and then finding itself with no selector at all.Adding the file system and path but omitting the recursive flag:
The form that actually works:
So the real selector is
file_system_names+paths+recursive, and-Namecontributes nothing to it. The release proved synchronous — the hold deleted immediately afterwards with no status read-back needed.The error text on the third form is identical to the one
New-PfbLegalHoldEntity(the apply direction) produces for the same omission, so release is symmetric with apply rather than special-cased.Why the mandatory parameter is the defect
namesbeing declared-but-inapplicable is the array's business and matches the existing read-side waiver. What this repo owns is the signature.-Namemandatory says: this is how you address the thing you are changing. It is not. A caller supplying only-Name— the one parameter the cmdlet forces them to supply — gets a 400 whose text points at the selector rather than at their mistake.Scope
Decide what
-Nameshould be on this cmdlet. Options, in rough order of preference:-Name/namesand make the real selector explicit — the file system plus path plus recursive triple the array actually uses.-Nameas optional and documented as ineffective, and add a preflight check that a usable selector was supplied.Either way the help should state the working form, since it is not inferable from the parameter list.
Note that
-Nameis currently mandatory, so removing it or demoting it is a breaking change for any caller passing it positionally. That call belongs to the maintainer.Relationship to other issues
This is the same family of defect as #124 (a declared query key whose response items carry no such field) and shares its interface consequence with the
New-PfbNlmReclamation -Nameissue filed alongside this one. It is distinct from thereleasedrequiredness defect that #106 Part 2 identified on this same cmdlet — that one is a missing required input and is being fixed directly; this one is an unusable selector and is not.Found while live-verifying the #106 Part 2
releasedfix, using the legal-holds live-test gate opened for that purpose.