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

Settings: use dry-configurable #1110

Closed
wants to merge 5 commits into from

Conversation

waiting-for-dev
Copy link
Member

Replaces #1105

Uses dry-configurable for the hanami settings.

We have broken apart what is the storage for the settings (ENV with dotenv enabled in our case) from what we actually do to load the settings in the config class. Both the store and the loader are configurable. Users could provide their own store as long as it implements the #fetch method. As for the loader, we can discuss whether it makes any sense to be injectable, as its behavior is very private, relying on dry-configurable dependency.

@solnic
Copy link
Member

solnic commented Jun 6, 2021

@waiting-for-dev could you rebase this? I've improved CI setup in the unstable branch.

waiting-for-dev and others added 5 commits June 7, 2021 12:09
This is a baby step towards the to-be-defined level of integration we
want between hanami settings and dry-configurable.

This commit introduces the minimal changes to keep the very same
features we're supporting on the hanami settings side while still
delegating to dry-configurable what it's already capable of handling:

- dry-configurable is responsible for the setter/getter methods.
- Hanami settings resolve the value through a type constructor, when
  present, before delegating it to dry-configurable.
- Hanami settings wrap the definition of all the settings to detect all
  errors at once instead of failing on a one-by-one basis.

Further integration can include delegating the type constructor to a
processor keyword argument (we could already delegate it to the block,
but probably we want to do the former) and provide an error handler to
the whole definition.
@waiting-for-dev
Copy link
Member Author

@waiting-for-dev could you rebase this? I've improved CI setup in the unstable branch.

Done @solnic

@waiting-for-dev
Copy link
Member Author

Closing in favor of #1114

@waiting-for-dev waiting-for-dev deleted the port_to_dry_configurable branch June 17, 2021 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants