Skip to content

fix: add missing --app argument to executor tasks subparser#32

Merged
santanusinha merged 1 commit into
PhonePe:masterfrom
Krish171205:fix/executor-tasks-missing-app-arg
Jul 8, 2026
Merged

fix: add missing --app argument to executor tasks subparser#32
santanusinha merged 1 commit into
PhonePe:masterfrom
Krish171205:fix/executor-tasks-missing-app-arg

Conversation

@Krish171205

Copy link
Copy Markdown
Contributor

Problem

drove executor tasks <executor-id> crashes with AttributeError: 'Namespace' object has no attribute 'app' when any tasks exist on the executor.

Root cause: plugins/executors.py line 125 references options.app to filter tasks by source app, but the tasks subparser (lines 35-39) never defines the --app argument. The drove tasks list command in plugins/tasks.py correctly defines this argument.

The existing test (test_executor_tasks_succeeds) didn't catch this because the mock server's executor had an empty tasks list, so the buggy code path was never reached.

Fix

  • Added --app / -a argument to the executor tasks subparser, matching the pattern in plugins/tasks.py
  • Added task seed data to the mock executor in tests/mock_server.py
  • Added 3 new offline tests that verify the fix

Testing

All offline tests pass (pytest -m offline):

  • test_executor_tasks_shows_task_data - verifies tasks are displayed when present
  • test_executor_tasks_app_filter_shows_match - verifies --app shows matching tasks
  • test_executor_tasks_app_filter_excludes_nonmatch - verifies --app hides non-matching tasks

The show_tasks() method in executors.py references options.app to filter tasks by source app name, but the tasks subparser never defines the --app argument. This causes an AttributeError when any tasks exist on the executor.

Changes:

- Add --app/-a argument to executor tasks subparser (matching tasks.py)

- Add task seed data to mock server so tests exercise the code path

- Add 3 offline tests for executor tasks with --app filtering
@santanusinha santanusinha merged commit f71e1a0 into PhonePe:master Jul 8, 2026
0 of 3 checks passed
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 this pull request may close these issues.

2 participants