Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
athith-g opened this issue May 20, 2024 · 0 comments · Fixed by #178
Closed

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

athith-g opened this issue May 20, 2024 · 0 comments · Fixed by #178

Comments

@athith-g
Copy link
Contributor

athith-g commented May 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant