-
Notifications
You must be signed in to change notification settings - Fork 113
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
Ocdav improvements #2658
Ocdav improvements #2658
Conversation
@butonic, do you see any reason not to change the If there is no reason against it, we would need to update the acceptance tests |
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.
Great one!
One question: Some functions are named with a "New"-Prefix, for example NewNotFoundNS
. For me, the word New indicates that there happens an mem allocation but the functions are returning by value, right?
Is there any reason for the "New"-Prefix? For me, just not having it would be fully sufficient, in the example case that would just be props.NotFoundNS
.
In Go the |
6eacd1d
to
86b228c
Compare
ocis-integration-tests failed at: 7505 | apiWebdavProperties2/getFileProperties.feature:47
7506 | apiWebdavProperties2/getFileProperties.feature:50
7507 | apiWebdavProperties2/getFileProperties.feature:51
7508 | apiWebdavProperties2/getFileProperties.feature:54
7509 | apiWebdavProperties2/getFileProperties.feature:59
7510 | apiWebdavProperties2/getFileProperties.feature:62
7511 | apiWebdavProperties2/getFileProperties.feature:79
7512 | apiWebdavProperties2/getFileProperties.feature:80
7513 | apiWebdavProperties2/getFileProperties.feature:83
7514 | apiWebdavProperties2/getFileProperties.feature:86
7515 | apiWebdavProperties2/getFileProperties.feature:87
7516 | apiWebdavProperties2/getFileProperties.feature:90
7517 | apiWebdavProperties2/getFileProperties.feature:97
7518 | apiWebdavProperties2/getFileProperties.feature:98
7519 | apiWebdavProperties2/getFileProperties.feature:101 failing about d:href @issue-ocis-reva-214
--
4713 | Scenario Outline: Do a PROPFIND of various file names # /drone/src/tmp/testrunner/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature:38
4714 | Given using <dav_version> DAV path # FeatureContext::usingOldOrNewDavPath()
4715 | And user "Alice" has uploaded file with content "uploaded content" to "<file_name>" # FeatureContext::userHasUploadedAFileWithContentTo()
4716 | When user "Alice" gets the properties of file "<file_name>" using the WebDAV API # WebDavPropertiesContext::userGetsThePropertiesOfFolder()
4717 | Then the HTTP status code should be "201" # FeatureContext::thenTheHTTPStatusCodeShouldBe()
4718 | And the properties response should contain an etag # WebDavPropertiesContext::thePropertiesResponseShouldContainAnEtag()
4719 | And the value of the item "//d:response/d:href" in the response to user "Alice" should match "/<expected_href>/" # WebDavPropertiesContext::assertValueOfItemInResponseToUserRegExp()
4720 |
4721 | Examples:
4722 | \| dav_version \| file_name \| expected_href \|
4723 | \| old \| /C++ file.cpp \| remote\.php\/webdav\/C%2[bB]%2[bB]%20file\.cpp \|
4724 | item "//d:response/d:href" found with value "/remote.php/webdav/C++%20file.cpp", expected to match regex pattern: "/remote\.php\/webdav\/C%2[bB]%2[bB]%20file\.cpp/"
4725 | Failed asserting that '/remote.php/webdav/C++%20file.cpp' matches PCRE pattern "/remote\.php\/webdav\/C%2[bB]%2[bB]%20file\.cpp/".
4726 | \| old \| /file #2.txt \| remote\.php\/webdav\/file%20%232\.txt \|
4727 | \| old \| /file ?2.txt \| remote\.php\/webdav\/file%20%3[fF]2\.txt \|
4728 | \| old \| /file &2.txt \| remote\.php\/webdav\/file%20%262\.txt \|
4729 | item "//d:response/d:href" found with value "/remote.php/webdav/file%20&2.txt", expected to match regex pattern: "/remote\.php\/webdav\/file%20%262\.txt/"
4730 | Failed asserting that '/remote.php/webdav/file%20&2.txt' matches PCRE pattern "/remote\.php\/webdav\/file%20%262\.txt/".
4731 | \| new \| /C++ file.cpp \| remote\.php\/dav\/files\/%username%\/C%2[bB]%2[bB]%20file\.cpp \|
4732 | item "//d:response/d:href" found with value "/remote.php/dav/files/Alice/C++%20file.cpp", expected to match regex pattern: "/remote\.php\/dav\/files\/Alice\/C%2[bB]%2[bB]%20file\.cpp/"
4733 | Failed asserting that '/remote.php/dav/files/Alice/C++%20file.cpp' matches PCRE pattern "/remote\.php\/dav\/files\/Alice\/C%2[bB]%2[bB]%20file\.cpp/".
4734 | \| new \| /file #2.txt \| remote\.php\/dav\/files\/%username%\/file%20%232\.txt \|
4735 | \| new \| /file ?2.txt \| remote\.php\/dav\/files\/%username%\/file%20%3[fF]2\.txt \|
4736 | \| new \| /file &2.txt \| remote\.php\/dav\/files\/%username%\/file%20%262\.txt \|
4737 | item "//d:response/d:href" found with value "/remote.php/dav/files/Alice/file%20&2.txt", expected to match regex pattern: "/remote\.php\/dav\/files\/Alice\/file%20%262\.txt/"
4738 | Failed asserting that '/remote.php/dav/files/Alice/file%20&2.txt' matches PCRE pattern "/remote\.php\/dav\/files\/Alice\/file%20%262\.txt/".
4739 | \| spaces \| /C++ file.cpp \| dav\/spaces\/%spaceid%\/C%2[bB]%2[bB]%20file\.cpp \|
4740 | item "//d:response/d:href" found with value "/dav/spaces/5cfaabcc-3fa5-103c-96cf-773576e2cf3c/C++%20file.cpp", expected to match regex pattern: "/dav\/spaces\/5cfaabcc\-3fa5\-103c\-96cf\-773576e2cf3c\/C%2[bB]%2[bB]%20file\.cpp/"
4741 | Failed asserting that '/dav/spaces/5cfaabcc-3fa5-103c-96cf-773576e2cf3c/C++%20file.cpp' matches PCRE pattern "/dav\/spaces\/5cfaabcc\-3fa5\-103c\-96cf\-773576e2cf3c\/C%2[bB]%2[bB]%20file\.cpp/".
4742 | \| spaces \| /file #2.txt \| dav\/spaces\/%spaceid%\/file%20%232\.txt \|
4743 | \| spaces \| /file ?2.txt \| dav\/spaces\/%spaceid%\/file%20%3[fF]2\.txt \|
4744 | \| spaces \| /file &2.txt \| dav\/spaces\/%spaceid%\/file%20%262\.txt \|
4745 | item "//d:response/d:href" found with value "/dav/spaces/5e7d54f4-3fa5-103c-96d8-773576e2cf3c/file%20&2.txt", expected to match regex pattern: "/dav\/spaces\/5e7d54f4\-3fa5\-103c\-96d8\-773576e2cf3c\/file%20%262\.txt/"
4746 | Failed asserting that '/dav/spaces/5e7d54f4-3fa5-103c-96d8-773576e2cf3c/file%20&2.txt' matches PCRE pattern "/dav\/spaces\/5e7d54f4\-3fa5\-103c\-96d8\-773576e2cf3c\/file%20%262\.txt/". |
I will look and find more about the test failures. |
Yeah the href fails because the encoding changed a bit. But both the old and the new encoding are valid URL encodings. Take |
Sure, I can make a PR for that. 👍 |
When putting static values in propstat properties we can skip the xml encoding when we know that there are no reserved characters. Same for 'not found' properties.
The results of the old code were a bit different but this version is still compliant to the webdav rfc: https://datatracker.ietf.org/doc/html/rfc4918#section-8.3.1. It is also a whole lot faster.
b278e3d
to
7b080c6
Compare
hmm..dav paths do not have remote.php, so failing again https://drone.cernbox.cern.ch/cs3org/reva/6431/15/6
I'll update the core PR 🚀 |
I've updated the related core PR. Latest commit |
7b080c6
to
2ce4280
Compare
.drone.env
Outdated
CORE_COMMITID=e285879a8a79e692497937ebf340bc6b9c925b4f | ||
CORE_BRANCH=master | ||
CORE_COMMITID=589c426d801d9f176a8c7c395714afb06f116445 | ||
CORE_BRANCH=assert-entry-href-after-decode |
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.
#39947 is merged, please change back to master with the latest commit
2ce4280
to
e8882b5
Compare
Cleaned up the ocdav code to make it more readable and in one case a bit faster.