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

Add client name and version as request headers #2008

Merged
merged 6 commits into from
Jul 6, 2023

Conversation

martynmjones
Copy link
Contributor

@martynmjones martynmjones commented Jul 4, 2023

Changes proposed in this Pull Request:

This PR adds two additional headers to requests sent to the WooCommerce Connect Server:

  • x-client-name
  • x-client-version

Detailed test instructions:

  1. Checkout add/plugin-version-header on a new test site
  2. Work through onboarding and establish a connection to a Google account
  3. Navigate to Marketing > Google Listings & Ads and visit various sections
  4. Confirm that no errors are reported and all data is loaded as expected

Changelog entry

Add - Client name and plugin version to requests

@martynmjones martynmjones self-assigned this Jul 4, 2023
@github-actions github-actions bot added changelog: add A new feature, function, or functionality was added. type: enhancement The issue is a request for an enhancement. labels Jul 4, 2023
@martynmjones martynmjones changed the title Add/plugin version header Add client name and version as request headers Jul 4, 2023
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Merging #2008 (b2303ba) into develop (afebc1e) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             develop   #2008     +/-   ##
===========================================
+ Coverage       57.9%   58.0%   +0.1%     
- Complexity      4111    4113      +2     
===========================================
  Files            456     456             
  Lines          17658   17669     +11     
===========================================
+ Hits           10224   10255     +31     
+ Misses          7434    7414     -20     
Flag Coverage Δ
php-unit-tests 58.0% <100.0%> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nal/DependencyManagement/GoogleServiceProvider.php 16.9% <100.0%> (+16.9%) ⬆️
src/PluginHelper.php 74.4% <100.0%> (+8.6%) ⬆️

Martyn Jones and others added 2 commits July 5, 2023 10:24
@martynmjones martynmjones requested a review from a team July 5, 2023 19:26
@martynmjones martynmjones marked this pull request as ready for review July 5, 2023 19:26
Copy link
Member

@eason9487 eason9487 left a comment

Choose a reason for hiding this comment

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

Thanks for the work.

I also tested this PR with a local WCS and confirmed GLA requests contained the two headers. LGTM.

2023-07-06 14 54 46

use PluginHelper;

/**
* Confirm that the client handler stack includes the `plugin_version_header
Copy link
Member

Choose a reason for hiding this comment

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

The closing backtick is missing.

@martynmjones martynmjones merged commit 566e407 into develop Jul 6, 2023
@martynmjones martynmjones deleted the add/plugin-version-header branch July 6, 2023 08:01
@eason9487 eason9487 mentioned this pull request Jul 11, 2023
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: add A new feature, function, or functionality was added. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants