-
Notifications
You must be signed in to change notification settings - Fork 31
fix: display sensitivity prompt only for item definition #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: display sensitivity prompt only for item definition #131
Conversation
| "workspaceId", | ||
| "folderId", | ||
| "properties.nested.value", | ||
| "displayName.localized", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove all of these cases and just keep 1 or 2
…https://github.com/aviatco/fabric-cli into dev/aviatcohen/displayDefinitionPromptOnlyWhenNeeded
ohadedry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update description to reflect latest changes
| @@ -0,0 +1,6 @@ | |||
| kind: fixed | |||
| body: display sensitivity label prompt only when item definition is requested | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the comment to reflect the changes
✨ Description of new changes
Fix #127
This pull request refactors how the CLI determines when to display the sensitive label prompt, when retrieve item definitions versus metadata-only queries. It introduces a utility function to centralize this logic, updates all relevant code paths to use it, and adds comprehensive tests. This ensures that sensitivity label prompts are only shown when definition data is requested, improving both correctness and maintainability.
Definition retrieval logic centralization:
should_retrieve_definitioninfab_cmd_get_utils.pyto determine when a query requires retrieving the item's definition, consolidating and clarifying the logic for handling sensitive data.fab_fs_get_item.pyandfab_fs_get.pyto use the new utility function, replacing previous ad-hoc checks and removing direct references toITEM_METADATA_PROPERTIES. [1] [2]Code cleanup and simplification:
ITEM_METADATA_PROPERTIESconstant fromfab_constant.py, since this information is encapsulated in the new utility function.Testing and documentation:
should_retrieve_definitioncovering a wide range of query scenarios and edge cases, ensuring robust and predictable behavior.Changelog: