creativecommons / ccos-scripts

Scripts used to maintain various pieces of CC's open source presence.
MIT License
14 stars 19 forks source link

Resolve GitHub API error and Asana API warning #175

Closed TimidRobot closed 1 year ago

TimidRobot commented 1 year ago

Description

Technical details

GitHub API error

Trace:

2023-07-24 12:48:19,331 │ ERROR    │ <module>: Unhandled exception: Traceback (most recent call last):
  File "/Users/timidrobot/CreativeCommons/git/ccos-scripts/./normalize_repos.py", line 177, in <module>
    main()
  File "/Users/timidrobot/CreativeCommons/git/ccos-scripts/./normalize_repos.py", line 172, in main
    update_branches(args, repos)
  File "/Users/timidrobot/CreativeCommons/git/ccos-scripts/./normalize_repos.py", line 160, in update_branches
    update_branch_protection(repo)
  File "/Users/timidrobot/CreativeCommons/git/ccos-scripts/./normalize_repos.py", line 147, in update_branch_protection
    default_branch.edit_protection(
  File "/Users/timidrobot/.local/share/virtualenvs/ccos-scripts-8EVzyQrj/lib/python3.10/site-packages/github/Branch.py", line 365, in edit_protection
    headers, data = self._requester.requestJsonAndCheck(
  File "/Users/timidrobot/.local/share/virtualenvs/ccos-scripts-8EVzyQrj/lib/python3.10/site-packages/github/Requester.py", line 442, in requestJsonAndCheck
    return self.__check(
  File "/Users/timidrobot/.local/share/virtualenvs/ccos-scripts-8EVzyQrj/lib/python3.10/site-packages/github/Requester.py", line 487, in __check
    raise self.__createException(status, responseHeaders, data)
github.GithubException.GithubException: 422 {"message": "Invalid request.\n\nNo subschema in \"anyOf\" matched.\nFor 'properties/bypass_pull_request_allowances', nil is not an object.\nNot all subschemas of \"allOf\" matched.\nFor 'anyOf/1', {\"required_approving_review_count\"=>1, \"bypass_pull_request_allowances\"=>nil} is not a null.", "documentation_url": "https://docs.github.com/rest/branches/branch-protection#update-branch-protection"}

Asana API warning

[Virtual Environment Path]/lib/python3.10/site-packages/asana/client.py:156: UserWarning: This request is affected by the "new_goal_memberships" deprecation. Please visit this url for more info: https://forum.asana.com/t/launched-team-sharing-for-goals/378601 Adding "new_goal_memberships" to your "Asana-Enable" or "Asana-Disable" header will opt in/out to this deprecation and suppress this warning.

Checklist

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ```