NFDI4Energy / SMECS

Software Metadata Extraction and Curation Software (SMECS)
GNU Affero General Public License v3.0
2 stars 0 forks source link

GitLab URLs not starting with "gitlab" are invalid #95

Closed zyzzyxdonta closed 4 months ago

zyzzyxdonta commented 4 months ago

Many institutional GitLab instances will cause an "Invalid URL" error in SMECS as their domain names do not start with "gitlab". I ran into this with https://codebase.helmholtz.cloud/heliport/heliport.

https://github.com/NFDI4Energy/SMECS/blob/f929cc6a55ba1fdacc5006033b4c8275ff9fc0a8/meta_creator/url_check_GitLab.py#L22

Aidajafarbigloo commented 4 months ago

Hello @zyzzyxdonta

Thank you for letting us know about the issue. Some changes have been made. Please try the URL again and tell us if you spot any problems. Your feedback is greatly appreciated.

zyzzyxdonta commented 4 months ago

Hi @Aidajafarbigloo,

with the new code, it does indeed work. 👍🏻 However, I'm not quite sure if the check is even necessary. The same could be done with one of Django's validators:

from django.core.validators import URLValidator
validate = URLValidator(schemes=["http", "https"])
validate(url)
Aidajafarbigloo commented 4 months ago

@zyzzyxdonta

Yes, got your point, and you're right. However, it's useful to know which repository the entered URL is for later on. Then we close this issue.