Skip to content

feat(http): include OS family in User-Agent - #318

Merged
aliceinwire merged 2 commits into
kernelci:mainfrom
profusion:feat/user-agent-os-family
Oct 3, 2026
Merged

aliceinwire merged 2 commits into
kernelci:mainfrom
profusion:feat/user-agent-os-family

Conversation

@alanpeixinho

Copy link
Copy Markdown
Contributor

Summary

Test plan

python -c "from kcidev.libs.common import kcidev_session; print(kcidev_session.headers['User-Agent'])"

Coarse OS in the kci-dev UA supports dashboard client analytics (kernelci/dashboard#2144).

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@aliceinwire

Copy link
Copy Markdown
Member

Looks good overall. I’d just suggest strengthening the tests before merging.

The current assertion builds the expected User-Agent using client_os_family() itself, so it would not catch a regression in the normalization logic. For example, if Darwin stopped being mapped to macOS, the test could still pass.

Could we add explicit tests for at least:

  • Linux -> Linux
  • Darwin -> macOS
  • Windows -> Windows
  • empty value -> unknown

It may also be worth mapping only the OS families supported by the dashboard and returning unknown for anything else, so the User-Agent contract stays intentionally coarse and predictable.

* Assert Linux, Darwin, Windows, and an empty value directly.
* Report unknown for any OS outside Linux, macOS, and Windows.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho

Copy link
Copy Markdown
Contributor Author

Thanks @aliceinwire, I updated the PR addressing your review.

@aliceinwire
aliceinwire merged commit e4c0087 into kernelci:main Oct 3, 2026
7 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.

2 participants