Project

Profile

Help

Story #5290

As a plugin writer, I can provide all of my settings with their defaults in one place.

Added by bmbouter 4 months ago. Updated 3 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Platform Release:
Blocks Release:
Backwards Incompatible:
No
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 58

Description

Problem

Currently pulp_ansible has several settings. There isn't a consolidated way currently for dynaconf to overlay settings from the pulp_ansible codebase onto the settings file provided by pulpcore.app.settings

Solution

1. Document in the plugin writer's guide a convention that settings should live in pluginname.app.settings

2. Then here you build the list of python paths to the settings file.

3. Then here you have dynaconf load those settings.

This needs to come with documentation for plugin writers and a release note in pulpcore-plugin, even though the changes will mostly occur in pulpcore.

Associated revisions

Revision 00bbe2ca View on GitHub
Added by Bruno Rocha 3 months ago

Add load of plugin default settings.

- Includes default settings from `{plugin_name}/app/settings.py`
- This settings overrides the data existing in `/etc/pulp/settings.py`
- This settings are overridden by env vars prefixed with `PULP_`
- So a good practice for plugin writers is to prefix the default configs with plugin name such as `RPM`, `FILE`, `ANSIBLE` etc...

example:

`ANSIBLE_SOMEKEY = 'value'` on settings.py can be overriden via `export PULP_ANSIBLE_SOMEKEY='othervalue'`

closes #5290

Revision 2120cd3b View on GitHub
Added by bmbouter 3 months ago

Add settings.py.j2 for plugin settings

Plugins now have their settings loaded when placed in the file at
``<your plugin>.app.settings.py``.

https://pulp.plan.io/issues/5290
closes #5290

Revision d2af5393 View on GitHub
Added by bmbouter 3 months ago

Add docs on programatic plugin settings

Plugin writers can add settings programatically using the docs provided
with this commit.

https://pulp.plan.io/issues/5290
closes #5290

History

#2 Updated by daviddavis 4 months ago

  • Groomed changed from No to Yes

#3 Updated by rochacbruno 4 months ago

Dynaconf PR: https://github.com/rochacbruno/dynaconf/pull/209

That RFC will be included in the next release

#4 Updated by rochacbruno 4 months ago

Dynaconf 2.0.4 released adding support for this issue to be resolved: https://github.com/rochacbruno/dynaconf/releases/tag/2.0.4

#5 Updated by Anonymous 4 months ago

  • Status changed from NEW to MODIFIED
  • % Done changed from 0 to 100

#6 Updated by bmbouter 4 months ago

  • Status changed from MODIFIED to ASSIGNED
  • Assignee set to bmbouter

@bruno awesome thanks! I'm bringing back to ASSIGNED so I can add documentation for plugin writers.

#7 Updated by bmbouter 3 months ago

  • Sprint set to Sprint 58

This was groomed for the last sprint planning but it did not have the Sprint actually set. This is needed for core to allow pulp_ansible to set settings so we need to have it on the sprint.

#8 Updated by bmbouter 3 months ago

  • Status changed from ASSIGNED to POST

#9 Updated by Anonymous 3 months ago

  • Status changed from POST to MODIFIED

#10 Updated by bmbouter 3 months ago

  • Status changed from MODIFIED to POST

#11 Updated by bmbouter 3 months ago

  • Status changed from POST to ASSIGNED

#12 Updated by bmbouter 3 months ago

  • Status changed from ASSIGNED to POST

#13 Updated by bmbouter 3 months ago

  • Status changed from POST to MODIFIED

#14 Updated by bmbouter 3 months ago

  • Status changed from MODIFIED to POST

PR for settings.py added to plugin_template: https://github.com/pulp/plugin_template/pull/104

Bringing back to POST for the docs PR to merge and move to MODIFIED.

#15 Updated by bmbouter 3 months ago

  • Status changed from POST to MODIFIED

Please register to edit this issue

Also available in: Atom PDF