Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set proper User-Agent for request made to Kong and Konnect #5753

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

programmer04
Copy link
Member

@programmer04 programmer04 commented Mar 26, 2024

What this PR does / why we need it:

It uses go-kong feature introduced in v0.52.0, see

It allows setting User-Agent to ensure that KIC always uses the client with the proper User-Agent set. The linter configuration will enforce it across the whole repo.

For clients that live in the KIC repo internal/konnect/* User-Agent is also added. Those clients are considered as a temporary solution because they will be deprecated as fast as the proper SDK will be released. Thus it's not in the scope of this PR to make a bigger refactor, etc. of those clients, just add the missing User-Agent.

Which issue this PR fixes:

Closes #5418

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@programmer04 programmer04 added the area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. label Mar 26, 2024
@programmer04 programmer04 added this to the KIC v3.2.x milestone Mar 26, 2024
@programmer04 programmer04 self-assigned this Mar 26, 2024
@programmer04 programmer04 changed the title User agent fix: set proper User-Agent for request made to Kong and Konnect Mar 26, 2024
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 90.62500% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 73.9%. Comparing base (09f1e55) to head (4ebbc52).
Report is 1 commits behind head on main.

Files Patch % Lines
internal/adminapi/kong.go 71.4% 1 Missing and 1 partial ⚠️
internal/adminapi/konnect.go 66.6% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5753     +/-   ##
=======================================
+ Coverage   73.4%   73.9%   +0.5%     
=======================================
  Files        175     176      +1     
  Lines      18147   18172     +25     
=======================================
+ Hits       13321   13440    +119     
+ Misses      3851    3735    -116     
- Partials     975     997     +22     

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

@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 27, 2024
@programmer04 programmer04 force-pushed the user-agent branch 3 times, most recently from 2e37a20 to c4c01c2 Compare March 27, 2024 11:33
@programmer04 programmer04 marked this pull request as ready for review March 27, 2024 11:36
@programmer04 programmer04 requested a review from a team as a code owner March 27, 2024 11:36
@programmer04 programmer04 enabled auto-merge (squash) March 27, 2024 11:36
Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

Nice 👍

internal/konnect/nodes/client_test.go Show resolved Hide resolved
@programmer04 programmer04 merged commit c393bb5 into main Mar 28, 2024
38 checks passed
@programmer04 programmer04 deleted the user-agent branch March 28, 2024 11:34
@randmonkey randmonkey mentioned this pull request Apr 2, 2024
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set the user agent on Konnect & Admin API requests
2 participants