| Server IP : 188.151.22.197 / Your IP : 216.73.217.74 Web Server : Apache/2.4.62 (Rocky Linux) OpenSSL/3.5.5 System : Linux wsten.se 5.14.0-687.30.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 13:09:21 UTC 2026 x86_64 User : apache ( 48) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/gitlab/embedded/service/gitlab-rails/scripts/ |
Upload File : |
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'uri'
require 'net/http'
require 'yaml'
require 'json'
url = URI("https://gitlab.com/gitlab-com/www-gitlab-com/raw/master/data/stages.yml")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
stages_doc = YAML.safe_load(response.read_body)
feature_categories = stages_doc["stages"].values
.flat_map { |stage| stage["groups"].values }
.flat_map { |group| group.fetch("categories", []) + group.fetch("maintained_categories", []) }
.uniq
.sort
File.open("#{__dir__}/../config/feature_categories.yml", 'w') do |file|
file.puts(<<~HEADER_COMMENT)
#
# This file contains a list of all feature categories in GitLab
# It is generated from the stages file at #{url}.
# If you would like to update it, please run
# `./scripts/update-feature-categories` to generate a new copy
#
# PLEASE DO NOT EDIT THIS FILE MANUALLY.
#
HEADER_COMMENT
file.write(feature_categories.to_yaml)
end
File.open("#{__dir__}/../config/feature_categories/schema.json", 'w') do |file|
feature_categories_schema = {
'$schema': 'http://json-schema.org/draft-07/schema#',
type: 'string',
enum: feature_categories
}
file.puts JSON.pretty_generate(feature_categories_schema)
end