Skip to content

chore: add User-Agent header to Tailor Platform API requests#49

Merged
k1LoW merged 1 commit intomainfrom
chore/set-user-agent
Nov 17, 2025
Merged

chore: add User-Agent header to Tailor Platform API requests#49
k1LoW merged 1 commit intomainfrom
chore/set-user-agent

Conversation

@dragon3
Copy link
Copy Markdown
Contributor

@dragon3 dragon3 commented Nov 17, 2025

This pull request adds User-Agent header to all HTTP requests to Tailor Platform API by extending the bearerTokenTransport to include user agent functionality.
The User-Agent format is patterner/<version> (e.g., patterner/0.8.0)

Changes

  • Modified bearerTokenTransport struct to include userAgent field
  • Updated RoundTrip method to set User-Agent header on outgoing requests
  • User-Agent value is constructed from version.Name and version.Version

Motivation

Setting a proper User-Agent header helps with API request tracking, monitoring, and debugging on the server side. It allows the Tailor Platform to identify requests coming from the patterner tool and its version.

@dragon3 dragon3 added the enhancement New feature or request label Nov 17, 2025
@dragon3 dragon3 self-assigned this Nov 17, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Code Metrics Report

main (c6f2e7e) #49 (ef68456) +/-
Coverage 27.5% 27.4% -0.1%
Code to Test Ratio 1:1.4 1:1.4 -0.1
Test Execution Time 7s 7s 0s
Details
  |                     | main (c6f2e7e) | #49 (ef68456) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |          27.5% |         27.4% | -0.1% |
  |   Files             |             12 |            12 |     0 |
  |   Lines             |            563 |           564 |    +1 |
  |   Covered           |            155 |           155 |     0 |
- | Code to Test Ratio  |          1:1.4 |         1:1.4 |  -0.1 |
  |   Code              |           1483 |          1488 |    +5 |
  |   Test              |           2178 |          2178 |     0 |
  | Test Execution Time |             7s |            7s |    0s |

Code coverage of files in pull request scope (53.8% → 50.0%)

Files Coverage +/- Status
tailor/tailor.go 50.0% -3.9% modified

Reported by octocov

@dragon3 dragon3 marked this pull request as ready for review November 17, 2025 01:56
@dragon3 dragon3 requested a review from a team as a code owner November 17, 2025 01:56
@dragon3 dragon3 requested a review from k1LoW November 17, 2025 01:56
Copy link
Copy Markdown
Contributor

@k1LoW k1LoW left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!!!

@k1LoW k1LoW merged commit bd75a2e into main Nov 17, 2025
1 check passed
@k1LoW k1LoW deleted the chore/set-user-agent branch November 17, 2025 06:45
@github-actions github-actions Bot mentioned this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants