Skip to content

kotlin: add library request interfaces#240

Merged
buildbreaker merged 14 commits intomasterfrom
kotlinrequest-classes
Jul 12, 2019
Merged

kotlin: add library request interfaces#240
buildbreaker merged 14 commits intomasterfrom
kotlinrequest-classes

Conversation

@buildbreaker
Copy link
Copy Markdown

@buildbreaker buildbreaker commented Jul 9, 2019

#119

Adding a primitive Request and RequestBuilder with basic features:

  • URL
  • method
  • headers
  • trailers
  • retry policy

Tests are basic setting a builder and ensuring the result is expected. Additionally, the request build transform creates an equivalent object when built back.

Signed-off-by: Alan Chiu achiu@lyft.com

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Description: kotlin: add library request interfaces
Risk Level: low
Testing: unit
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]

Copy link
Copy Markdown
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

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

Overall this is great. Fully-agree Builder pattern is the way to go here. I left links to some comments on @rebello95's other PR, since they're the same and we'll want consistency.

@buildbreaker buildbreaker changed the title kotlin/request-classes kotlin: add library request interfaces Jul 11, 2019
@buildbreaker buildbreaker marked this pull request as ready for review July 11, 2019 23:19
Alan Chiu added 9 commits July 11, 2019 21:09
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
fix
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
?
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
bug
Signed-off-by: Alan Chiu <achiu@lyft.com>
@buildbreaker buildbreaker force-pushed the kotlinrequest-classes branch from f988b2b to 021c353 Compare July 12, 2019 04:09
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
.addRetryPolicy(retryPolicy)
.build()

assertThat(request.retryPolicy).isEqualTo(RetryPolicy(23, listOf(RetryRule.FIVE_XX, RetryRule.CONNECT_FAILURE), 1234))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not compare directly to retryPolicy?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's easier to see the values which we are expecting on an assert line

Alan Chiu added 3 commits July 12, 2019 13:48
k
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: Alan Chiu <achiu@lyft.com>
)

kt_jvm_library(
name = "envoy_interfaces_lib",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be part of envoy_lib?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It'll pull in all the dependencies with the JNI, Android, etc. I wanted to keep this more vanilla kotlin for now because I hope to isolate most of the classes away from Android and Envoy. The rationale is because I want to keep the tests lighter weight and we can more easily make decisions independent from the other layers.

We can also revisit the organization and responsibility boundaries down the line

Copy link
Copy Markdown
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

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

Looks great.

@buildbreaker
Copy link
Copy Markdown
Author

thanks for the review @rebello95 @goaway

@buildbreaker buildbreaker merged commit 8b52ac1 into master Jul 12, 2019
@buildbreaker buildbreaker deleted the kotlinrequest-classes branch July 12, 2019 22:33
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.

3 participants