Skip to content

Commit 9910787

Browse files
Quick and dirty fixes to enable spackbot on multiple repos (#108)
* Quick fix to spackbot to enable usage on both core and packages In lieu of a more thorough update to spackbot a quick fix to simply enable the usage of spackbot from both of the repos maintained by the spack organization and not an update to make spackbot configurable to support workflows on other forks that wish to utilized the spackbot tools. The configurations for the two repos are hard-coded, similarly to before, for the "spack" and "spack-packages" projects in the PROJECTS variable. Labeling and package maintainer pinging have been dropped. These are now handled by GitHub actions that run on pull request automatically as part of the "triage" workflow. ref. spack/spack-packages#507 Style is handled by configuring the tool to run for each project. This is hardcoded based on the project. For "spack" project the tool is the develop version of `spack style --fix` and for the "spack-packages" project the tool is simply `black`. * Update to use python3 version of awscli * Update spackbotdev redeploy script
1 parent f420296 commit 9910787

File tree

10 files changed

+97
-529
lines changed

10 files changed

+97
-529
lines changed

redeploy-spackbot-dev.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ docker push ghcr.io/${gh_user}/spackbot:${image_tag}
1414
docker push ghcr.io/${gh_user}/spackbot-workers:${image_tag}
1515

1616
# Rollout with the new containers
17-
kubectl rollout restart -n spack deployments/spackbotdev-spack-io
18-
kubectl rollout restart -n spack deployments/spackbotdev-workers
19-
kubectl rollout restart -n spack deployments/spackbotdev-lworkers
17+
kubectl -n spack rollout restart deployment spackbotdev-spack-io
18+
kubectl -n spack rollout restart deployment spackbotdev-workers
19+
kubectl -n spack rollout restart deployment spackbotdev-lworkers

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ gidgethub
44
python_dotenv
55
rq
66
sh
7-
aws
7+
awscli

spackbot/handlers/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@
33
run_pipeline_rebuild_all,
44
close_pr_gitlab_branch,
55
)
6-
from .labels import add_labels # noqa
7-
from .reviewers import add_reviewers, add_issue_maintainers # noqa
8-
from .reviewers import add_reviewers # noqa
96
from .style import style_comment, fix_style # noqa
107
from .mirrors import close_pr_mirror # noqa

spackbot/handlers/gitlab.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ async def close_pr_gitlab_branch(event, gh):
6565
pr_branch = payload["pull_request"]["head"]["ref"]
6666
pr_branch_name = f"pr{pr_number}_{pr_branch}"
6767

68-
url = helpers.gitlab_spack_project_url
68+
event_project = payload["repository"]["name"]
69+
url = helpers.PROJECT[event_project].gitlab_project_url
6970
url = f"{url}/repository/branches/{pr_branch_name}"
7071

7172
GITLAB_TOKEN = os.environ.get("GITLAB_TOKEN")

spackbot/handlers/labels.py

Lines changed: 0 additions & 185 deletions
This file was deleted.

spackbot/handlers/mirrors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ async def close_pr_mirror(event, gh):
5050
"pr_branch": pr_branch,
5151
}
5252

53-
if is_merged and base_branch == pr_expected_base:
53+
# PR Graduation Mirror is disabled
54+
if False and is_merged and base_branch == pr_expected_base:
5455
logger.info(
5556
f"PR {pr_number}/{pr_branch} merged to develop, graduating binaries"
5657
)

0 commit comments

Comments
 (0)