Docs: https://we.phorge.it/book/phorge/article/diffusion_uris/#reference-i-o-types
URI stats (note that the number of repos is lower, and that this query ignores the active/disabled state of the repo itself):
```
mysql:phstats@m3-slave.eqiad.wmnet [phabricator_maniphest]> SELECT COUNT(u.id), u.ioType FROM phabricator_repository.repository_uri u WHERE u.isDisabled = 0 GROUP BY u.ioType;
+-------------+-----------+
| COUNT(u.id) | ioType |
+-------------+-----------+
| 1970 | default |
| 74 | mirror |
| 366 | none |
| 2846 | observe |
| 18026 | read |
| 8 | readwrite |
+-------------+-----------+
```
Per `SELECT CONCAT("https://phabricator.wikimedia.org/diffusion/", r.id, "/manage/uris/"), r.name, u.uri FROM phabricator_repository.repository_uri u INNER JOIN phabricator_repository.repository r ON r.phid = u.repositoryPHID WHERE u.ioType = "mirror" AND u.isDisabled = 0 AND r.details NOT LIKE "%\"importing\":false%" ORDER BY u.uri;` we mirror (up to) 74 repos from Diffusion to other places:
* 3 times to Gerrit (1913, 1334, 2341, all with broken URL schemes),
* 4 times to Gerrit via `ssh://phab@gerrit.wikimedia.org:29418` (2668, 1914, 2047, 1912),
* 1 time to personal GitLab
* 4 times to personal GitHub (2311, 2310, 2761, 2579),
* the rest is all to GitHub under `toolforge` or `wikimedia`.
** Some of these GitHub repos might be read-only so trying to mirror should fail (e.g. `malu` in [1876](https://phabricator.wikimedia.org/source/malu/manage/), likely more).
** Some of these GitHub repos have been deleted so trying to mirror should fail (e.g. [1972](https://phabricator.wikimedia.org/diffusion/1972/manage/uris/), likely more)?
** Some repos like [1876](https://phabricator.wikimedia.org/source/malu/manage/) are "disabled" already in Diffusion so does Diffusion still try to push a mirror out then? Do I need to fix the SQL queries above to also take that in consideration by adding `AND r.details NOT LIKE "%\"importing\":false%"` ? This reduces the `mirror` number from 74 down to 30: 29 being mirrored to github.com/wikimedia/* and 1 being https://phabricator.wikimedia.org/diffusion/PHES/manage/uris/
** https://phabricator.wikimedia.org/diffusion/PHES/manage/uris/ states it mirrors to Gerrit but that repo is marked as inactive, where to find that info in the Phabricator database?
==== Incomplete list of some action items: ====
[ ] We mirror https://phabricator.wikimedia.org/source/tool-my-first-flask-oauth-tool/manage/uris/ both to https://github.com/toolforge/my-first-flask-oauth-tool.git and https://github.com/wikimedia/tool-my-first-flask-oauth-tool - can the later URI and GitHub repo be deleted?
[ ] @Mbch331: We try to mirror to Mbch331's personal GitLab from https://phabricator.wikimedia.org/source/tool-ddescriptions/manage/uris/ (credentials in K24) with a target which does not exist anymore according to https://gitlab.com/users/mbch331/projects - Should this URI be deleted?
[ ] @Urbanecm: We try mirror to Urbanecm's personal GitHub in [2310](https://phabricator.wikimedia.org/diffusion/2310/manage/uris/) and [2311](https://phabricator.wikimedia.org/diffusion/2311/manage/uris/). Both use destroyed K25, so I'd say these URIs should be deleted or disabled?
[ ] Among the mirrors to personal GitHub, [2761](https://phabricator.wikimedia.org/diffusion/2761/manage/uris/) and [2579](https://phabricator.wikimedia.org/diffusion/2579/manage/uris/) are supposed to mirror to Github but have no credentials configured so I'd say that's broken anyway - we should disable (or delete) these URIs.
[x] Side note: File https://github.com/WikiMovimentoBrasil/povoconta/issues/2 about [2761](https://phabricator.wikimedia.org/diffusion/2761/manage/uris/) using two code repo places now out of sync