Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send a PR for arch migrations if build_platform is in conda-foge.yml #2818

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions conda_forge_tick/migrators/arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@
get_deps_from_outputs_lut,
make_outputs_lut_from_graph,
)
from conda_forge_tick.migrators.core import GraphMigrator, _sanitized_muids
from conda_forge_tick.migrators.core import GraphMigrator
from conda_forge_tick.os_utils import pushd
from conda_forge_tick.utils import (
as_iterable,
frozen_to_json_friendly,
pluck,
yaml_safe_dump,
yaml_safe_load,
)
from conda_forge_tick.utils import as_iterable, pluck, yaml_safe_dump, yaml_safe_load

from .migration_yaml import all_noarch

Expand Down Expand Up @@ -180,17 +174,18 @@ def __init__(
def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool:
if super().filter(attrs):
return True
muid = frozen_to_json_friendly(self.migrator_uid(attrs))
for arch in self.arches:
configured_arch = (
attrs.get("conda-forge.yml", {}).get("provider", {}).get(arch)
) or (
attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch)
not in [None, arch]
)
if configured_arch:
return muid in _sanitized_muids(
attrs.get("pr_info", {}).get("PRed", []),
)
Comment on lines -189 to -191
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused as to why we no longer need this block of code any more. The call to super().filter above does not check if the PR has already been made. This change will force the bot to reissue arch PRs to feedstocks if they merged an arch PR but then subsequently removed arch builds for w/e reason.

else:
return False
if not configured_arch:
# This arch is not in provider or build_platform
return False

return True

def migrate(
self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any
Expand Down Expand Up @@ -347,17 +342,18 @@ def __init__(
def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool:
if super().filter(attrs):
return True
muid = frozen_to_json_friendly(self.migrator_uid(attrs))
for arch in self.arches:
configured_arch = (
attrs.get("conda-forge.yml", {}).get("provider", {}).get(arch)
) or (
attrs.get("conda-forge.yml", {}).get("build_platform", {}).get(arch)
not in [None, arch]
)
if configured_arch:
return muid in _sanitized_muids(
attrs.get("pr_info", {}).get("PRed", []),
)
else:
return False
if not configured_arch:
# This arch is not in provider or build_platform
return False

return True

def migrate(
self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any
Expand Down
Loading