gitconsensus / GithubOrganizer

Github App for making Organizations easier to manage
https://organizer.gitconsensus.com/
MIT License
36 stars 11 forks source link

Client Error - Not found URL #22

Open tobes64 opened 2 years ago

tobes64 commented 2 years ago

Whilst running the GitHub Organizer came across an issue for the update_branch_protection function within the githuborganizer/tasks/github.py file

It looks like its trying to find a URL REPO_NAME/branch/master/protection which wouldn't exist.

[2022-01-28 16:46:33,423: WARNING/ForkPoolWorker-48] {"required_status_checks": {"strict": true, "contexts": ["Semantic Pull Request"], "required_approving_review_count": 1}, "enforce_admins": false, "required_pull_request_reviews": {"dismissal_restrictions": {"users": [], "teams": []}, "dismiss_stale_reviews": true, "require_code_owner_reviews": true, "required_approving_review_count": 1}, "restrictions": null, "required_linear_history": false, "allow_force_pushes": false, "allow_deletions": false}
[2022-01-28 16:46:33,702: ERROR/ForkPoolWorker-48] Task githuborganizer.tasks.github.update_branch_protection[5a1c983f-1ef6-428a-bed7-2dbbbbb4c465] raised unexpected: HTTPError('404 Client Error: Not Found for url: https://api.github.com/repos/concat/branches/master/protection',)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/app/githuborganizer/tasks/github.py", line 110, in update_branch_protection
    dismiss_stale_reviews=bsettings.get('dismiss_stale_reviews', True)
  File "/app/githuborganizer/models/gh.py", line 133, in branch_protection
    accepts=['application/vnd.github.luke-cage-preview+json']
  File "/app/githuborganizer/services/github.py", line 61, in rest
    r.raise_for_status()
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/concat/branches/master/protection
[2022-01-28 16:47:10,616: INFO/MainProcess] Scaling down 8 processes.