regro / cf-scripts

Flagship repo for cf-regro-autotick-bot
Other
53 stars 74 forks source link

Reapply (Git-6) Use new Git Backend in Entire auto_tick flow #3124

Closed ytausch closed 1 week ago

ytausch commented 1 week ago

Description:

This PR reapplies the revert done in https://github.com/regro/cf-scripts/pull/3024.

The error was observed because the HTTP Basic Auth token needs to be base64 encoded.

c54001a65e2d3285cb65578c04abd9d7dcd16379 applies the necessary fix.

Checklist:

Cross-refs, links to issues, etc:

Cc @pavelzw

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 92.81437% with 36 lines in your changes missing coverage. Please review.

Project coverage is 77.46%. Comparing base (c77cf4a) to head (c54001a). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
conda_forge_tick/auto_tick.py 15.78% 16 Missing :warning:
conda_forge_tick/git_utils.py 89.16% 13 Missing :warning:
tests/test_git_utils.py 98.01% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3124 +/- ## ========================================== + Coverage 76.60% 77.46% +0.85% ========================================== Files 124 124 Lines 13017 13280 +263 ========================================== + Hits 9972 10287 +315 + Misses 3045 2993 -52 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

beckermr commented 1 week ago

@ytausch we need to revert this one again: See the errors in this job:

https://github.com/regro/cf-scripts/actions/runs/11783101890/job/32819561459

ytausch commented 1 week ago

@ytausch we need to revert this one again: See the errors in this job:

https://github.com/regro/cf-scripts/actions/runs/11783101890/job/32819561459

I think this is not a functional bug but just confusing log output. Very likely the message is generated by these lines:

https://github.com/regro/cf-scripts/blob/eedaf0f4385aa4f34671836d2e0c4f73918937b3/conda_forge_tick/git_utils.py#L529-L538

(The bot tries to checkout a branch to see if it already exists.)

I can suppress stdout and stderr output for these speculative git invocations, WDYT?

beckermr commented 1 week ago

No there is a bug. See here:

  2024-11-11 17:21:03,988 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/auto_tick.py", line 720, in _run_migrator_on_feedstock_branch
      migrator_uid, pr_json = run_with_tmpdir(
                              ^^^^^^^^^^^^^^^^
    File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/auto_tick.py", line 451, in run_with_tmpdir
      return run(
             ^^^^
    File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/auto_tick.py", line 582, in run
      pr_data = git_backend.create_pull_request(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/git_utils.py", line 941, in create_pull_request
      header_fields = {
                      ^
    File "/home/runner/work/cf-scripts/cf-scripts/cf-scripts/conda_forge_tick/git_utils.py", line 942, in <dictcomp>
      k: self._github3_session.last_response_headers[k]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
    File "/home/runner/micromamba/envs/cf-scripts/lib/python3.11/site-packages/requests/structures.py", line 52, in __getitem__
      return self._store[key.lower()][1]
             ~~~~~~~~~~~^^^^^^^^^^^^^
  KeyError: 'last-modified'
ytausch commented 1 week ago

Just verified: The GitHub API returns the Last-Modified header only if we get a PR with GET, and not when creating one with POST, although the response is otherwise identical. Should not be too hard to fix.