conda-forge / conda-smithy

The tool for managing conda-forge feedstocks.
https://conda-forge.org/
BSD 3-Clause "New" or "Revised" License
146 stars 170 forks source link

ENH: Warn on non-existent `abi_migration_branches` #1910

Open h-vetinari opened 3 months ago

h-vetinari commented 3 months ago

With the recent improvements in the validation of conda-forge.yml, I'm wondering if we could also validate that the branches as specified actually exist on the feedstock. Not doing so can be quite costly, in the sense that the bot in https://github.com/regro/cf-scripts will then retry almost every run and inevitably fail - just a lot of wasted resources for nothing IMO.

Example I came across today by chance: https://github.com/conda-forge/hpp-fcl-feedstock/commit/2e0741d2d7e0fc980a8ca32d8ab44df006f65cb9 (the feedstock in question didn't have a v1 branch)

stacktrace from bot From [this](https://github.com/regro/cf-scripts/actions/runs/8730207807/job/23953597737) run, but appears in every recent bot run I've looked at. ``` 2024-04-18 00:29:19,958 INFO conda_forge_tick.auto_tick || OSXARM-arm osx addition IS MIGRATING hpp-fcl:v1 2024-04-18 00:29:19,958 INFO github3 || Building a url from ('https://api.github.com/', 'rate_limit') 2024-04-18 00:29:20,005 INFO github3 || JSON was returned 2024-04-18 00:29:20,006 INFO github3 || Building a url from ('https://api.github.com/', 'user') 2024-04-18 00:29:20,079 INFO github3 || JSON was returned 2024-04-18 00:29:20,080 INFO github3 || Building a url from ('https://api.github.com/', 'repos', 'conda-forge', 'hpp-fcl-feedstock') 2024-04-18 00:29:20,080 INFO github3 || Missed the cache building the url 2024-04-18 00:29:20,215 INFO github3 || JSON was returned 2024-04-18 00:29:20,215 INFO github3 || Building a url from ('https://api.github.com/', 'repos', 'regro-cf-autotick-bot', 'hpp-fcl-feedstock') 2024-04-18 00:29:20,215 INFO github3 || Missed the cache building the url 2024-04-18 00:29:20,338 INFO github3 || JSON was returned fatal: 'upstream/v1' is not a commit and a branch 'v1' cannot be created from it fatal: 'upstream/v1' is not a commit and a branch 'v1' cannot be created from it 2024-04-18 00:29:21,606 ERROR conda_forge_tick.auto_tick || NON GITHUB ERROR Traceback (most recent call last): File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/git_utils.py", line 260, in fetch_repo _run_git_cmd(f"git checkout --track upstream/{base_branch} {quiet}") File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/git_utils.py", line 235, in _run_git_cmd return subprocess.run(cmd, shell=True, check=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/micromamba/envs/cf-scripts/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'git checkout --track upstream/v1 --quiet' returned non-zero exit status 128. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/auto_tick.py", line 1253, in _run_migrator migrator_uid, pr_json = run( ^^^^ File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/auto_tick.py", line 214, in run feedstock_dir, repo = get_repo( ^^^^^^^^^ File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/git_utils.py", line 349, in get_repo if fetch_repo( ^^^^^^^^^^^ File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/git_utils.py", line 262, in fetch_repo _run_git_cmd( File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/git_utils.py", line 235, in _run_git_cmd return subprocess.run(cmd, shell=True, check=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/micromamba/envs/cf-scripts/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'git checkout -b v1 upstream/v1 --quiet' returned non-zero exit status 128. 2024-04-18 00:29:24,330 INFO conda_forge_tick.auto_tick || /home/runner/work/cf-scripts/cf-scripts/cf-graph 2024-04-18 00:29:24,330 INFO github3 || Building a url from ('https://api.github.com/', 'rate_limit') 2024-04-18 00:29:24,383 INFO github3 || JSON was returned ```