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

add platform_allowlist for migrator #1655

Merged
merged 4 commits into from
Apr 18, 2023
Merged

Conversation

h-vetinari
Copy link
Contributor

@h-vetinari h-vetinari commented Apr 18, 2023

Very specifically for conda-forge/conda-forge-pinning-feedstock#1359, though hopefully useful in general.

I thought about this a bit, but I'm completely new to this codebase, and it's a bit hard to penetrate TBH. I mainly tried to follow Matthew's idea.

The migrator for fortran-only-on-windows would then look like:

__migrator:
  kind:
    version
  migration_number: 1
  build_number: 1
  longterm: True
  platform_allowlist:  # new
    - win_64           # new
  override_cbc_keys:
    - fortran_compiler_stub

The underscore in win_64 comes from the same pattern elsewhere in feedstock_parser.py, but unsurprisingly I don't care whether it's - or _ (or whatever).

The tricker bit is writing tests for this. I tried to look for tests for the similar wait_for_migrators, but this has no tests either (which is probably why it's broken)... Advice & help welcome

@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Patch coverage: 54.16% and project coverage change: -0.01 ⚠️

Comparison is base (36cdec4) 64.42% compared to head (f519aea) 64.42%.

❗ Current head f519aea differs from pull request most recent head 5221440. Consider uploading reports for the commit 5221440 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1655      +/-   ##
==========================================
- Coverage   64.42%   64.42%   -0.01%     
==========================================
  Files          88       88              
  Lines        7901     7912      +11     
==========================================
+ Hits         5090     5097       +7     
- Misses       2811     2815       +4     
Impacted Files Coverage Δ
conda_forge_tick/migrators/migration_yaml.py 61.04% <0.00%> (-0.64%) ⬇️
conda_forge_tick/feedstock_parser.py 82.64% <81.25%> (+0.07%) ⬆️

... and 9 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@beckermr
Copy link
Contributor

Thank you so much!

From the name "platform_restriction" I cannot tell if the list is platforms to skip or platforms to keep. Can we think of another name?

@beckermr
Copy link
Contributor

In terms of tests, writing them for this part of the bot is next to impossible.

@h-vetinari
Copy link
Contributor Author

h-vetinari commented Apr 18, 2023

From the name "platform_restriction" I cannot tell if the list is platforms to skip or platforms to keep. Can we think of another name?

Happy to bikeshed, not attached to any particular name. For me, "filter" can be both a positive (e.g. air filter) or a negative (e.g. dust filter), so I tried to avoid it. I guess I pictured "restrict to platform" and not "restricted platform", so didn't notice it's also ambivalent.

Maybe __migrator.platform_constraint or __migrator.platform_allowlist?

@beckermr
Copy link
Contributor

Yes sorry to nitpick. Platform allow list is perfect.

@h-vetinari h-vetinari changed the title add ability to restrict platforms for migrator add platform_allowlist for migrator Apr 18, 2023
@h-vetinari
Copy link
Contributor Author

h-vetinari commented Apr 18, 2023

In terms of tests, writing them for this part of the bot is next to impossible.

Could we not have a micro-version of conda-forge (say 10-20 packages), for which we parse the feedstocks, construct a graph, execute migrations, etc?

@beckermr
Copy link
Contributor

Yep. That's the way to do them. We've been thinking of doing that for a while but it's a lot of work and covering all cases the bot encounters is not trivial.

Copy link
Contributor

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

We should support both _ and - in both names in the feedstock data and the migrator data.

Once that works, LGTM.

@h-vetinari
Copy link
Contributor Author

We should support both _ and - in both names in the feedstock data and the migrator data.

Migrator side is fine, but not sure what you mean by supporting it in feedstock data. The parser doesn't collect the arches from the meta.yaml directly and uses just one style - AFAICT it needs to use underscores because it constructs keys from it like sub_graph[f"{plat_arch_name}_meta_yaml"]

@beckermr
Copy link
Contributor

I mean the migrator side only. Sorry for being confusing.

@beckermr beckermr enabled auto-merge April 18, 2023 22:41
@beckermr beckermr merged commit c845ea9 into regro:master Apr 18, 2023
@h-vetinari h-vetinari deleted the plat_restrict branch April 18, 2023 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants