thoth-station / support

ℹ Any Thoth related support questions
https://thoth-station.ninja/
0 stars 4 forks source link

Kebechet update manager: GitCommandError on kebechet_runners.py:212 #253

Closed khebhut[bot] closed 2 years ago

khebhut[bot] commented 2 years ago

Description

This is an automated issue generated by Kebechet v1.10.1. The update manager threw an exception (GitCommandError) at runtime while working on the following repository https://github.com/os-climate/data-platform-demo

Traceback

Traceback (most recent call last):
  File "/home/user/kebechet/kebechet_runners.py", line 212, in run
    instance.run(**manager_configuration)
  File "/home/user/kebechet/managers/update/update.py", line 873, in run
    rebase_pr_branch_and_comment(repo=self.repo, pr=pr)
  File "/home/user/kebechet/managers/update/utils.py", line 45, in rebase_pr_branch_and_comment
    num_behind = num_commits_behind(
  File "/home/user/kebechet/managers/update/utils.py", line 34, in num_commits_behind
    _create_local_branch_from_origin(repo, source_branch)
  File "/home/user/kebechet/managers/update/utils.py", line 28, in _create_local_branch_from_origin
    repo.git.checkout(branch_name)
  File "/home/user/.local/share/virtualenvs/user-5PivF_Od/lib/python3.8/site-packages/git/cmd.py", line 639, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/home/user/.local/share/virtualenvs/user-5PivF_Od/lib/python3.8/site-packages/git/cmd.py", line 1184, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/home/user/.local/share/virtualenvs/user-5PivF_Od/lib/python3.8/site-packages/git/cmd.py", line 984, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git checkout kebechet-automatic-update-ubi8
  stderr: 'error: pathspec 'kebechet-automatic-update-ubi8' did not match any file(s) known to git'
goern commented 2 years ago

/assign @KPostOffice /sig devsecops /kind bug /priority critical-urgent /triage accepted

KPostOffice commented 2 years ago

I think that this is likely due to some race condition as the branch names are pulled from the PR contents themselves. To fix we should add a check for PR status before executing this section of code.