bridge2ai / b2ai-standards-registry

Bridge2AI Standards Registry data models, API specification, and other documentation.
https://bridge2ai.github.io/b2ai-standards-registry/
MIT License
7 stars 3 forks source link

Issue process is failing with TypeError #100

Open caufieldjh opened 1 year ago

caufieldjh commented 1 year ago

The last couple of new entity request issues have been failing in GH Actions:

Run poetry run python ./.github/scripts/process_issue.py --github
Traceback (most recent call last):
  File "/home/runner/work/b2ai-standards-registry/b2ai-standards-registry/./.github/scripts/process_issue.py", line 556, in <module>
    main()
  File "/home/runner/.cache/pypoetry/virtualenvs/b2ai-standards-registry-euyZzU7C-py3.[9](https://github.com/bridge2ai/b2ai-standards-registry/actions/runs/5685383905/job/15410153912#step:6:10)/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/runner/.cache/pypoetry/virtualenvs/b2ai-standards-registry-euyZzU7C-py3.9/lib/python3.9/site-packages/click/core.py", line [10](https://github.com/bridge2ai/b2ai-standards-registry/actions/runs/5685383905/job/15410153912#step:6:11)55, in main
    rv = self.invoke(ctx)
  File "/home/runner/.cache/pypoetry/virtualenvs/b2ai-standards-registry-euyZzU7C-py3.9/lib/python3.9/site-packages/click/core.py", line [14](https://github.com/bridge2ai/b2ai-standards-registry/actions/runs/5685383905/job/15410153912#step:6:15)04, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/.cache/pypoetry/virtualenvs/b2ai-standards-registry-euyZzU7C-py3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/work/b2ai-standards-registry/b2ai-standards-registry/./.github/scripts/process_issue.py", line 451, in main
    issue_to_resource = get_new_request_issues()
  File "/home/runner/work/b2ai-standards-registry/b2ai-standards-registry/./.github/scripts/process_issue.py", line 364, in get_new_request_issues
    data = get_b2ai_standards_registry_form_data(
  File "/home/runner/work/b2ai-standards-registry/b2ai-standards-registry/./.github/scripts/process_issue.py", line [22](https://github.com/bridge2ai/b2ai-standards-registry/actions/runs/5685383905/job/15410153912#step:6:23)2, in get_b2ai_standards_registry_form_data
    return get_form_data(
  File "/home/runner/work/b2ai-standards-registry/b2ai-standards-registry/./.github/scripts/process_issue.py", line [25](https://github.com/bridge2ai/b2ai-standards-registry/actions/runs/5685383905/job/15410153912#step:6:26)8, in get_form_data
    rv = {
  File "/home/runner/work/b2ai-standards-registry/b2ai-standards-registry/./.github/scripts/process_issue.py", line 259, in <dictcomp>
    issue["number"]: parse_body(issue["body"])
TypeError: string indices must be integers
Error: Process completed with exit code 1.

As the issue suggests, it's a type problem: looks like issue gets set to a string when it should be a dict. Not certain why this started recently.

caufieldjh commented 1 year ago

This is the problem - get_form_data is returning this for res_json:

{'message': 'Bad credentials', 'documentation_url': 'https://docs.github.com/rest'}

Check that token!

caufieldjh commented 1 year ago

Refreshed token, re-ran action, looks like it works now.

caufieldjh commented 3 months ago

Process is failing again, so presumably it's due to an authentication error.