一键导入
scale-environment
// Scale up a test environment by bulk-creating repos, users, orgs, teams, issues, branches, PRs, and commits using the-power's create-many scripts. Three performance tiers: shell, Python connection reuse, and Python pooling.
// Scale up a test environment by bulk-creating repos, users, orgs, teams, issues, branches, PRs, and commits using the-power's create-many scripts. Three performance tiers: shell, Python connection reuse, and Python pooling.
Clean up GitHub resources created by the-power test environment scripts. Delete repositories, teams, members, rulesets, webhooks, environments, and other resources. Suspend or unsuspend users on GHES.
Configure the-power for a target GitHub instance. Run configure.py to generate .gh-api-examples.conf with hostname, token, org, repo, and other settings. Covers interactive and non-interactive setup, GHES vs dotcom differences, curl flags for self-signed certs, and GitHub App configuration.
Create a fully populated test organisation on a GitHub instance using the-power's build-all.sh script. Includes users, teams, repos, PRs, branch protection, and more. Requires .gh-api-examples.conf to be configured first.
Create a test repository using the-power's build-testcase scripts. Covers the full decision matrix of 30+ testcase scripts for repos with PRs, issues, workflows, secret scanning, rulesets, runners, and more.
Find the right the-power script by category, keyword, or goal. Covers all ~980 scripts organised by operation type with safety labels for destructive, GHES-only, and bulk operations.
Execute any the-power script with guided parameter input. Covers prerequisites, working directory, output interpretation, HTTP status codes, error patterns, and debugging techniques.
| name | scale-environment |
| description | Scale up a test environment by bulk-creating repos, users, orgs, teams, issues, branches, PRs, and commits using the-power's create-many scripts. Three performance tiers: shell, Python connection reuse, and Python pooling. |
| keywords | ["scale","bulk","many","create-many","performance","repos","users","orgs","teams","load","populate"] |
Bulk-create GitHub resources to populate a test environment. Three performance tiers are available depending on how fast you need to go.
All scaling scripts must be run from the root of a the-power repository
clone (the directory containing .gh-api-examples.conf).
Find an existing clone:
find ~ -maxdepth 5 -name "create-many-repos.sh" -path "*/the-power/*" 2>/dev/null
Start small. Create 10–50 resources to verify your config before scaling to hundreds or thousands. Bulk creation is not easily reversible.
Creating users is GHES-only. The create-many-users.sh and
python-create-many-users-* scripts call the site admin API, which is only
available on GitHub Enterprise Server — not github.com.
All bulk scripts read defaults from .gh-api-examples.conf:
number_of_repos=3
number_of_orgs=3
number_of_teams=3
number_of_branches=10
number_of_users_to_create_on_ghes=3
repo_prefix="gestrepo"
org_prefix="fruitbat"
user_prefix="testusertoad"
team_prefix="testteam"
branch_prefix="testbranch"
file_prefix="testfile"
The Python scripts also accept CLI overrides:
python3 python-create-many-repos-connection-reuse.py --repos 1000 --prefix mtst1 --org acme
Plain curl-in-a-loop. Easy to read and modify. Each request opens a new connection.
| Script | Creates |
|---|---|
create-many-repos.sh | Repositories in an org |
create-many-users.sh | Users (🔒 GHES only) |
create-many-teams.sh | Teams in an org |
create-many-organizations.sh | Organisations |
create-many-issues.sh | Issues on a repo |
create-many-branches.sh | Branches via the API |
create-many-branches-in-checked-out-repo.sh | Branches via local git |
create-many-pull-requests.sh | Pull requests |
create-many-commits-in-checked-out-repo.sh | Commits via local git |
create-many-project-cards.sh | Project cards |
create-many-repos-in-org-n.sh | Repos across numbered orgs |
create-many-orgs-with-many-repos-and-inflate-them-with-goodies.sh | Orgs + repos + extras |
Reuses a single http.client.HTTPSConnection for all requests, cutting out
TCP/TLS handshake overhead per call.
| Script | Creates |
|---|---|
python-create-many-repos-connection-reuse.py | Repositories |
python-create-many-orgs-connection-reuse.py | Organisations |
python-create-many-users-connection-reuse.py | Users (🔒 GHES only) |
python-create-many-issues-connection-reuse.py | Issues |
python-create-many-issues-w-comments-connection-reuse.py | Issues with comments |
Uses urllib3 connection pooling for maximum throughput. Requires:
pip install urllib3
| Script | Creates |
|---|---|
python-create-many-repos-connection-reuse-pool.py | Repositories |
python-create-many-orgs-connection-reuse-pool.py | Organisations |
python-create-many-users-connection-reuse-pool.py | Users (🔒 GHES only) |
| Need | Recommendation |
|---|---|
| A handful of resources (< 50) | Tier 1 shell scripts |
| Hundreds of resources | Tier 2 connection reuse |
| 1000+ resources | Tier 3 pooling |
Measured against a GHES test instance:
| Method | Time |
|---|---|
create-many-repos.sh | ~32s |
python-create-many-repos-connection-reuse.py | ~16s |
| Method | Time |
|---|---|
create-many-repos.sh | ~15 min |
python-create-many-repos-connection-reuse.py | ~9 min |
python-create-many-repos-connection-reuse-pool.py | ~3 min |
| Method | Time |
|---|---|
python-create-many-orgs-connection-reuse.py | ~7 min |
# 1. Configure for the target instance
cat .gh-api-examples.conf | grep -E '^(hostname|org)='
# 2. Verify with a small run
number_of_repos=5 ./create-many-repos.sh
# 3. Scale up with Python pooling
pip install urllib3
python3 python-create-many-repos-connection-reuse-pool.py \
--repos 1000 --prefix load --org acme
create-test-org skill).