Skip to content

Add jh testcase format in metadata check job

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

JH QA team noticed that the newly added qa:metadata-lint job in main-jh is failing. Job link.

After analyzing, we found:

  1. The TESTCASE_FORMAT regex only supports the GitLab URL pattern: https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/\d+.
  2. The JH test case URL follow the pattern: https://jihulab.com/gitlab-cn/quality/testcases/-/quality/test_cases/\d+.

Due to this, the qa:metadata-lint job fails as it cannot recognize the JH test case URL. Code:

TESTCASE_FORMAT = %r{https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/\d+}

    unless TESTCASE_FORMAT =~ test['testcase']
      testcase_format_errors.push(
        <<~FORMAT_ERRORS
           ==> #{test['testcase']} in file: #{test['id']} with title:
               #{test['full_description']}
        FORMAT_ERRORS
      )
    end

To resolve this issue, I have updated the TESTCASE_FORMAT to include the JH test case URL pattern:

TESTCASE_FORMAT = %r{
  (https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/\d+)|
  (https://jihulab.com/gitlab-cn/quality/testcases/-/quality/test_cases/\d+)
}x

So, I am creating this MR to append the JH test case URL pattern to the TESTCASE_FORMAT. This change will not affect the upstream code but will ensure that the qa:metadata-lint job can successfully parse the JH URLs and pass.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Wei Duan

Merge request reports

Loading