Skip to content

Remove 'host-app/' prefix from User-Agent host app suffix#262

Merged
ayeshurun merged 2 commits into
microsoft:mainfrom
KupoCat:kupocat-fix-host-app-user-agent-format
Jul 8, 2026
Merged

Remove 'host-app/' prefix from User-Agent host app suffix#262
ayeshurun merged 2 commits into
microsoft:mainfrom
KupoCat:kupocat-fix-host-app-user-agent-format

Conversation

@KupoCat

@KupoCat KupoCat commented Jul 6, 2026

Copy link
Copy Markdown
Member

Motivation

When a host application is configured via environment variables, the CLI appends it to the User-Agent header in an invalid format: host-app/[app-name]/version. The host-app/ prefix is not part of the intended User-Agent token format and should be removed.

Approach

Removed the host-app/ prefix from the string built in _get_host_app() so the suffix is now just the app name and optional version directly (e.g. fabric-azuredevops-extension/1.2.0).

Before: ms-fabric-cli/1.0.0 (create; Windows/10; Python/3.10.2) host-app/fabric-azuredevops-extension/1.2.0

After: ms-fabric-cli/1.0.0 (create; Windows/10; Python/3.10.2) fabric-azuredevops-extension/1.2.0

Updated all related test expectations to match the corrected format.

The host-app was being appended in the format 'host-app/[app-name]/version'
which is invalid. This removes the 'host-app/' prefix so the format is now
'[app-name]/version' (e.g. 'fabric-azuredevops-extension/1.2.0').

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 6, 2026 13:48
@KupoCat KupoCat requested a review from a team as a code owner July 6, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the User-Agent host application suffix format by removing the unintended host-app/ prefix when a host application is configured via environment variables, and updates tests to match the corrected header format.

Changes:

  • Remove the host-app/ prefix from the host app suffix produced by _get_host_app().
  • Update User-Agent-related test expectations to reflect the new suffix format.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/fabric_cli/client/fab_api_client.py Adjusts host app suffix construction (and related User-Agent example) to omit the host-app/ prefix.
tests/test_core/test_fab_api_client.py Updates parameterized expectations and request assertions to match the corrected User-Agent suffix.

Comment thread src/fabric_cli/client/fab_api_client.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ayeshurun ayeshurun merged commit 5874763 into microsoft:main Jul 8, 2026
10 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