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-178: Use a uniq ID for the S3 direct upload key #190

Merged
merged 2 commits into from
Aug 24, 2020

Conversation

BoboTiG
Copy link
Contributor

@BoboTiG BoboTiG commented Aug 24, 2020

Before the patch, the key was computed using the blob name.
And it would fail if the name contains disallowed characters like parenthesis:

HTTPError(400), error: 'java.lang.IllegalArgumentException: Invalid key: file (1).bin'

So the new code now uses a UUID.

@BoboTiG BoboTiG added the bug label Aug 24, 2020
@nuxeojenkins
Copy link

View issues in JIRA:

  • NXPY-178: Use a uniq ID for the S3 direct upload key
  • NXPY-177: Prevent AttributeError when fetching the server version and the response is bad

Mickaël Schoentgen added 2 commits August 24, 2020 14:09
Before the patch, the key was computed using the blob name.
And it would fail if the name contains disallowed
characters like parenthesis:

    HTTPError(400), error: 'java.lang.IllegalArgumentException: Invalid key: file (1).bin'

So the new code now uses a UUID.
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 24, 2020

Sourcery Code Quality Report (beta)

❌  Merging this PR will decrease code quality in the affected files by 0.01 out of 10.

Quality metrics Before After Change
Complexity 1.01 1.02 0.01 🔴
Method Length 34.29 34.62 0.33 🔴
Quality 9.10 9.09 -0.01 🔴
Other metrics Before After Change
Lines 1901 1923 22
Changed files Quality Before Quality After Quality Change
nuxeo/client.py 8.48 8.48 0.00
nuxeo/models.py 9.53 9.53 0.00
nuxeo/uploads.py 8.57 8.54 -0.03 🔴
nuxeo/handlers/s3.py 8.30 8.29 -0.01 🔴
tests/test_upload_s3.py 8.86 8.84 -0.02 🔴

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

File Function Complexity Length Overall Recommendation
nuxeo/client.py NuxeoClient.request 13 254.67 4.46 Split out functionality
nuxeo/handlers/s3.py ChunkUploaderS3.iter_upload 7 165.92 5.90 Split out functionality
tests/test_upload_s3.py test_upload_chunked_resume 3 191.74 5.98 Split out functionality
nuxeo/client.py NuxeoClient.__init__ 2 144.79 6.70 Split out functionality

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 BoboTiG merged commit afdf3ad into master Aug 24, 2020
@BoboTiG BoboTiG deleted the fix-NXPY-178-s3-key branch August 24, 2020 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants