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

refactor: make sure user is not Blank when using ACMEApi #2639

Merged

Conversation

github-actions[bot]
Copy link
Contributor

Cherry pick from the original PR:


⚠️ Conflicts during cherry-pick:


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

in the logs i see sometimes requests to localhost from acme server and since the logs are obfuscated i was not able to know what is going on

Causes (Optional)

this can result of having a network request with empty string

Solutions

return error when this happen

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. .

* refactor: make sure user is not Blank when using ACMEApi

* Update network/src/commonMain/kotlin/com/wire/kalium/network/api/base/unbound/acme/ACMEResponse.kt

Co-authored-by: Yamil Medina <yamilmedina@users.noreply.github.com>

* detekt

* fix

* trigger CI

fix test

* fix test

---------

Co-authored-by: Yamil Medina <yamilmedina@users.noreply.github.com>
@github-actions github-actions bot added the cherry-pick PR is cherry-picking changes from another banch label Mar 13, 2024
Copy link
Contributor Author

github-actions bot commented Mar 13, 2024

Test Results

2 333 tests   - 649   2 282 ✔️  - 579   15s ⏱️ - 2m 21s
   430 suites  -   87        51 💤  -   70 
   430 files    -   87          0 ±    0 

Results for commit 26d09f7. ± Comparison against base commit dea98f1.

This pull request removes 2982 and adds 2333 tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.HttpClientConnectionSpecsTest ‑ givenOkHttpSingleton_whenBuildingClearTextTrafficOkhttpClient_thenEnsureConnectionSpecClearText[jvm]
com.wire.kalium.HttpClientConnectionSpecsTest ‑ givenTheHttpClientIsCreated_ThenEnsureOnlySupportedSpecsArePresent[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithAccessRoleAndDeprecatedAccessRoleField_whenDecoding_thenDeprecatedFieldIsPreferred[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithDeprecatedAccessRoleField_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayload_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoLocationInHeader_whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoNonce_whenCallingSendAcmeRequestApi_theResponseShouldBeMissingNonce[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGeTrustAnchorsApi_theResponseShouldBeConfigureCorrectly[jvm]
…
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithAccessRoleAndDeprecatedAccessRoleField_whenDecoding_thenDeprecatedFieldIsPreferred[iosX64]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithDeprecatedAccessRoleField_whenDecoding_thenSuccess[iosX64]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayload_whenDecoding_thenSuccess[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoLocationInHeader_whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoNonce_whenCallingSendAcmeRequestApi_theResponseShouldBeMissingNonce[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGeTrustAnchorsApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMEDirectoriesApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMENonceApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
…
This pull request removes 121 skipped tests and adds 51 skipped tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGeTrustAnchorsApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenActivationEmailWIthCode_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenRegisteringAccountWithEMail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenSendingActivationEmail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenActivationCodeFail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenRegistrationFail_whenRegisteringAccountWithEMMail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenSendActivationCodeFail_thenErrorIsPropagated[jvm]
…
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGeTrustAnchorsApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenAValid_whenSendingAMessage_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenDeletedUsersError_whenSendingAMessage_TheCorrectErrorIsPropagate[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenMissingUsersError_whenSendingAMessage_TheCorrectErrorIsPropagate[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenRedundantUsersError_whenSendingAMessage_TheCorrectErrorIsPropagate[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenActivationEmailWIthCode_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenRegisteringAccountWithEMail_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenSendingActivationEmail_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenActivationCodeFail_thenErrorIsPropagated[iosX64]
…

♻️ This comment has been updated with latest results.

@MohamadJaara MohamadJaara added this pull request to the merge queue Mar 13, 2024
@datadog-wireapp
Copy link

Datadog Report

All test runs c1a0591 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Test Service View
kalium-ios 0 0 0 2282 51 6m 8.14s Link
kalium-jvm 0 0 0 2861 121 9m 25s Link

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 27.83505% with 70 lines in your changes are missing coverage. Please review.

Project coverage is 58.69%. Comparing base (dea98f1) to head (26d09f7).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2639      +/-   ##
=============================================
- Coverage      58.75%   58.69%   -0.07%     
  Complexity         7        7              
=============================================
  Files           1188     1188              
  Lines          46090    46146      +56     
  Branches        4348     4366      +18     
=============================================
+ Hits           27080    27084       +4     
- Misses         17069    17118      +49     
- Partials        1941     1944       +3     
Files Coverage Δ
.../com/wire/kalium/logic/data/e2ei/E2EIRepository.kt 78.43% <50.00%> (-0.50%) ⬇️
...lium/network/api/base/unbound/acme/ACMEResponse.kt 41.79% <31.70%> (-21.63%) ⬇️
...re/kalium/network/api/base/unbound/acme/ACMEApi.kt 24.19% <24.07%> (-6.66%) ⬇️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dea98f1...26d09f7. Read the comment docs.

Merged via the queue into develop with commit 5e383bc Mar 13, 2024
17 checks passed
@MohamadJaara MohamadJaara deleted the refactor/acme-api-called-with-blank-URL-cherry-pick branch March 13, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants