Home / Companies / GitLab / Blog / Post Details
Content Deep Dive

How we automatically fixed thousands of Ruby 2.7 deprecation warnings

Blog post from GitLab

Post Details
Company
Date Published
Author
Thong Kuah
Word Count
645
Company Posts That Month
24
Language
English
Hacker News Points
-
Post removed?
No
Summary

Ruby 3.0 introduced changes separating positional and keyword arguments, and in preparation for this, GitLab aimed to upgrade from Ruby 2.6 to 2.7, encountering thousands of warnings due to deprecated syntax. To address these, GitLab initially applied a manual fix, adding '**' to last keyword arguments, and developed a RuboCop check to automate the detection and correction of these warnings. After researching, they utilized the Deprecation Toolkit gem, integrated with their RSpec test suite, to log and manage deprecation warnings efficiently. A new RuboCop check, Lint/LastKeywordArgument, was created to work with the generated YAML files, allowing them to automatically correct the codebase and significantly reduce the number of warnings. This process was further automated by integrating into GitLab CI pipelines, resulting in a reduction from 30,000 warnings to around 800, primarily due to dependencies. GitLab continues to address the remaining warnings and invites contributions to resolve them fully.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.