Page MenuHomePhabricator

[maintain-harbor] Errors when parsing tool names
Closed, ResolvedPublic

Description

It seems we are getting some errors that we should not (I think):

2023-06-05T08:23:46Z - ERROR - tools - Failed to convert tool name ru_monuments to harbor project name. Reason: Tool name ru_monuments is not a valid toolforge tool name.. skipping
2023-06-05T08:23:46Z - ERROR - tools - Failed to convert tool name wdq_checker to harbor project name. Reason: Tool name wdq_checker is not a valid toolforge tool name.. skipping
2023-06-05T08:23:46Z - ERROR - tools - Failed to convert tool name articles-by-lat-lon-without-images to harbor project name. Reason: Tool name articles-by-lat-lon-without-images is not a valid toolforge tool name.. skipping
2023-06-05T08:23:46Z - ERROR - tools - Failed to convert tool name wikidata-redirects-conflicts-reports to harbor project name. Reason: Tool name wikidata-redirects-conflicts-reports is not a valid toolforge tool name.. skipping
2023-06-05T08:27:32Z - ERROR - toolsbeta - Failed to convert tool name toolsbeta.test5 to harbor project name. Reason: Tool name toolsbeta.test5 is not a valid toolforge tool name.. skipping

Those should be valid toolforge tool names, but for some reason it detects them as invalid.

Event Timeline

This is probably a bug in the regexes we use to validate the names... regexes are tricky xd

The regex is:

TOOLFORGE_NAME_REGEX = re.compile(r"^[a-z]([-a-z0-9]{0,30}[a-z0-9])?$")

Current issues above:

  • ru_monuments -> has _
  • wdq_checker -> has _
  • articles-by-lat-lon-without-images -> >30 chars
  • wikidata-redirects-conflicts-reports -> >30 chars
  • toolsbeta.test5 -> it's not removing the prefix correctly (toolsbeta.)

Current issues above:

  • ru_monuments -> has _
  • wdq_checker -> has _

These tools don't have Kubernetes namespaces either, we can ignore those. (T176027)

  • articles-by-lat-lon-without-images -> >30 chars
  • wikidata-redirects-conflicts-reports -> >30 chars

Where does the limit of 30 come from?

Current issues above:

  • ru_monuments -> has _
  • wdq_checker -> has _

These tools don't have Kubernetes namespaces either, we can ignore those. (T176027)

  • articles-by-lat-lon-without-images -> >30 chars
  • wikidata-redirects-conflicts-reports -> >30 chars

Where does the limit of 30 come from?

It came from admin.toolforge.org, the form does not allow more than 32 (https://gitlab.wikimedia.org/repos/cloud/toolforge/maintain-harbor/-/merge_requests/11#note_39872)