Skip to content

Meaningful error message missed on crash. #39

@redmitry

Description

@redmitry

The 'howfairis' plugin requires GITHUB_ACTION_TOKEN variable to be set.
When no variable is provided the execution fails with

(.venv) root@everse-playground:/opt/QualityPipelines# resqui -u https://github.com/elixir-europe/beacon-network-backend
Loading default configuration.
GitHub API token ✖
Repository URL: https://github.com/elixir-europe/beacon-network-backend
Project name: beacon-network-backend
Author: redmitry
Email: redmitry@list.ru
Version: v0.0.13-1-g3f74fbd
Branch, tag or commit hash: 3f74fbdb40887faaa61d5b9078cc1ed8a307e253
Checking indicators ...
  has_license/HowFairIs (0.0s): Traceback (most recent call last):
  File "/opt/QualityPipelines/.venv/bin/resqui", line 8, in <module>
    sys.exit(resqui())
             ^^^^^^^^
  File "/opt/QualityPipelines/.venv/lib/python3.12/site-packages/resqui/cli.py", line 209, in resqui
    results = getattr(plugin_instance, plugin_method)(url, branch_hash_or_tag)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/QualityPipelines/.venv/lib/python3.12/site-packages/resqui/plugins/howfairis.py", line 31, in has_license
    result = self.executor.execute(script)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/QualityPipelines/.venv/lib/python3.12/site-packages/resqui/executors/python.py", line 62, in execute
    return subprocess.run(
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.12/subprocess.py", line 1872, in _execute_child
    env_list.append(k + b'=' + os.fsencode(v))
                               ^^^^^^^^^^^^^^
  File "<frozen os>", line 818, in fsencode
TypeError: expected str, bytes or os.PathLike object, not NoneType

Absent GITHUB_ACTION_TOKEN variable is just set no None, then fails.

IMHO plugins should warn when they couldn't proceed and just skip the indicator.

Best,

Dmitry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions