Skip to content

Fix 500 error when namespace path is a negative integer

Vasilii Iakliushin requested to merge 339606_fix_integer_validation into master

What does this MR do and why?

Problem

Negative integer is provided to PG lower function that does not support integers.

PG::UndefinedFunction: ERROR:  function lower(integer) does not exist

Solution

  • Adjust Regex to handle negative integers
  • Explicitly convert path to string type

How to set up and validate locally

#339606 (closed)

  1. Create a project fork with Rest API

curl -X POST -H "PRIVATE-TOKEN: _TOKEN_" "http://127.0.0.1:3000/api/v4/projects/1/fork?namespace_id=-1"

  1. You should not see a 500 error

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading