When fetching the Thunderdome battle plans, the script processes a link to the GitLab issue and tries to get information about it from the GitLab API. The link is matched against a regular expression to 1) make sure that the link is a valid GitLab link and 2) extract the project ID from the link for the API lookup.
The current issue with this regex is that it doesn't account for the existence of subgroups. Thus, any issues that are part of a project in a subgroup will fail to validate, even if they are valid GitLab links. For example, this link wouldn't work:
The subgroup papers is not accounted for by the regex.
How to Reproduce
Create a new Thunderdome battle
Add a new item with a link to an issue in a project in a subgroup.
Run the script with the fetch command using the created battle as the source
Observe that issue validation fails with a message like this:
Skipping plan Test: Invalid URL 'https://gitlab.gnome.org/GNOME/Incubator/papers/-/issues/261' does not match GitLab URL pattern 'https:\/\/gitlab\.com\/(?P<orga>[a-zA-Z0-9\-\_]+)\/(?P<project>[a-zA-Z0-9\-\_]+)\/-\/issues\/(?P<issue>[0-9]+)'
Expected behaviour
Link to GitLab Issues from projects in subgroups can be matched with the regex.
Potential Fix
Amend the regex with a pattern for subgroups, e.g. ((?P<subgroup>[a-zA-Z0-9\-\_]+)\/)*
Description
When fetching the Thunderdome battle plans, the script processes a link to the GitLab issue and tries to get information about it from the GitLab API. The link is matched against a regular expression to 1) make sure that the link is a valid GitLab link and 2) extract the project ID from the link for the API lookup.
https://github.com/heinezen/thunderdome-api/blob/12d78d59c33e40110ff7b22bd0d345453c3a9400/main.py#L32-L35
The current issue with this regex is that it doesn't account for the existence of subgroups. Thus, any issues that are part of a project in a subgroup will fail to validate, even if they are valid GitLab links. For example, this link wouldn't work:
https://gitlab.gnome.org/GNOME/Incubator/papers/-/issues/261
The subgroup
papers
is not accounted for by the regex.How to Reproduce
fetch
command using the created battle as the sourceExpected behaviour
Link to GitLab Issues from projects in subgroups can be matched with the regex.
Potential Fix
Amend the regex with a pattern for subgroups, e.g.
((?P<subgroup>[a-zA-Z0-9\-\_]+)\/)*