Increase the string limits for regex fields in push_rules
What does this MR do and why?
Contributes to #423445 (closed)
Problem
We have a discrepancy between GitLab database and db/structure.sql
.
GitLab database contains 255 character limit for regex fields. But this
limit is missing for self-hosted instances and GDK.
Solution
Recently we added a Rails validation to prevent regex longer than 511 characters (!128153 (merged)).
We can migrate existing columns to match this limit.
Potential problems
- The migration can fail on self-hosted instances that have push rules regex longer than 511 characters in database.
- It should be mitigated by Rails validations: !128153 (merged).
- It also rare for users to use such long regexes. The longest one of self-hosted customers used was around 440 characters.
Are there safer ways to migrate this data?
- I also migrated
branch_name_regex
andcommit_message_negative_regex
that don't have a limit in the production database. But they should follow the same limitation logic as other regex fields.
However, we can migrate them separately if it raises any concerns.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin