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

enhancement: user agent 2.1 #3001

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yenfryherrerafeliz
Copy link
Contributor

This change provides:

  • A builder class for appending metrics
  • Default initialization of a metrics builder within command instantiation
  • Wraps user agent logic into a single middleware class
  • Adds middlewares into the different features from where metrics can be gather, to acomplish this purpose.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Member

@stobrien89 stobrien89 left a comment

Choose a reason for hiding this comment

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

Just an initial pass- had a few comments

src/AwsClient.php Outdated Show resolved Hide resolved
src/AwsClient.php Outdated Show resolved Hide resolved
src/EndpointV2/EndpointV2Middleware.php Outdated Show resolved Hide resolved
const FLEXIBLE_CHECKSUMS_REQ_CRC64 = "W";
const FLEXIBLE_CHECKSUMS_REQ_SHA1 = "X";
const FLEXIBLE_CHECKSUMS_REQ_SHA256 = "Y";
/** @var int */
Copy link
Member

Choose a reason for hiding this comment

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

nit: newline needed here

Copy link
Member

Choose a reason for hiding this comment

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

Basically I was saying each var/docblock should be separated by a newline

src/MetricsBuilder.php Outdated Show resolved Hide resolved
src/MetricsBuilder.php Outdated Show resolved Hide resolved
src/UserAgentMiddleware.php Outdated Show resolved Hide resolved
src/UserAgentMiddleware.php Outdated Show resolved Hide resolved
@yenfryherrerafeliz yenfryherrerafeliz force-pushed the feat_user_agent_2.1 branch 5 times, most recently from e4cd325 to 6b4b870 Compare November 6, 2024 00:15
Copy link
Member

@stobrien89 stobrien89 left a comment

Choose a reason for hiding this comment

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

Looking good, just had a few more comments

src/MetricsBuilder.php Outdated Show resolved Hide resolved
src/MetricsBuilder.php Outdated Show resolved Hide resolved
src/MetricsBuilder.php Outdated Show resolved Hide resolved
src/MetricsBuilder.php Outdated Show resolved Hide resolved
src/Command.php Outdated Show resolved Hide resolved
src/S3/ApplyChecksumMiddleware.php Outdated Show resolved Hide resolved
src/UserAgentMiddleware.php Outdated Show resolved Hide resolved
src/UserAgentMiddleware.php Outdated Show resolved Hide resolved
@yenfryherrerafeliz yenfryherrerafeliz force-pushed the feat_user_agent_2.1 branch 7 times, most recently from 1160889 to c77d08e Compare November 12, 2024 14:58
@yenfryherrerafeliz yenfryherrerafeliz force-pushed the feat_user_agent_2.1 branch 3 times, most recently from c8c6ef9 to 64854e1 Compare November 12, 2024 15:32
src/AwsClient.php Outdated Show resolved Hide resolved
src/CommandInterface.php Outdated Show resolved Hide resolved
src/ClientResolver.php Show resolved Hide resolved
tests/Credentials/CredentialsTest.php Outdated Show resolved Hide resolved
src/Credentials/CredentialSources.php Outdated Show resolved Hide resolved
src/UserAgentMiddleware.php Outdated Show resolved Hide resolved
src/EndpointV2/EndpointV2Middleware.php Outdated Show resolved Hide resolved
src/UserAgentMiddleware.php Outdated Show resolved Hide resolved
tests/AwsClientTest.php Show resolved Hide resolved
tests/MetricsBuilderTest.php Outdated Show resolved Hide resolved
Copy link
Member

@stobrien89 stobrien89 left a comment

Choose a reason for hiding this comment

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

Approved, pending some nits about newlines

const FLEXIBLE_CHECKSUMS_REQ_CRC64 = "W";
const FLEXIBLE_CHECKSUMS_REQ_SHA1 = "X";
const FLEXIBLE_CHECKSUMS_REQ_SHA256 = "Y";
/** @var int */
Copy link
Member

Choose a reason for hiding this comment

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

Basically I was saying each var/docblock should be separated by a newline

src/UserAgentMiddleware.php Show resolved Hide resolved
src/UserAgentMiddleware.php Show resolved Hide resolved
src/UserAgentMiddleware.php Show resolved Hide resolved
src/UserAgentMiddleware.php Show resolved Hide resolved
This change provides:
- A builder class for appending metrics
- Default initialization of a metrics builder within command instantiation
- Wraps user agent logic into a single middleware class
- Adds middlewares into the different features from where metrics can be gather, to acomplish this purpose.
- Move the user agent middleware after the signing step in order to gather signature metrics.
- Add request compression metric gathering.
- Add specific testing for signatures.
- Add specific testing for request compression.
- Add specific testing for s3 encryption clients.
- Add credentials metric gathering logic.
- Add tests for credentials metrics.
- Make existent credentials tests to work with the new field `source`. For example, for tests around profile credentials the source property for credentials MUST be `profile`. The default value for this field is `static`.
- Use static mapping instead of multiple if/else-ifs.
- Remove the endpoint_id metric tracking since it was removed from the spec.
- Make method's name to be verb based.
- Remove the getMetricsBuilder from the CommandInterface.
- Add tests cases to cover credentials sets the correct source when resolved.
- Fix the sso, sso_legacy, and process metrics. They should be all a profile based metric.
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