You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parse_resource in src/utils/url_validator.py still corrupts every labeled resource URL — the exact bug reported in #1325 (closed) was never actually fixed. The split marker ": http" is a prefix of ": https://", so splitting on it chops http off every https:// resource, leaving a broken s://... URL.
Split on the scheme token properly, e.g. find ": " and slice the URL starting at "http" (url = raw[idx+2:].lstrip() or regex r"^(.+?):\s*(https?://.*)$"), and add a regression test using a https:// label.
Related minor flaw in the same function: the marker is case-sensitive, so "Docs: HTTPS://example.com" isn't split at all and is treated as a bare URL.
Summary
parse_resourceinsrc/utils/url_validator.pystill corrupts every labeled resource URL — the exact bug reported in #1325 (closed) was never actually fixed. The split marker": http"is a prefix of": https://", so splitting on it chopshttpoff everyhttps://resource, leaving a brokens://...URL.Evidence
src/utils/url_validator.py:69-75:Verified by execution:
data/projects.jsoncontains ~100 labeled resources in the"Label: https://..."form, so all of them are corrupted:/api/project/<id>/resources(main_routes.py:315viavalidate_resources) flags them all as invalid.data_loader.validate_projectslogs spurious warnings for every one.tests/test_url_validator.py:123-127, 138-143, 202-206assert the correct output and therefore fail against the current code.Impact
s://...URL.url_validatoris failing.Suggested Fix
Split on the scheme token properly, e.g. find
": "and slice the URL starting at"http"(url = raw[idx+2:].lstrip()or regexr"^(.+?):\s*(https?://.*)$"), and add a regression test using ahttps://label.Related minor flaw in the same function: the marker is case-sensitive, so
"Docs: HTTPS://example.com"isn't split at all and is treated as a bare URL.