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

get_repo_by_url does not work always #5

Open
appukuttan-shailesh opened this issue Apr 19, 2021 · 1 comment
Open

get_repo_by_url does not work always #5

appukuttan-shailesh opened this issue Apr 19, 2021 · 1 comment

Comments

@appukuttan-shailesh
Copy link
Collaborator

For some collabs, get_repo_by_url appears to fail.
I have tested this for Collabs where I wasn't a member initially, and then later added as an admin. Failed in both cases.

Cause of failure:

get_repos_by_filter("owner", "collab-" + collab_name + "-administrator"
get_repos_by_filter("owner", "collab-" + collab_name + "-editor")
get_repos_by_filter("owner", "collab-" + collab_name + "-viewer")

all of these fail beause the "owner" field for these Collabs are simply "Organization".
I cannot find any other info in the Repo object whereby I can map it to the URL info.

Examples of Collabs where this was observed:
https://wiki.ebrains.eu/bin/view/Collabs/test-public-collab-ms/
https://wiki.ebrains.eu/bin/view/Collabs/nmc-collab-copy-template

Not sure how get_repo_by_url can be fixed, unless some new info is added to the returned object.

Current workaround:
Use the get_repos_by_name or get_repos_by_filter methods. E.g.
get_repos_by_name("Test public collab-ms")[0]
Note: the above can return multiple repos that match the same name (or other filters); hence return type is a list of Repo

@appukuttan-shailesh
Copy link
Collaborator Author

appukuttan-shailesh commented Apr 19, 2021

As example of currently available data for one of the failed collabs:

{'client': DriveApiClient[server=https://drive.ebrains.eu, user=USERNAME],
 'share_from_name': 'Collaboratory',
 'modifier_email': '[email protected]',
 'name': 'Test public collab-ms',
 'share_from': '[email protected]',
 'permission': 'r',
 'share_from_contact_email': '[email protected]',
 'size_formatted': '0\xa0bytes',
 'head_commit_id': '3a0e70b325017b83bf..............21689cc1426b4',
 'root': '',
 'mtime_relative': '<time datetime="2021-04-19T13:10:39" is="relative-time" title="Mon, 19 Apr 2021 13:10:39 +0000" >42 minutes ago</time>',
 'share_type': 'public',
 'encrypted': False,
 'version': 1,
 'mtime': 1618....2839,
 'owner': 'Organization',
 'modifier_contact_email': '[email protected]',
 'type': 'grepo',
 'id': '9600cd43-d31b-4968-9cf2-1e6389821182',
 'modifier_name': 'USERNAME',
 'size': 0}

No info to link it with collab url path (test-public-collab-ms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant