Skip to content

feat: add User-Agent header to API request debug output#432

Merged
mwbrooks merged 1 commit intomainfrom
mwbrooks-api-req-user-agent-output
Mar 24, 2026
Merged

feat: add User-Agent header to API request debug output#432
mwbrooks merged 1 commit intomainfrom
mwbrooks-api-req-user-agent-output

Conversation

@mwbrooks
Copy link
Copy Markdown
Member

@mwbrooks mwbrooks commented Mar 23, 2026

Changelog

When a command runs with the verbose flag (--verbose) and makes an HTTP request, then the output now includes the HTTP Header's User-Agent.

[2026-03-23 16:30:30] HTTP Request User-Agent: slack-cli/v3.15.0 (os: darwin)

Summary

This pull request outputs the HTTP Request's User-Agent in the --verbose debug logs.

The motivation is to improve manual testing that requires confirming that the user-agent is set correctly and enrich our log data with more information. Currently, we output the Request URL and Body, so this was a minor addition.

Test Steps

$ ./bin/slack auth login --verbose 2>&1 | grep 'User-Agent'
# → Expect: HTTP Request User-Agent: slack-cli/v3.15.0 (os: darwin)
# CTRL+C

Requirements

Add the User-Agent header to the debug log output for API requests,
making it easier to verify CLI version propagation during debugging.
@mwbrooks mwbrooks added this to the Next Release milestone Mar 23, 2026
@mwbrooks mwbrooks self-assigned this Mar 23, 2026
@mwbrooks mwbrooks added enhancement M-T: A feature request for new functionality semver:patch Use on pull requests to describe the release version increment labels Mar 23, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.28%. Comparing base (fae6821) to head (ec2590e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #432      +/-   ##
==========================================
- Coverage   70.31%   70.28%   -0.04%     
==========================================
  Files         220      220              
  Lines       18497    18498       +1     
==========================================
- Hits        13006    13001       -5     
- Misses       4319     4321       +2     
- Partials     1172     1176       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwbrooks mwbrooks added the changelog Use on updates to be included in the release notes label Mar 23, 2026
@mwbrooks mwbrooks marked this pull request as ready for review March 23, 2026 23:49
@mwbrooks mwbrooks requested a review from a team as a code owner March 23, 2026 23:49
Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@mwbrooks LGTM and thanks for saving so much headache in future debugging 🐛

expected string
}{
"includes User-Agent header in output": {
userAgent: "slack-cli/v1.2.3 (os: darwin)",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🧮 praise: Solid tests!

@mwbrooks
Copy link
Copy Markdown
Member Author

Thank you, thank you @zimeg! 🙇🏻

@mwbrooks mwbrooks merged commit 97fbfe8 into main Mar 24, 2026
8 checks passed
@mwbrooks mwbrooks deleted the mwbrooks-api-req-user-agent-output branch March 24, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog Use on updates to be included in the release notes enhancement M-T: A feature request for new functionality semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants