Verified Commit 7a694704 authored by anarcat's avatar anarcat 💥
Browse files

Revert "gitolite migration: evaluate repository age"

This is really too slow. It takes a few seconds for each round trip.

Instead I listed all the "Other" repos and shoved that in the
following loop:

for repo in anonbib censorship-timeline check chutney collector community/outreach curriculum erebus guardfraction debian/oonibackend debian/ooniprobe debian/txtorcon debian/tor debian/obfsproxy-legacy debian/obfsproxy debian/pt-websocket debian/flashproxy debian/meek debian/torproject-keyring depictor doctor exonerator fallback-scripts fuzzing-corpora githax https-everywhere metrics-base metrics-cloud metrics-lib metrics-tasks metrics-web nyx onionoo onionperf ooni-probe ooni/oonib ooni/reader ooni/spec ooni/web orbot orfoxos/b2g orfoxos/b2g-flash-tool orfoxos/b2g-manifest orfoxos/gaia orfoxos/gonk-misc orfoxos/gecko orfoxos/libevent orfoxos/openssl orfoxos/tor pluggable-transports/pyptlib pluggable-transports/httpsproxy privacy-docs pups support-portal support-tools stegotorus tech-reports testnet thandy tor-browser-bundle-testsuite tor-browser/user-manual tor-animation tor-blog tor-brochure tor-design-2012 tor-glossary tor-mail-bundle tor-manual tor-messenger tor-messenger-build tor-onion-proxy-library tor-ramdisk tor tor-rust-dependencies torbirdy tordnsel tor-fw-helper translation translation-tools trunnel ux/research user/nickm/bridgedb user/nickm/githax user/nickm/obfsproxy user/nickm/trunnel user/nickm/torsocks user/nickm/torguts gitolite-admin user/arma/tor-ideas marco user/nickm/libevent-ideas user/ioerror/filedump secteam sponsor19 dirauth-conf admin/tor-passwords admin/account-keyring; do printf "%s $repo\n" $(git -C $repo.git log --pretty=format:%at -1 2> /dev/null); done  | sort -n

That gave me a nice list of repos ordered by last commit date.

This reverts commit cd6dbee3.
parent cd6dbee3
Loading
Loading
Loading
Loading
+1 −25
Original line number Diff line number Diff line
@@ -454,19 +454,6 @@ def list_gitolite_repos_str(content: str):
            yield m.group(1)


def _repo_age(
    repository: str,
    gitolite_host: str = "cupani.torproject.org",
    gitolite_remote_repos_dir: str = "/srv/git.torproject.org/repositories/",
):
    con = Connection(gitolite_host)
    if not repository.endswith(".git"):
        repository += ".git"
    cmd = "sudo -u git git -C %s log --pretty=format:%%at -1" % (gitolite_remote_repos_dir + "/" + repository)
    logging.info("inspecting repository %s age with: %s", repository, cmd)
    return int(con.run(cmd, hide=True).stdout)


@task
def count_repos_categories(
    con: Connection,
@@ -482,17 +469,6 @@ def count_repos_categories(
    )
    total = 0
    for category, projects in category_map.items():
        if category == "Other":
            idle = active = 0
            for project in projects:
                age = _repo_age(project)
                if age >= 2 * 365 * 24 * 60 * 60:  # 2 years, in seconds
                    idle += 1
                else:
                    active += 1
            print("%d %s (idle)" % (idle, category))
            print("%d %s (active)" % (active, category))
        else:
        print("%d %s" % (len(projects), category))
        total += len(projects)
    print("%d total" % total)