Currently, the bot checks out from main when a comment is made on a PR:
|
ref: ${{ github.event.repository.default_branch }} |
Then dispatch.py is called through:
|
python3 .github/scripts/pr_comment_kernel_bot.py |
We have the following LOC in dispatch.py:
|
def read_backends(kernel_name: str) -> list[str] | None: |
|
"""Read the backends list from a kernel's build.toml. Returns None if not found.""" |
|
build_toml = Path(kernel_name) / "build.toml" |
|
if not build_toml.exists(): |
|
return None |
|
with open(build_toml, "rb") as f: |
|
config = tomllib.load(f) |
|
backends = config.get("general", {}).get("backends") |
|
if backends is None: |
|
backends = config.get("backends") |
|
if isinstance(backends, list): |
|
return backends |
|
return None |
|
|
Since it's invoked from main, it means all release workflows will get triggered since backends can be none for kernels that don't exist on main yet:
|
backends = read_backends(kernel_name) |
|
if backends is None: |
|
print(f"Could not read backends for {kernel_name}, dispatching all workflows") |
|
return set(RELEASE_WORKFLOWS) |
I think this is what happened here:
#919
The said kernel doesn't declare a "metal" backend but still, a build-mac.yaml was dispatched and it failed here: https://github.com/huggingface/kernels-community/actions/runs/27025228114 because it couldn't find metadata.
My comments are:
Currently, the bot checks out from
mainwhen a comment is made on a PR:kernels-community/.github/workflows/pr-comment-build.yaml
Line 20 in da8ff02
Then
dispatch.pyis called through:kernels-community/.github/workflows/pr-comment-build.yaml
Line 49 in da8ff02
kernels-community/.github/scripts/pr_comment_kernel_bot.py
Line 12 in da8ff02
We have the following LOC in
dispatch.py:kernels-community/.github/scripts/dispatch.py
Lines 140 to 153 in da8ff02
Since it's invoked from
main, it means all release workflows will get triggered since backends can be none for kernels that don't exist onmainyet:kernels-community/.github/scripts/dispatch.py
Lines 167 to 170 in da8ff02
I think this is what happened here:
#919
The said kernel doesn't declare a "metal" backend but still, a
build-mac.yamlwas dispatched and it failed here: https://github.com/huggingface/kernels-community/actions/runs/27025228114 because it couldn't find metadata.My comments are: