Open Olf0 opened 2 years ago
No, I would avoid scraping. We are using GitLab GraphGL API. If there is a call to get "Pretty name" we can use it, if there is none then we better skip pretty name. There is a fallback anyway as it can be specified in Chum section of the SPEC.
We are using GitLab GraphGL API. If there is a call to get "Pretty name" we can use it, […]
I assumed there is none, because retrieving the pretty name via API was not implemented for GitLab, in contrast to GitHub. For sure using a defined API is always better than "web-page scraping".
No, I would avoid scraping.
Well, that was what point 2c of PR https://github.com/sailfishos-chum/main/pull/80 was all about, due to my "jumping to conclusions".
In my mind it was about parsing URL :)
\<rinigus> 2c: We can consider doing it, indeed.
But sure, even the login-name is better than nothing as a fall-back.
From the discussion for PR #80, point 2c:
For obtaining a name at GitLab, as a fallback the URL might be parsed, though this provides the login name, not the pretty name, see, e.g.: https://gitlab.com/Olf0/sailfishX Although the pretty name can be extracted as the first string on a GitLab user page proper (when ignoring GitLab's top menu bar), see, e.g.: https://gitlab.com/Olf0
Note that I believe to remember that the pretty name can be left empty: IMO it makes sense to use the login name as a fallback, then.
As discussed for points 2a & 2b (not yet concluded), it might make sense to query the ultimately determined source code repository (out of
{m_repo_url, m_url}
) for the developer's name and them_packaging_repo_url
for the packager's name.Side note: In general I do not like web-page "scraping", because web-pages are often altered. But in this case, I believe that the pretty name will very likely always be right below the avatar picture, so this is a sustainable solution.