Skip to content

Extend ref extraction logic to support SHA256 commits

Vasilii Iakliushin requested to merge 419905_fix_ref_extraction_for_sha256 into master

What does this MR do and why?

Contributes to #419905 (closed)

Problem

The regular expression used for commit hash detection supports only SHA1 format.

Solution

Adjust the regular expression to capture SHA256 commits too.

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
Screenshot_2023-07-27_at_10.56.08 image

How to set up and validate locally

  1. Enable feature flag Feature.enable(:support_sha256_repositories)
  2. Create a new project in SHA256 format

Screenshot_2024-02-14_at_16.08.44

  1. Go to the new project page
  2. Copy the last commit id
  3. Insert this id into path like http://gdk.test:3000/root/<project_name>/-/commits/<commit_id>
  4. You should see a 404 page
  5. Enable the feature flag Feature.enable(:ref_extract_sha256)
  6. The page should load
Edited by Vasilii Iakliushin

Merge request reports

Loading