Skip to content

Commit

Permalink
Update list of git repos
Browse files Browse the repository at this point in the history
There are some deleted redhat-appstudio repos being removed and some
new konflux-ci repos being added.

Also introduce a bash script to make the maintenance of this list a
little easier.
  • Loading branch information
simonbaird committed May 31, 2024
1 parent 2bc9749 commit dac1788
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
11 changes: 7 additions & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ git_services:
- enterprise-contract/enterprise-contract.github.io
- enterprise-contract/.github
- enterprise-contract/github-workflows
- enterprise-contract/go-gather
- enterprise-contract/golden-container
- enterprise-contract/hacks
- enterprise-contract/hooks
Expand All @@ -20,11 +21,13 @@ git_services:
- enterprise-contract/review-rot
- enterprise-contract/tekton-catalog
- enterprise-contract/user-guide
- redhat-appstudio/book
- redhat-appstudio/build-definitions
- redhat-appstudio/build-trusted-artifacts
- konflux-ci/build-definitions
- konflux-ci/build-trusted-artifacts
- konflux-ci/e2e-tests
- konflux-ci/konflux-ci.github.io
- konflux-ci/konflux-test
- konflux-ci/release-service-catalog
- redhat-appstudio/docs.appstudio.io
- redhat-appstudio/e2e-tests
- redhat-appstudio/infra-deployments
- redhat-appstudio/tenants-config
- tektoncd/chains
Expand Down
46 changes: 46 additions & 0 deletions hacks/maintenance-helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
set -euo pipefail

# GitHub orgs we're interested in
GITHUB_ORGS="
enterprise-contract
konflux-ci
redhat-appstudio
"

# Additional repos from elsewhere
EXTRA_REPOS="
tektoncd/chains
"

ORGS_URL="https://api.github.com/orgs"

# In case you need authenticated access to GitHub
#CURL_AUTH="-H \"Authorization: Bearer $TOKEN\""
CURL_AUTH=""

# Produce a sorted, quoted, comma-delimited list of every repo found
# in those orgs, plus the extras
EVERY_REPO=$(
(
comma=""
for org in $GITHUB_ORGS; do
# The default pagination is 30, hence we need the per_page param here
repos=$(curl -s $CURL_AUTH $ORGS_URL/${org}/repos?per_page=200 | jq -r '.[]|.full_name')
for repo in ${repos}; do
echo "${comma}\"${repo}\""
comma=","
done
done
for repo in $EXTRA_REPOS; do
echo "${comma}\"${repo}\""
done
) | sort
)

# Generate a config file containing all those repos
EVERY_REPO_CONFIG=$(yq ".git_services[].repos=[$EVERY_REPO]" config.yaml)

# Now use vimdiff to pick and choose from the discovered repos
# Maybe there are some new repos to add, or some obsolete repos to remove
vimdiff "+set ft=yaml" <(echo "$EVERY_REPO_CONFIG") config.yaml

0 comments on commit dac1788

Please sign in to comment.