Skip to content

feat(jobs): add new job qglobal-config-manager for qgis_global_settings.ini copy - #781

Open
jmkerloch wants to merge 30 commits into
mainfrom
feat/qglobal_config_manager
Open

feat(jobs): add new job qglobal-config-manager for qgis_global_settings.ini copy#781
jmkerloch wants to merge 30 commits into
mainfrom
feat/qglobal_config_manager

Conversation

@jmkerloch

@jmkerloch jmkerloch commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

QGIS global config manager

qgis_global_settings.ini file contains global settings for all QGIS profile.

This PR introduces a new job qglobal-config-manager that can be added to a scenario to use a custom file during deployment :

  - name: Handle the qgis_global_settings.ini file
    uses: qglobal-config-manager
    with:
      src: ./global/qgis_global_settings.ini
      dst: ~/config/qgis/global_settings.ini

The job handles:

  • conversion of src and dst for environment variable use
  • download of the src .ini file if the input is an url
  • copy of the src .ini file to the dst .ini file
  • conversion of environment variable in the src .ini
  • define QGIS_GLOBAL_SETTINGS_FILE user environment variable with dst .ini file path

Default values

If no value defined in jobs, default values are used. The value is defined with the same behavior as QGIS :

  • first use QGIS_GLOBAL_SETTINGS_FILE
  • if not defined, use AppDataLocation folder:
    • Linux: $HOME/.local/share/QGIS/QGIS3/
    • Windows : C:\Users\<username>\%AppData%\Roaming\QGIS\QGIS3\
    • MacOS : $HOME/Library/Application Support/QGIS/QGIS3/
  • if file doesn't exists :
    • the installation directory, i.e., your_QGIS_package_path/resources/qgis_global_settings.ini
    • to define the QGIS package path we use QDT_QGIS_EXE_PATH environment variable

Relative src option

src can be a relative path. In this case we check for .ini file related to:

  • repository folder from current scenario
    • when the job qprofiles-synchronizer is run, all profiles repository are stored in a local repositories folder : <qdt_working_folder>/respositories/<scenario_id>
    • .ini file can be stored in profile repository and defined with a relative src : ./myprofile/qgis_global_settings.ini
  • qdt local working directory.
    • can be defined with QDT_LOCAL_WORK_DIR environment variable

Funded by ANFSI (cc @Niarolf ).

@jmkerloch jmkerloch self-assigned this Mar 23, 2026
@github-actions github-actions Bot added jobs Scenarios and jobs quality Tests, project resiliency, etc. labels Mar 23, 2026
@codecov

codecov Bot commented Mar 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.82143% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...oyment_toolbelt/jobs/job_qglobal_config_manager.py 86.20% 9 Missing and 3 partials ⚠️
qgis_deployment_toolbelt/constants.py 70.58% 1 Missing and 4 partials ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #781      +/-   ##
==========================================
+ Coverage   73.24%   73.89%   +0.65%     
==========================================
  Files          50       51       +1     
  Lines        3509     3620     +111     
  Branches      621      640      +19     
