- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 70
 
feat(worker): make qgis jobs defined in a single file #1367
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
Conversation
a41db4a    to
    04bf260      
    Compare
  
    e9c77f0    to
    08d6500      
    Compare
  
    8741d20    to
    f10e6a9      
    Compare
  
    The utils.py is way too complex with all the functionality in there.
Make sure the steps in a workflow are always unique.
Used by projects based on QFieldCloud but need to modify the existing jobs.
Instead of having `QfcBaseWorkflow.handle` to take care of building the workflow and making sure the `feedback.json` is generated, we make the `handle` still prepare the `feedback.json`, but now in the base class and the new method `get_workflow` must be implemented in the children. This also allow for easier extension of already existing jobs.
…ting all of them in `_run_docker`
…that returns job mapping
…ing the job type
it should always been `upload_project_directory` as there is no export
f10e6a9    to
    30c5e52      
    Compare
  
    | return { | ||
| Job.Type.PACKAGE: PackageJobRun, | ||
| Job.Type.DELTA_APPLY: DeltaApplyJobRun, | ||
| Job.Type.DELTA_APPLY: ApplyDeltaJobRun, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I promise one day we also change the DELTA_APPLY name with APPLY_DELTA. I am sorry for the dislexic name I introduced back then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted that down for the follow up task to make the Job.Type extensible (so that custom jobs are correctly displayed in the admin)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you already have CU task? Can you post a link here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR restructures the QGIS worker to consolidate job definitions into a single file architecture. It addresses the problem where job definitions required changes across multiple files and makes extending QFieldCloud with custom jobs easier.
- Consolidates QGIS worker job definitions from multiple scattered files into a unified command-based architecture
 - Introduces a new workflow system that enables better testability and extensibility
 - Restructures entrypoint.py to use the new command system instead of hardcoded functions
 
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description | 
|---|---|
| scripts/check_envvars.sh | Updates environment variable exclusion list for new debug variable | 
| docker-qgis/qfc_worker/workflow.py | New workflow execution framework with step-based processing | 
| docker-qgis/qfc_worker/utils.py | Removes workflow classes moved to separate workflow.py file | 
| docker-qgis/qfc_worker/exceptions.py | New centralized exception definitions extracted from utils.py | 
| docker-qgis/qfc_worker/commands_base.py | New command registration system and base class for QGIS commands | 
| docker-qgis/qfc_worker/commands/*.py | Refactored job implementations using the new command architecture | 
| docker-qgis/entrypoint.py | Simplified to delegate to the new command system | 
| docker-compose.override.local.yml | Updates debug environment variables for new development setup | 
| docker-app/worker_wrapper/wrapper.py | Refactored container execution and debug mounting logic | 
| docker-app/qfieldcloud/settings.py | Consolidated debug path settings | 
| docker-app/qfieldcloud/core/tests/test_delta.py | Minor test improvements for better error reporting | 
| docker-app/qfieldcloud/core/models.py | Added explicit project_id type annotation | 
| docker-app/qfieldcloud/core/management/commands/dequeue.py | Updated job class references and improved structure | 
| .env.example | Updated environment variable documentation | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| 
           @boardend can you have a look on this PR this week or the next week latest?  | 
    
| 
           Sure, will review and test over the weekend  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😍
| return { | ||
| Job.Type.PACKAGE: PackageJobRun, | ||
| Job.Type.DELTA_APPLY: DeltaApplyJobRun, | ||
| Job.Type.DELTA_APPLY: ApplyDeltaJobRun, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted that down for the follow up task to make the Job.Type extensible (so that custom jobs are correctly displayed in the admin)
| 
           @boardend thanks for the review!  | 
    
This PR addressed multiple problems:
entrypoint.py, custom file etcentrypoint.pyis overwrittenentrypoint.py, and one by running the file itself.