in addition to @Xunnamius package. you may use the dbconsole
if your are feeling brave and want to check and update just the labels that are off in color or case. Also, I deleted only the labels that did not exist in the admin labels, and then ren teh gitlab-fix-labels ... add all
to add the missing labels to all our projects.
sudo gitlab-rails dbconsole
select t.title as template_title, t.color as template_color
from labels as t
where t.template='t'
ORDER BY template_title;
select p.title, t.title as template_title, p.color, t.color as template_color
from labels as t INNER JOIN labels as p ON 1=1
where p.title ILIKE t.title AND t.template='t' AND p.template='f'
AND ( t.title != p.title OR t.color NOT ILIKE p.color )
ORDER BY template_title;
UPDATE labels AS p
SET title = t.title, color = t.color
from labels as t
where p.title ILIKE t.title AND t.template='t' AND p.template='f'
AND ( t.title != p.title OR t.color NOT ILIKE p.color );
select p.title
from labels p
where p.template='f' AND p.title NOT IN (
select t.title from labels as t where t.template='t'
);
select title
from labels as p
where p.template='f' AND p.title NOT IN (
select t.title from labels as t where t.template='t'
) AND p.id NOT IN (
select label_id from label_links
);
delete
from labels as p
where p.template='f' AND p.title NOT IN (
select t.title from labels as t where t.template='t'
) AND p.id NOT IN (
select label_id from label_links
);
https://www.npmjs.com/package/gitlab-fix-labels
npm install -g gitlab-fix-labels
# mac os x symlink...
ln -s /usr/local/bin/node /usr/local/bin/nodejs
# add labels...
gitlab-fix-labels https://git.ddd.net/api/v3/ ###################### add all