Skip to content

feat(set item): support setting item definition paths#67

Merged
may-hartov merged 22 commits intomicrosoft:mainfrom
may-hartov:dev/mahartov/set_item_command
Nov 24, 2025
Merged

feat(set item): support setting item definition paths#67
may-hartov merged 22 commits intomicrosoft:mainfrom
may-hartov:dev/mahartov/set_item_command

Conversation

@may-hartov
Copy link
Copy Markdown
Collaborator

@may-hartov may-hartov commented Nov 13, 2025

✨ Description of new changes

  • Summary:

Expand and generalize the Set Item command to support setting any settable property in the item metadata and definition.

  • Context:
    Currently, the Set Item command supports only a narrow range of properties (refer to ITMutablePropMap for the supported properties).
    To enhance functionality, we should explore our options to expand and generalize the Set Item command to support setting any settable property in the item metadata and definition.

Notes:
-Item definition is a complex structure that can contain hundreds of properties.
-Item metadata settable properties are displayName and description. VariableLibrary also lets you set "properties".

Approach

  1. Updated set item command -query flag validation. Supported values:

    • Item metadata:
      • displayName, description, properties, and properties.
    • Item definition:
      • definition or starts with definition.
  2. Backwards compatibility:

    • If the query argument value is in ITMutablePropMap, map to the corresponding path.
  3. Limitations:

    • Command doesn’t support JMESPath filters or wildcards, only explicit string paths.
    • Support a single -query argument value.
    • Strigified json input is not supported (for example "{"key":"value"}") - we will always try to parse json into an object
    • As set item definition uses export item to get the item definition and update the target property within it, and some properties are not included in the exported item (e.g., some default values), we support only setting properties that exist in the get item result.

Additional Enhancements and Bug Fixes

  • Performance improvement – Call GET / update definition only if the query has the definition prefix. Otherwise, call GET / POST item APIs.
  • Use specific workload URL to get the item’s metadata – for example, use notebooks/notebookId rather than items/notebookId.
  • Change PATCH item request payload to include only updated property rather the entire item. This ensures the API will fail if the property is readonly, and will not try to update existing, unchanged properties.
    • get item core API doesn’t always return the workload’s specific metadata.

@may-hartov may-hartov requested a review from a team as a code owner November 13, 2025 13:10
@may-hartov may-hartov changed the title feat(set item): - support setting item definition paths feat(set item): support setting item definition paths Nov 13, 2025
may-hartov and others added 4 commits November 16, 2025 14:26
@may-hartov may-hartov merged commit 1639cb9 into microsoft:main Nov 24, 2025
9 checks passed
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.

3 participants