Missing Schema file

Created on 10 March 2023, almost 2 years ago
Updated 27 October 2023, about 1 year ago

We should have a schema for usage_data.settings and it's plugins. It is currently non-existent.

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada b_sharpe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @b_sharpe
  • Assigned to elber
  • πŸ‡§πŸ‡·Brazil elber Brazil

    I will work on it

  • @elber opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • πŸ‡§πŸ‡·Brazil elber Brazil

    Hi I added a basic schema file, this was the first time that I created a schema file please revise.

  • Status changed to Needs work about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

    The bigger issue here is that each UsageType plugin should have its own config file.
    It's not really worth fussing with a schema file under the current architecture.

    The plugin settings should not be all lumped into one giant settings file.

    Consider: if a 3rd party wants to extend usage_data.settings.yml, there's no way to ship the module with its own config, because the module needs to update a settings file from usage_data.

    The schema file should include a schema like:

    usage_data.usage_type.*:
        type: config_entity
        label: 'Usage Data Type'
        mapping:
          id:
            type: string
            label: 'UsageType Plugin ID'
          uuid:
            type: string
            label: 'UUID'
          enabled:
            type: boolean
            label: 'Enable or disable the plugin'
          use_queue:
            type: boolean
            label: 'Use queue to process items'
          dependencies:
            type: config_dependencies
            label: 'Dependencies'
    

    Which would result in config files like the following, for example:
    - usage_data.usage_type.generic.yml
    - usage_data.usage_type.legacy.yml
    - usage_data.usage_type.generic_counter.yml

    The plugin manager would also need to be adjusted (significantly?) to handle these configs.

  • @aaronbauman opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

    Opened new MR 25 with the proposed changes.

    These will be breaking changes for anyone on an existing alpha.
    Requires re-saving the Usage Data settings form.

  • πŸ‡¨πŸ‡¦Canada b_sharpe

    @AaronBauman nice, I agree that each plugin should have it's own config; however, I do think we could change this to have an update hook to convert old config into new and not break existing installs. I'll take a stab at it if I can get some time next week.

Production build 0.71.5 2024