Skip to content

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

Closed

Description

@athith-g

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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