-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Remove deprecated constructor and use exposed builder pattern #483
Conversation
private val collector = builder.collector ?: ChuckerCollector(context) | ||
private val maxContentLength = builder.maxContentLength | ||
private val cacheDirectoryProvider = builder.cacheDirectoryProvider ?: CacheDirectoryProvider { context.filesDir } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the inconvenience that I mentioned. Default fields are declared here instead of in the builder. It is only due to test purposes. Instantiating ChuckerCollector
would require a lot of mocking of Context
that I don't want to be bothered with.
On the other hand it is nice to not create stuff eagerly in the builder.
6a24281
to
3168614
Compare
3168614
to
9674246
Compare
9674246
to
6d4a8b4
Compare
I like that we will have builder patter in Chucker soon.
|
I'm not sure if I understand what you mean by
Can you create some snippet? I think I don't get the full picture. |
I mean that we are just removing some existing part of our public API without any warnings. Yes, I agree that we don't make people do a ton of changes, but still, it would be better if we had some announcement/warning and some grace period when we have both deprecated constructor and the brand new builder. It feels kind of tricky since we have just one
Yes, I should do some, probably. Also need to connect all dots to prove that the concept is valid. |
Maybe it got lost in the whole PR description. After merging this PR without squashing I want to cherry-pick 5e7d733 onto |
Yes, looks like I missed the point about deprecations in one of commits. In such case I am fine with the approach. But still, we would need to use |
Yes, it's a little bit unfortunate that we'd have to make next release with a minor bump but I want to remove the burden of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed this PR by commits (as it supposed to happen) and everything looks fine and reasonable for me.
As to my suggestion about additional interfaces - we can come back to it later when we do other changes to transaction processing.
Great job 👍 Also sorry for being late to the game here.
+1 on this. I actually wanted to take a stab to add https://github.com/Kotlin/binary-compatibility-validator to Chucker in the near future (that will prevent future problems like this one).
Agree here on what @vbuberen mentioned. If we merge this, we need to release Imho this PR should also be split in 2 separate PRs: 5e7d733 should be pointed against |
I thought that we treat now our |
(I wrote master but I meant develop sorry) Yup I'm fine either way. But I would still advice we follow this flow: |
Ok, got it. I was just a little bit confused because we already have |
Sorry, I also haven't noticed that. In that case, let's create a PR with 5e7d733 & Merge it on |
6d4a8b4
to
a923a8f
Compare
Ok, I changed PR target. I think after merging #491 it will automatically retarget to |
Some conflicts popped up. I'll resolve them after |
a923a8f
to
67167aa
Compare
67167aa
to
5070c64
Compare
Let's rebase this on top of #496 once it's merged |
5070c64
to
ec8db89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
📄 Context
There is an issue - #462.
📝 Changes
This implementation uses more robust builder pattern in terms of future development. It should be used with
4.x
. There is one inconvenience when it comes to default values but it is not that big of a deal. I'll describe it more in the comments to the code.🚫 Breaking
Yes it breaks both API and ABI, but it is for
4.x
.🛠️ How to test
I suggest reviewing commits separately. With 5e7d733 you can check ifReplaceWith
works correctly.Nothing special to test.
⏱️ Next steps
Closes #462
Helps with #466. It does not solve it, but I don't think we can fix it unfortunately. We can only make sure that in the future we don't fall into the same trap. Though suggestion with adding ABI compatibility tool would be a nice addition.
We should consider doing the same with
ChuckerCollector
andRetentionManger
. They do not change that dynamically, so there might be no reason to switch there to the builder pattern but on the other hand it might pose at some point in the future same issues as #466.