-
Notifications
You must be signed in to change notification settings - Fork 556
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 error on writing cache file in the Java client #10642
Fix error on writing cache file in the Java client #10642
Conversation
Hi @zambrovski 👋 Thanks for reporting and immediately fixing it as well! I'll have a good look at the PR after the weekend. I quickly wanted to highlight our error message guidelines. 🔧 Please align the exception message ( |
Will fix the exception text today |
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.
👍 Thanks @zambrovski and sorry that this is taking so long.
💭 Please note that I apply the emoji-code in my reviews.
❌ Please have a look at my change requests below.
❓ I've also manually tested your changes, and I wondered whether the new behavior is what you want.
Previously, having a file or symlink named .camunda
in your home folder ~
caused an exception:
Caused by: java.nio.file.FileAlreadyExistsException: /Users/korthout/.camunda
Now, that same scenario leads to an exception:
Caused by: java.io.IOException: Expected /Users/korthout/.camunda to be a directory, but it was a regular file.
👍 IMO, the difference is that the error message is clearer and has a stracktrace that better describes what is happening. Additionally, the code has become more expressive about its assumptions.
❓ That's enough for me, but I would like to verify this behavior with you before we merge it.
❌ If this works for you, please rebase (e.g. squash) your commits into one or multiple commits with meaningful commit messages adhering to our commit message guidelines.
You are probably right. It should be even better and just re-use the directory if it is one.. Let me improve this and apply your modifications. |
…better error messages and tests, fix #10641
I hope, I finally got all guidelines fulfilled (Checkstyle, exception texts, git style, commit message style). |
By the way, is already hacktoberfest? |
@zambrovski yes, it is. 🥳 This pull request will count toward the Hacktoberfest challenge. If you contributed four pull requests then you can complete your Camunda Hacktoberfest challenge here. |
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.
Wow thanks @zambrovski That's much more thorough.
👍 I like that the file can now be created if the parent directory already exists or when it's a symlink to a directory. That's much more resilient and easy to use. Cool stuff!
I have one last question before I can accept it. Please have a look.
clients/java/src/test/java/io/camunda/zeebe/client/impl/oauth/OAuthCredentialsCacheTest.java
Outdated
Show resolved
Hide resolved
clients/java/src/main/java/io/camunda/zeebe/client/impl/oauth/OAuthCredentialsCache.java
Show resolved
Hide resolved
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.
We seem to be having some issues with our merging bot (bors). I don't see a need to get this merged immediately, so let's await the fix. |
We were able to pinpoint the issue as something related to permissions. A solution is available by rebasing the affected PRs onto @zambrovski Please rebase this PR onto the latest |
Rebased... |
@zambrovski c2a068d merges EDIT: Sorry for all this back and forth. If you'd prefer that I take over the last bit to get this merged, then please let me know. |
10825: Fix restore app startup and shutdown behavior r=oleschoenburg a=oleschoenburg - fixes injection of backup store - fixes missing shutdown of restore app - fixes a confusing and noisy exception when restore fails within a docker container closes #10824 10831: Fix error on writing cache file in the Java client r=saig0 a=korthout ## Description <!-- Please explain the changes you made here. --> This is a recreation of #10642, as I had to rebase the branch. ## Related issues <!-- Which issues are closed by this PR or are related --> closes #10641 Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com> Co-authored-by: Simon Zambrovski <simon.zambrovski@holisticon.de>
10831: Fix error on writing cache file in the Java client r=saig0 a=korthout ## Description <!-- Please explain the changes you made here. --> This is a recreation of #10642, as I had to rebase the branch. ## Related issues <!-- Which issues are closed by this PR or are related --> closes #10641 10833: ci: run go client tests on github hosted runner r=korthout a=oleschoenburg Go client tests should be able to run ob github hosted runners which are more reliable than the `n1-standard-8-netssd-preempt` runners used before. Co-authored-by: Simon Zambrovski <simon.zambrovski@holisticon.de> Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
Hi, sorry for not responding. Since the last one is not functional anymore, feel free to take over and perform the last steps to comply to git rules that you described. I would be happy if you do this, before I do something in a wrong way and have to redo it again. Cheers, Simon |
Thanks @zambrovski. I've opened #10831 for this, and it's being backported to 8.1 and 8.0. Now that it's merged, I'll close this PR. Thanks again for your contribution 🚀 |
Description
Fixed directory creation if the cache file is missing. Added tests for it.
Related issues
closes #10641
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.