Skip to content

fix: remove hardcoded "Created by fab" description from mkdir and imp…#214

Open
HasanAboShally wants to merge 5 commits intomicrosoft:mainfrom
HasanAboShally:fix/remove-hardcoded-description
Open

fix: remove hardcoded "Created by fab" description from mkdir and imp…#214
HasanAboShally wants to merge 5 commits intomicrosoft:mainfrom
HasanAboShally:fix/remove-hardcoded-description

Conversation

@HasanAboShally
Copy link
Copy Markdown
Collaborator

📥 Pull Request

✨ Description of new changes

  • Summary: Remove the hardcoded "description" field from API payloads in mkdir and import commands. Resolves Remove hardcoded "Created by fab" description from mkdir and import commands #213.
  • Context: When creating items, workspaces, folders, or connections via mkdir, the CLI hardcodes "description": "Created by fab". Similarly, import hardcodes "Imported from fab". Users have no way to override or opt out of this, and downstream services may propagate the description to child objects, causing unexpected metadata pollution. Resources are now created without a default description unless the user explicitly provides one via params.
  • Dependencies: None.

…ort commands

- Resolves microsoft#213

Remove the hardcoded "description" field from API payloads in mkdir
(item, workspace, folder, connection) and import commands. Resources
are now created without a default description unless the user
explicitly provides one via params.
@HasanAboShally HasanAboShally requested a review from a team as a code owner April 15, 2026 13:05
Copilot AI review requested due to automatic review settings April 15, 2026 13:05
Comment thread src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_connection.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Removes hardcoded default description values from mkdir and import payload generation so resources are created without metadata pollution unless a user explicitly provides a description.

Changes:

  • Removed "description": "Created by fab" from mkdir payloads (workspace, item, folder, connection).
  • Removed "description": "Imported from fab" from import payloads.
  • Updated unit tests and added a changelog entry documenting the fix.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_utils/test_fab_cmd_mkdir_utils.py Updates expected mkdir payloads to no longer include default descriptions.
tests/test_core/test_fab_hiearchy.py Updates expected import payloads to no longer include default descriptions.
src/fabric_cli/utils/fab_cmd_import_utils.py Stops injecting "Imported from fab" into item import payloads.
src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_workspace.py Stops injecting "Created by fab" into workspace creation payloads.
src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_item.py Stops injecting "Created by fab" into item creation payloads.
src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_folder.py Stops injecting "Created by fab" into folder creation payloads.
src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_connection.py Stops injecting "Created by fab" into connection creation payloads.
src/fabric_cli/commands/fs/impor/fab_fs_import_item.py Stops injecting "Imported from fab" into environment-item import payloads.
.changes/unreleased/fixed-20260415-120000.yaml Adds changelog entry for the behavior change.

Comment thread src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_workspace.py Outdated
Comment thread src/fabric_cli/commands/fs/impor/fab_fs_import_item.py
- Remove commented-out description from mkdir_gateway
- Remove 'requestMessage: Created by fab' from mkdir_managedprivateendpoint
- Add tests verifying workspace mkdir payload has no description by default
- Add test verifying user-provided description is included via params
- Add test verifying import create environment payload has no description
Copilot AI review requested due to automatic review settings April 16, 2026 12:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Comment thread tests/test_core/test_fab_hiearchy.py Outdated
Comment thread tests/test_core/test_fab_hiearchy.py
Comment thread src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_connection.py
Comment thread src/fabric_cli/commands/fs/mkdir/fab_fs_mkdir_workspace.py Outdated
- Add early error handling for non-2xx response in mkdir_managedprivateendpoint
- Forward user-provided description to connection mkdir payload
- Fix workspace param key removal to use lowercase displayname
- Use lowercase param keys in workspace tests to match CLI behavior
Copilot AI review requested due to automatic review settings April 16, 2026 22:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/fabric_cli/commands/fs/impor/fab_fs_import_item.py:112

  • _import_create_environment_item parses response.text and proceeds to publish the environment regardless of whether the create call succeeded. If the API returns a non-2xx response (or a non-JSON error body), this will raise during json.loads(...) and can mask the real failure. Consider checking response.status_code before parsing/using the body, and raise a FabricCLIError with the API error details (or return early) when creation fails.
        item_payload["description"] = description
    item_payload_str = json.dumps(item_payload)

    # Create the item
    response = item_api.create_item(args, payload=item_payload_str)

"displayName": connection.short_name,
"connectivityType": connectivityType,
}
if params.get("description") is not None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check should be done in all commands where u remove the "created by fab"


payload = {
# "description": "Created by fab",
"displayName": gateway.short_name,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we add the "description" in the payload if user provided it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question for other types

args, payload= json.dumps(payload)
args, payload=json.dumps(payload)
)
if response.status_code not in (200, 201):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this was added?


# Remove all unwanted keys from the params
utils.remove_keys_from_dict(args.params, ["displayName"])
utils.remove_keys_from_dict(args.params, ["displayname"])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change it to displayname with lower letter n?



# -------------------------------------------------------------------
# Tests for workspace mkdir payload — no hardcoded description
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary comment

@patch("fabric_cli.commands.fs.mkdir.fab_fs_mkdir_workspace.utils_mem_store")
@patch("fabric_cli.commands.fs.mkdir.fab_fs_mkdir_workspace.utils_ui")
@patch("fabric_cli.commands.fs.mkdir.fab_fs_mkdir_workspace.fab_state_config")
@patch("fabric_cli.commands.fs.mkdir.fab_fs_mkdir_workspace.utils")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need those mocks? I dont see we use it.

},
output="text",
)
exec(workspace, args)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u should use cli_executor not exec directly .
looking at the other tests in this file we only create the class and verify the values - so maybe do the same



# -------------------------------------------------------------------
# Tests for import create environment item — no hardcoded description
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

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.

Remove hardcoded "Created by fab" description from mkdir and import commands

3 participants