creativecommons / ccos-scripts

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

[Bug] move_closed_issues.py error: Validation Failed #172

Closed TimidRobot closed 1 year ago

TimidRobot commented 1 year ago

Description

Manage Issues in Projects (move_closed_issues.py) is repeatedly failing (since 2023-07-01):

Unhandled exception: Traceback (most recent call last):
  File "/home/runner/work/ccos-scripts/ccos-scripts/./move_closed_issues.py", line 75, in move_cards
    done.create_card(
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/github/ProjectColumn.py", line 141, in create_card
    headers, data = self._requester.requestJsonAndCheck(
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/github/Requester.py", line 353, in requestJsonAndCheck
    return self.__check(
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/github/Requester.py", line 378, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": [{"resource": "ProjectCard", "code": "unprocessable", "field": "data", "message": "Project already has the associated issue"}], "documentation_url": "https://docs.github.com/v3/projects/cards/#create-a-project-card"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/ccos-scripts/ccos-scripts/./move_closed_issues.py", line 99, in <module>
    main()
  File "/home/runner/work/ccos-scripts/ccos-scripts/./move_closed_issues.py", line 94, in main
    move_cards(args, github, backlog, done)
  File "/home/runner/work/ccos-scripts/ccos-scripts/./move_closed_issues.py", line 79, in move_cards
    except github.GithubException as e:
AttributeError: 'Github' object has no attribute 'GithubException'

Expectation

GitHub Action should complete successfully an overwhelming majority of the time.