Improve type annotation of job runners#21050
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request improves type annotations of job runners by adding proper type hints and updating various job runner classes for better type safety. The changes also include several related bug fixes and code improvements.
Key changes:
- Added proper type annotations to job runner constructors, methods, and parameters
- Fixed type-related issues in test files by adding proper type casting
- Updated AsynchronousJobState parameter ordering and improved type safety
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/app/jobs/test_runner_local.py | Added type casting for MinimalJobWrapper compatibility |
| test/unit/app/jobs/test_job_wrapper.py | Fixed type annotations and removed type ignore comments |
| lib/galaxy/jobs/runners/univa.py | Updated type annotations for DRMAAJobState |
| lib/galaxy/jobs/runners/tasks.py | Added comprehensive type annotations and assertions |
| lib/galaxy/jobs/runners/slurm.py | Fixed return type annotations and added explicit returns |
| lib/galaxy/jobs/runners/pulsar.py | Improved type safety and fixed parameter ordering |
| lib/galaxy/jobs/runners/pbs.py | Updated type annotations and parameter consistency |
| lib/galaxy/jobs/runners/local.py | Enhanced type annotations and added type ignore comments |
| lib/galaxy/jobs/runners/kubernetes.py | Fixed parameter ordering and improved type annotations |
| lib/galaxy/jobs/runners/godocker.py | Updated type annotations and fixed parameter ordering |
| lib/galaxy/jobs/runners/drmaa.py | Added DRMAAJobState class and improved type safety |
| lib/galaxy/jobs/runners/condor.py | Enhanced constructor type annotations and fixed typo |
| lib/galaxy/jobs/runners/cli.py | Added type annotations and updated parameter ordering |
| lib/galaxy/jobs/runners/chronos.py | Fixed type annotations and parameter ordering |
| lib/galaxy/jobs/runners/aws.py | Updated type annotations and parameter ordering |
| lib/galaxy/jobs/runners/init.py | Added generic typing and improved base class annotations |
| lib/galaxy/jobs/init.py | Enhanced type annotations for job wrapper classes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| _write_logfile(job_state.error_file, reason) | ||
| job_state.running = False | ||
| job_state.stop_job = True | ||
| job_state.stop_job = False |
There was a problem hiding this comment.
The assignment should be job_state.stop_job = True to properly stop the job, not False.
| job_state.stop_job = False | |
| job_state.stop_job = True |
There was a problem hiding this comment.
No, this signals to the stop_job() method that the job on the cluster has already terminated and doesn't need to be stopped.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Including various related fixes.
How to test the changes?
(Select all options that apply)
License