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

NXPY-199: Add support for idempotent calls #214

Merged
merged 2 commits into from
Feb 1, 2021

Conversation

BoboTiG
Copy link
Contributor

@BoboTiG BoboTiG commented Feb 1, 2021

Introduced:

  • OngoingRequestError and Conflict exceptions.
  • IDEMPOTENCY_KEY constant.

@nuxeojenkins
Copy link

View issue in JIRA: NXPY-199: Introduce OngoingRequestError and Conflict exceptions

@BoboTiG BoboTiG changed the title NXPY-199: Introduce OngoingRequestError and Conflict exceptions NXPY-199: Add support for idempotent calls Feb 1, 2021
@BoboTiG BoboTiG force-pushed the feat-NXPY-199-conflict-error branch from 65f881d to 1e54447 Compare February 1, 2021 17:18
Introduced:

- `OngoingRequestError` and `Conflict` exceptions.
- `IDEMPOTENCY_KEY` constant.
@BoboTiG BoboTiG force-pushed the feat-NXPY-199-conflict-error branch from 1e54447 to 416649e Compare February 1, 2021 17:20
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 1, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.62%.

Quality metrics Before After Change
Complexity 2.29 ⭐ 2.39 ⭐ 0.10 👎
Method Length 54.60 ⭐ 55.05 ⭐ 0.45 👎
Working memory 8.92 🙂 8.94 🙂 0.02 👎
Quality 70.52% 🙂 69.90% 🙂 -0.62% 👎
Other metrics Before After Change
Lines 1234 1367 133
Changed files Quality Before Quality After Quality Change
nuxeo/client.py 62.60% 🙂 62.95% 🙂 0.35% 👍
nuxeo/constants.py 79.63% ⭐ 79.20% ⭐ -0.43% 👎
nuxeo/exceptions.py 91.73% ⭐ 92.32% ⭐ 0.59% 👍
tests/test_batchupload.py 68.23% 🙂 66.24% 🙂 -1.99% 👎
tests/test_exception.py 95.21% ⭐ 95.84% ⭐ 0.63% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
nuxeo/client.py NuxeoClient.request 13 🙂 255 ⛔ 17 ⛔ 32.66% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_batchupload.py test_upload_several_callbacks 5 ⭐ 262 ⛔ 13 😞 44.53% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_batchupload.py test_idempotent_requests 5 ⭐ 266 ⛔ 12 😞 45.92% 😞 Try splitting into smaller methods. Extract out complex expressions
nuxeo/client.py NuxeoClient._log_response 10 🙂 125 😞 15 😞 48.18% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_batchupload.py test_upload 4 ⭐ 238 ⛔ 11 😞 50.04% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@BoboTiG
Copy link
Contributor Author

BoboTiG commented Feb 1, 2021

Tests are failing because the server does not contain the work done on NXP-30081.

@BoboTiG BoboTiG merged commit f71971a into master Feb 1, 2021
@BoboTiG BoboTiG deleted the feat-NXPY-199-conflict-error branch February 1, 2021 17:30
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.

None yet

2 participants