Page MenuHomePhabricator

Sort out a process to add new Gerrit repositories to wikimedia.biterg.io Git indexing
Closed, ResolvedPublic

Description

...as I am afraid that this does not happen automagically. In any case, needs documentation.

This is about the "git" section in https://gitlab.com/Bitergia/c/Wikimedia/sources/raw/master/projects.json for entries that start with https://gerrit.wikimedia.org/.

Similar to T218528.

Event Timeline

Aklapper created this task.
Aklapper updated the task description. (Show Details)
Aklapper renamed this task from Sort out a process to add new Gerrit repositories to wikimedia.biterg.io indexing to Sort out a process to add new Gerrit repositories to wikimedia.biterg.io Git indexing.Mar 17 2019, 11:47 PM
Aklapper updated the task description. (Show Details)
Aklapper lowered the priority of this task from Low to Lowest.Mar 20 2019, 11:21 AM
Aklapper moved this task from To triage to Apr-Jun 2019 on the Developer-Advocacy board.
Aklapper raised the priority of this task from Lowest to Low.EditedMar 27 2019, 2:57 PM
#!/bin/bash
# Find new Wikimedia Gerrit repositories to add to indexing in wikimedia.biterg.io
# https://phabricator.wikimedia.org/T218519
# Licensed under CC0 1.0 Universal - https://creativecommons.org/publicdomain/zero/1.0/deed.en

ssh -l yourGerritUsername -p 29418 gerrit.wikimedia.org gerrit ls-projects | sort > gerritrepos.txt
curl -s https://gitlab.com/Bitergia/c/Wikimedia/sources/raw/master/projects.json | jq -r '.Wikimedia.git[]' | grep "https://gerrit-replica.wikimedia.org/r/" | cut -c 40- | sort > bitergiarepos.txt
echo "=== New Gerrit repos to add to Bitergia:"
comm -23 gerritrepos.txt bitergiarepos.txt
echo "=== Repos not present anymore in Gerrit:"
comm -23 bitergiarepos.txt gerritrepos.txt
rm bitergiarepos.txt gerritrepos.txt
echo "=== Now go and update https://gitlab.com/Bitergia/c/Wikimedia/sources/blob/master/projects.json !"

Updated script due to T234328 and https://gitlab.com/Bitergia/c/Wikimedia/support/issues/69 :

#!/bin/bash
# Find new Gerrit repositories to add to indexing in wikimedia.biterg.io
# https://phabricator.wikimedia.org/T218519

ssh -l aklapper -p 29418 gerrit.wikimedia.org gerrit ls-projects | sort > gerritrepos.txt
curl -s https://gitlab.com/Bitergia/c/Wikimedia/sources/raw/master/projects.json | jq -r '.Wikimedia.git[]' | grep "https://gerrit-replica.wikimedia.org/r/" | cut -c 40- | sort > bitergiarepos.txt
echo "=== New Gerrit repos to add to Bitergia:"
comm -23 gerritrepos.txt bitergiarepos.txt
echo "=== Repos not present anymore in Gerrit:"
comm -23 bitergiarepos.txt gerritrepos.txt
rm bitergiarepos.txt gerritrepos.txt
echo "=== Now go and update https://gitlab.com/Bitergia/c/Wikimedia/sources/blob/master/projects.json !"