regro / cf-scripts

Flagship repo for cf-regro-autotick-bot
Other
47 stars 72 forks source link

Bot scripts in recipe #93

Open CJ-Wright opened 6 years ago

CJ-Wright commented 6 years ago

In discussion with @scopatz

It might be nice to have a system where feedstocks can have a script which overrides the normal bot behavior for PRing. This would allow things with janky setups to be able to use the bot's bumping capabilities without having the bot need to deal with every corner case itself. We could also expand this to handle getting upstream versions if there are some recipes who's upstream is a bit off the beaten path

CJ-Wright commented 6 years ago

Maybe we source a custom migrator?

This will require:

  1. the bot to know about the file to source before running the migrator
  2. the capacity to override the migrator temporally

Eg bot finds migrators.xsh in the recipe dir, bot sources migrators.xsh, bot uses currently available migrator for whatever migration it is doing, bot finishes and reverts to stock migrators. We could also run a custom migration which goes and pokes every feedstock to run it's custom migration (we could store this info in the graph so we don't need to poke every feedstock directly).

@scopatz would it be possible to xonsh source as a context manager? (to address 2)

scopatz commented 6 years ago

xonsh source as a context manager?

What do you mean exactly? Can you give an example usage?

CJ-Wright commented 6 years ago

recipe provides its own Version migrator because they have some special issues during version migration. I'd like that to override the local namespace so we use that migratior when working with that recipe, but not any other.

...
for feedstock in feedstocks:
    with source 'bot.xsh':  # if this doesn't exist do nothing
        run(Version())  # This uses version from 'bot.xsh' if it exists else run on defaults
scopatz commented 6 years ago

We have discussed this out of bounds bit