Skip to content

Commit 838deeb

Browse files
authored
Add support for namespace and blacksmith apps (#2514)
1 parent 6986f2d commit 838deeb

File tree

3 files changed

+68
-6
lines changed

3 files changed

+68
-6
lines changed

conda_smithy/ci_register.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ def travis_get_repo_info(user, project, show_error=False):
358358

359359

360360
def add_project_to_travis(user, project):
361+
"""
362+
UNUSED
363+
"""
361364
# Make sure the travis-ci user has accepted all invitations
362365
if os.getenv("GH_TRAVIS_TOKEN"):
363366
gh = github.Github(os.getenv("GH_TRAVIS_TOKEN"))
@@ -549,15 +552,37 @@ def travis_cleanup(org, project):
549552

550553

551554
def enable_cirrus_runners_app(org: str, project: str) -> None:
555+
"""DEPRECATED"""
552556
app = 108385308 if org == "conda-forge" else "cirrus-runners"
553557
github.configure_github_app(org, project, app)
554558

555559

556560
def disable_cirrus_runners_app(org: str, project: str) -> None:
561+
"""DEPRECATED"""
557562
app = 108385308 if org == "conda-forge" else "cirrus-runners"
558563
github.configure_github_app(org, project, app, remove=True)
559564

560565

566+
def enable_namespace_app(org: str, project: str) -> None:
567+
app = 122481775 if org == "conda-forge" else "namespace-managed-runners"
568+
github.configure_github_app(org, project, app)
569+
570+
571+
def disable_namespace_app(org: str, project: str) -> None:
572+
app = 122481775 if org == "conda-forge" else "namespace-managed-runners"
573+
github.configure_github_app(org, project, app, remove=True)
574+
575+
576+
def enable_blacksmith_app(org: str, project: str) -> None:
577+
app = 122473844 if org == "conda-forge" else "blacksmith-sh"
578+
github.configure_github_app(org, project, app)
579+
580+
581+
def disable_blacksmith_app(org: str, project: str) -> None:
582+
app = 122473844 if org == "conda-forge" else "blacksmith-sh"
583+
github.configure_github_app(org, project, app, remove=True)
584+
585+
561586
def get_conda_hook_info(hook_url, events):
562587
payload = {
563588
"name": "web",

conda_smithy/cli.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ class RegisterCI(Subcommand):
225225
"Webservice",
226226
"Cirun",
227227
"Cirrus-Runners",
228+
"Blacksmith",
229+
"Namespace",
228230
)
229231

230232
def __init__(self, parser):
@@ -320,7 +322,7 @@ def __init__(self, parser):
320322
"--remove",
321323
action="store_true",
322324
help="Revoke access to the configured CI services. "
323-
"Only available for Cirun and Cirrus Runners for now",
325+
"Only available for Cirun, Namespace and Blacksmith for now",
324326
)
325327

326328
def __call__(self, args):
@@ -460,15 +462,27 @@ def __call__(self, args):
460462
print("Cirun registration disabled.")
461463

462464
if args.cirrus_runners:
465+
print("Cirrus Runners support is deprecated.")
466+
467+
if args.blacksmith:
463468
if args.remove:
464-
print("Cirrus Runners Registration: removing")
465-
ci_register.disable_cirrus_runners_app(owner, repo)
469+
print("Blacksmith.sh Registration: removing")
470+
ci_register.disable_blacksmith_app(owner, repo)
466471
else:
467-
print("Cirrus Runners Registration: installing")
468-
ci_register.enable_cirrus_runners_app(owner, repo)
472+
print("Blacksmith.sh Registration: installing")
473+
ci_register.enable_blacksmith_app(owner, repo)
474+
else:
475+
print("Blacksmith.sh registration disabled.")
469476

477+
if args.namespace:
478+
if args.remove:
479+
print("Namespace.so Registration: removing")
480+
ci_register.disable_namespace_app(owner, repo)
481+
else:
482+
print("Namespace.so Registration: installing")
483+
ci_register.enable_namespace_app(owner, repo)
470484
else:
471-
print("Cirrus Runners registration disabled.")
485+
print("Namespace.so registration disabled.")
472486

473487
if args.webservice:
474488
ci_register.add_conda_forge_webservice_hooks(owner, repo)

news/2514-more-self-gha.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* CI registration now supports Blacksmith.sh and Namespace.so Github Actions runners. (#2514)
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* CI registration support for Cirrus Runners has been removed since the service will shut down in June. (#2514)
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

0 commit comments

Comments
 (0)