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

[Feature Request]: add conditions on profile deployment #343

Closed
1 task done
Guts opened this issue Nov 14, 2023 · 0 comments · Fixed by #492, #491, #481, #484 or #489
Closed
1 task done

[Feature Request]: add conditions on profile deployment #343

Guts opened this issue Nov 14, 2023 · 0 comments · Fixed by #492, #491, #481, #484 or #489
Assignees
Labels
enhancement New feature or request

Comments

@Guts
Copy link
Owner

Guts commented Nov 14, 2023

Context

Working with Grand Lyon to fit their IT needs which are:

  • QDT is launched through a scheduled task (GPO are not allowed)
  • every end-user belongs to various GIS groups

Description

The goal is to add rules that condition the profile's installation into QGIS profiles folder. Could be something like this:

  - name: Synchronize QGIS profiles between downloaded and installed
    uses: qprofiles-synchronizer
    with:
      sync_mode: only_new_version
      include:
        - profile_name: pvo
          rules:
            if: 'CG_SIG_PVO' in context.user.groups
        - profile_name: dryade
          rules:
            if: 'CG_SIG_ARB' in context.user.groups
        - profile_name: admin
          rules:
            if: 'QDT_USER_IS_QGIS_ADMIN' in context.user.environment

And in a profile.json:

{
  "$schema": "https://raw.githubusercontent.com/Guts/qgis-deployment-cli/main/docs/schemas/profile/qgis_profile.json",
  "name": "qdt_demo",
  "folder_name": "demo",
  "description": "Demo QGIS profile for QDT.",
  "author": "Oslandia",
  "email": "infos+qdt@oslandia.com",
  "version": "1.0.0",
  "rules": 
    {
     "value": "CG_SIG_PVO*",
     "conditions": "in",
     "target": "context.user.groups"
    }
}

Related links

None

Use Cases

Deploy only

Visuals

No response

Before submitting

  • I have verified that my idea is a change request and not a bug report.
@Guts Guts added enhancement New feature or request triage To be qualified, waiting for a project manager to be funded Requires financial support to be solved labels Nov 14, 2023
@Guts Guts self-assigned this Nov 14, 2023
@Guts Guts removed the triage To be qualified, waiting for a project manager label Nov 14, 2023
Guts added a commit that referenced this issue Feb 22, 2024
This PR is part of #343 and of a whole refactoring.

In this PR:

- deprecating `qprofiles-manager`
- update related documentation and JSON schemas
- remove some outdated source code

## Migration guide

Before:

```yaml
[...]
steps:
  - name: Download profiles from remote git repository and synchronize with installed profiles
    uses: qprofiles-manager
    with:
      source: https://github.com/Guts/qgis-deployment-cli.git
      protocol: git_remote
      sync_mode: overwrite
      branch: main
[...]
```

After:

```yaml
[...]
steps:
  - name: Download profiles from remote git repository
    uses: qprofiles-downloader
    with:
      source: https://github.com/Guts/qgis-deployment-cli.git
      protocol: git_remote
      branch: main

  - name: Synchronize downloaded profiles with installed ones
    uses: qprofiles-synchronizer
    with:
      sync_mode: overwrite
[...]
```
@Guts Guts mentioned this issue Apr 5, 2024
2 tasks
@Guts Guts removed the to be funded Requires financial support to be solved label Apr 8, 2024
Guts added a commit that referenced this issue Apr 18, 2024
This PR adds a mechanism to allow QGIS profile editors to condition
their deployment with a minimalist system of rules that can be edited in
the `profile.json` file.

## Featured changes

- [x] add a minimal rules engine
- [x] add a demonstration profile which is deployed only on Linux

## Example

```json
{
  "$schema": "https://raw.githubusercontent.com/Guts/qgis-deployment-cli/main/docs/schemas/profile/qgis_profile.json",
  "name": "QDT Only Linux",
  "folder_name": "qdt_only_linux",
  "description": "Demonstrating a QDT profile that's deployed only on Linux.",
  "author": "Julien Moura",
  "email": "infos+qdt@oslandia.com",
  "qgisMinimumVersion": "3.34.0",
  "qgisMaximumVersion": "3.99.10",
  "version": "1.0.0",
  "rules": [
    {
      "name": "Environment",
      "description": "Profile is configured to run only on Linux.",
      "conditions": {
        "all": [
          {
            "path": "$.environment.operating_system_code",
            "value": "linux",
            "operator": "equal"
          }
        ]
      }
    }
  ]
}

```


## Other changes 

It also initiates a change in the documentation organization to comply
with https://documentation.divio.com/.

## Related to

- #343
- #393 will add the ability to condition the deployment to Active
Directory groups
Guts added a commit that referenced this issue Apr 19, 2024
@Guts Guts closed this as completed in #492 Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment