Skip to content

Commit

Permalink
Update how "@spackbot rebuild everything" is done (#92)
Browse files Browse the repository at this point in the history
Supports a recent change to spacks gitlab pipelines requiring an
additional environemnt variable to be specified when the pipeline
should rebuild all packages.

Also addresses style changes requested by the latest versions of
black and flake8.
  • Loading branch information
scottwittenburg authored Oct 13, 2023
1 parent bdae376 commit 92783b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spackbot/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def s3_parse_url(url, default_bucket="spack-binaries-prs", default_prefix="dummy
"prefix": default_prefix,
}

if type(url) == str:
if isinstance(url, str):
url = urlparse(url)

if url.scheme == "s3":
Expand Down
6 changes: 5 additions & 1 deletion spackbot/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ async def run_pipeline_task(event):
f"{url}&variables[][key]=SPACK_PRUNE_UNTOUCHED&variables[][value]=False"
)
url = f"{url}&variables[][key]=SPACK_PRUNE_UP_TO_DATE&variables[][value]=False"
mirror_template = urllib.parse.quote_plus("single-src-pr-mirrors.yaml.in")
url = f"{url}&variables[][key]=PIPELINE_MIRROR_TEMPLATE&variables[][value]={mirror_template}"

logger.info(
f"Deleting {helpers.pr_mirror_base_url}/{pr_mirror_key} for rebuild request by {sender}"
Expand All @@ -236,7 +238,9 @@ async def run_pipeline_task(event):

detailed_status = result.get("detailed_status", {})
if "details_path" in detailed_status:
url = urllib.parse.urljoin(helpers.spack_gitlab_url, detailed_status["details_path"])
url = urllib.parse.urljoin(
helpers.spack_gitlab_url, detailed_status["details_path"]
)
logger.info(f"Triggering pipeline on {branch}: {url}")
msg = f"I've started that [pipeline]({url}) for you!"
await gh.post(comments_url, {}, data={"body": msg})
Expand Down

0 comments on commit 92783b4

Please sign in to comment.