eeverman / eeverman/andhow

Add tier specific properties file loading

Open
#665 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
25
Forks
34
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
It would be nice to automatically load a tier specific file based on a single Property that specifies the tier. Serverless does this - passing 'tier=qa' is enough to use a qa.yml file.

**Describe the solution you'd like**
Modify the StdPropFileOnClasspath loader to have a Tier property that is used by default to spec the tier. The default property should have a 'tier' alias. If no tier is spec'ed, 'andhow.properties' is used, but if spec'ed, the loader would look for 'tier.properties'. Configurable would be:
* Supply your own Property to customize the name of the Property used to spec tier
* Supply a name template for creating a name like 'qa_myapp.properties'. Perhaps w/ curly brace escaping? Or Java string format?

To consider:
* If tier is spec'ed and the file is not found, is that an error? Does it default to andhow.properties? What if both are missing? How does serverless handle this (or other examples?)
* Are 'tier' and the nominal file name orthogonal? Is it OK to spec both?

**Describe alternatives you've considered**
Another option would be to make this a separate loader. It seems like this isn't really a new loader - its just refinement of the class path prop loader. Whatever the solution, it should be the default b/c its a common need and it would be nice to solve it out of the box by convention (pass 'tier=x') rather than require a bunch of configuration.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.