Closed lexming closed 3 years ago
@lexming Tests are failing in Jenkins with:
$ pip3 install --ignore-installed --user tox
...
PermissionError: [Errno 13] Permission denied: '/var/lib/jenkins/.local/lib'
script returned exit code 2
That's because Jenkins is using the Jenkinsfile
from current master
rather than the one updated in the PR, because you're not a member of the team that has write access to this repo (so you're on "untrusted" contributor)... :-/
@lexming Can we cover this change in test/rest.py
?
Hold on this a moment, this fixes the issues but it might be for the wrong reasons.
One issue in the VSC rest API has been already solved and another one is in the hands of vsc-tech
. So we can proceed with this PR, the fix here still applies and the domain and path of the URL have to be URL encoded because there are entities in the data base with white spaces in their names (and potentially any other non-conformant character with URLs).
@boegel I thought about a way to test this, but it is not trivial. Current tests use the rest API of github, but the problem there is that there are no entries in github encoded with the standard %
codes. It replaces everything in the URL with dashes. So creating a specific wiki page named "Test rest API", will be converted to "test-rest-api". Using the VSC account page is probably out of the table due to the authentication requirements. Do you have any other idea?
@lexming use mock?
This issue will be solved in the interface of the VSC account page by not allowing non-conformant group names. Therefore, this PR is not needed.
This PR adds URL encoding of the domain and path of URLs passed to the rest api. Currently, it only URL encodes the query string of URLs. However, it is possible that the rest client receives non conformant URLs and those should be encoded as well to avoid unnecessary exceptions from
urllib
.Specifically, this is an issue with group names in the VSC account page that have white spaces, for instance leuvenall-fluent group, as those names can be part of the path of URLs. The tool
sync_django_ldap
fromvsc-administration
fails to complete the LDAP sync due to this issue.