elixir-cloud-aai / proTES

Proxy service for injecting middleware into GA4GH TES requests
Apache License 2.0
5 stars 6 forks source link

fix: Getting list of tasks not working without name prefix #175

Closed athith-g closed 1 month ago

athith-g commented 3 months ago

Describe the bug Making a GET request to the /tasks endpoint proTES with an empty body always returns an empty list of tasks, even when a task has been created. This is because of this line in task_runs.py. Without a name prefix, str(kwargs.get("name_prefix")) returns the string "None" meaning name_prefix is not None is always True. As a result, a filter of "^None" is applied when querying the db.

To Reproduce Steps to reproduce the behavior:

  1. Run proTES
  2. Create a task (POST to /tasks with valid body (e.g. {"executors": [{"image": "alpine", "command": ["echo", "hello"]}]})
  3. Get list of tasks (GET to /tasks with empty body)
  4. Task list is empty

Expected behavior The task list should contain the newly created task ID and status.

Screenshots POST request made successfully:

Screenshot 2024-05-20 at 2 15 27 PM

GET request returns empty task list:

Screenshot 2024-05-20 at 2 16 01 PM