biopragmatics / bioregistry

📮 An integrative registry of biological databases, ontologies, and nomenclatures.
https://bioregistry.io
MIT License
119 stars 51 forks source link

CI fails on forks: config.annotations missing #320

Closed dhimmel closed 2 years ago

dhimmel commented 2 years ago

CI is failing on my fork:

[01:20:[23](https://github.com/dhimmel/bioregistry/runs/5241512685?check_suite_focus=true#step:5:23)] Aligning ols
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/__main__.py", line 8, in <module>
    main()
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/decorators.py", line [26](https://github.com/dhimmel/bioregistry/runs/5241512685?check_suite_focus=true#step:5:26), in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/cli.py", line [34](https://github.com/dhimmel/bioregistry/runs/5241512685?check_suite_focus=true#step:5:34), in update
    ctx.invoke(align)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/align/cli.py", line 54, in align
    aligner_cls.align()
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/align/utils.py", line 1[41](https://github.com/dhimmel/bioregistry/runs/5241512685?check_suite_focus=true#step:5:41), in align
    instance = cls()
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/align/utils.py", line 58, in __init__
    self.external_registry = self.__class__.getter(**kwargs)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/external/ols.py", line [55](https://github.com/dhimmel/bioregistry/runs/5241512685?check_suite_focus=true#step:5:55), in get_ols
    processed[ols_id] = _process(ontology, config)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/external/ols.py", line 83, in _process
    license_value = config["annotations"].get("license", [None])[0]
KeyError: 'annotations'
ERROR: InvocationError for command /home/runner/work/bioregistry/bioregistry/.tox/update/bin/python -m bioregistry update (exited with code 1)
cthoyt commented 2 years ago

Should have been fixed by https://github.com/biopragmatics/bioregistry/commit/03e17fc7bb129b0b5a857e9739ee89fdf0310606

See also https://twitter.com/cthoyt/status/1494048561369124868

dhimmel commented 2 years ago

Just got another error on a scheduled job after fast forwarding my fork.

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/__main__.py", line 8, in <module>
    main()
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/cli.py", line [34](https://github.com/dhimmel/bioregistry/runs/5255581914?check_suite_focus=true#step:5:34), in update
    ctx.invoke(align)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/align/cli.py", line 54, in align
    aligner_cls.align()
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/align/utils.py", line 141, in align
    instance = cls()
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/align/utils.py", line 58, in __init__
    self.external_registry = self.__class__.getter(**kwargs)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/external/bioportal.py", line 59, in get_bioportal
    records = thread_map(_process, records, disable=True)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/tqdm/contrib/concurrent.py", line 94, in thread_map
    return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/tqdm/contrib/concurrent.py", line 76, in _executor_map
    return list(tqdm_class(ex.map(fn, *iterables, **map_args), **kwargs))
  File "/home/runner/work/bioregistry/bioregistry/.tox/update/lib/python3.9/site-packages/tqdm/std.py", line 1168, in __iter__
    for obj in iterable:
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/concurrent/futures/_base.py", line 609, in result_iterator
    yield fs.pop().result()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/concurrent/futures/_base.py", line 4[39](https://github.com/dhimmel/bioregistry/runs/5255581914?check_suite_focus=true#step:5:39), in result
    return self.__get_result()
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/opt/hostedtoolcache/Python/3.9.10/x64/lib/python3.9/concurrent/futures/thread.py", line [58](https://github.com/dhimmel/bioregistry/runs/5255581914?check_suite_focus=true#step:5:58), in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/runner/work/bioregistry/bioregistry/src/bioregistry/external/bioportal.py", line [68](https://github.com/dhimmel/bioregistry/runs/5255581914?check_suite_focus=true#step:5:68), in _process
    bioportal_key = entry["acronym"]
TypeError: string indices must be integers
ERROR: InvocationError for command /home/runner/work/bioregistry/bioregistry/.tox/update/bin/python -m bioregistry update (exited with code 1)

Perhaps schedules jobs should be disabled on forks. It currently is quite annoying to do this, see https://github.community/t/github-event-repository-fork-context-does-detect-forks-in-scheduled-jobs/185925/3