==========================================
+ Hits         2570     2675     +105     
- Misses        707      709       +2     
- Partials      232      236       +4     
Flag Coverage Δ
unittests 73.23% <83.92%> (+0.64%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
qgis_deployment_toolbelt/jobs/orchestrator.py 90.90% <100.00%> (+0.28%) ⬆️
...s_deployment_toolbelt/profiles/qgis_ini_handler.py 72.61% <100.00%> (+4.10%) ⬆️
qgis_deployment_toolbelt/constants.py 78.94% <70.58%> (-1.23%) ⬇️
...oyment_toolbelt/jobs/job_qglobal_config_manager.py 86.20% <86.20%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Mar 23, 2026
@jmkerloch jmkerloch changed the title Feat/qglobal config manager feat(jobs): add new job qglobal-config-manager for qgis_global_settings.ini copy Mar 23, 2026
@jmkerloch
jmkerloch marked this pull request as ready for review March 23, 2026 16:21
@jmkerloch
jmkerloch marked this pull request as draft March 23, 2026 17:04
@jmkerloch
jmkerloch force-pushed the feat/qglobal_config_manager branch from 703c4f5 to 1bb727d Compare March 24, 2026 08:16
@jmkerloch
jmkerloch marked this pull request as ready for review March 24, 2026 08:21
@jmkerloch

Copy link
Copy Markdown
Contributor Author

@Guts examples/scenarios/demo-scenario-global-config.qdt.yml will be updated before merge to indicate main branch. I keep feat/qglobal_config_manager now for test purpose.

@jmkerloch
jmkerloch requested a review from Guts March 24, 2026 08:22
@Guts

Guts commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

@jmkerloch
jmkerloch force-pushed the feat/qglobal_config_manager branch from aa60943 to cfac0c7 Compare March 26, 2026 15:27
@jmkerloch

Copy link
Copy Markdown
Contributor Author

@jmkerloch can you add the corresponding JSON schema into https://github.com/qgis-deployment/qgis-deployment-toolbelt-cli/tree/feat/qglobal_config_manager/docs/schemas/scenario/jobs please?

For sure 🕶️ I added a commit.

@jmkerloch
jmkerloch force-pushed the feat/qglobal_config_manager branch from cfac0c7 to 5334868 Compare April 2, 2026 14:44
@Guts
Guts force-pushed the feat/qglobal_config_manager branch 3 times, most recently from 09c52e7 to e2be9ce Compare May 4, 2026 16:52

@Guts Guts left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First review mainly reading documentation and code.
Next: try locally.

Comment thread docs/jobs/qglobal_config_manager.md Outdated
Comment thread docs/jobs/qglobal_config_manager.md Outdated
Comment thread docs/jobs/qglobal_config_manager.md Outdated
Comment thread docs/jobs/qglobal_config_manager.md Outdated
Comment thread docs/jobs/qglobal_config_manager.md Outdated
Comment thread examples/scenarios/demo-scenario-global-config.qdt.yml
Comment thread examples/scenarios/demo-scenario-global-config.qdt.yml Outdated
Comment thread qgis_deployment_toolbelt/jobs/job_qglobal_config_manager.py Outdated
Comment thread qgis_deployment_toolbelt/jobs/job_qglobal_config_manager.py Outdated
Comment thread qgis_deployment_toolbelt/jobs/job_qglobal_config_manager.py Outdated
@Guts Guts assigned Guts and unassigned jmkerloch May 4, 2026
@Guts Guts added the enhancement New feature or request label May 4, 2026
@Guts
Guts force-pushed the feat/qglobal_config_manager branch 6 times, most recently from b59969e to dd24ebd Compare May 6, 2026 06:47
jmkerloch and others added 22 commits May 31, 2026 15:32
- from qdt local working dir
- from qdt downloaded repository
Co-authored-by: Julien <1596222+Guts@users.noreply.github.com>
Signed-off-by: Julien <1596222+Guts@users.noreply.github.com>
Util has been introduced in #830

Funded by Oslandia

<!-- osl:grant-oss-2026 -->
…ts depending on current operating system

Util has been introduced in #833

Funded by ANFSI
@Guts
Guts force-pushed the feat/qglobal_config_manager branch from b817216 to 03864bc Compare May 31, 2026 13:32
@sonarqubecloud

Copy link
Copy Markdown

@Guts Guts modified the milestones: 0.43.1, 0.44.0 Jun 2, 2026
@sonarqubecloud

Copy link
Copy Markdown

Comment thread tests/test_constants.py
environ.pop("QGIS_CUSTOM_CONFIG_PATH")
unsetenv("QGIS_CUSTOM_CONFIG_PATH")

def test_get_qgis_global_settings_file(self):
Comment thread tests/test_constants.py
Path(expandvars("%APPDATA%/QGIS/QGIS3/qgis_global_setting.ini")),
)

def test_get_qgis_global_settings_file_custom(self):
environment variable for file use in QGIS."""

# Define source file
src_path = self.get_src_ini_file(self.options.get("src", None))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request jobs Scenarios and jobs quality Tests, project resiliency, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants