nspcc-dev / nspcc-dev/neofs-node

Use `viper` to handle ENV variables in config

Open
#3,289 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blocked config dependencies enhancement I4 S3 U3
Dominant language
Go
Stars
38
Forks
51
Avg merge
1d 20h
Merged PRs (30d)
38

Description

Is your feature request related to a problem? Please describe.

I'm always frustrated when we write our own ENV variable handler when it can be solved using the library viper.

Describe the solution you'd like

Update the viper library to the version when there is a built-in handler for ENV variables in the function UnmarshalExact and do not use your own handler.

Describe alternatives you've considered

Keep it as is, it works.

Additional context

The main feature has already been implemented https://github.com/spf13/viper/pull/1429, but now it is experimental and has some problems, for example https://github.com/spf13/viper/issues/1732.
Own handler has appeared in #3247 and #3288.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the current ENV-variable handler introduced in #3247 and #3288, then review Viper's UnmarshalExact support in PR #1429 and the limitations described in issue #1732. Done means the dependency uses a suitable Viper version and the project's own handler is no longer used without regressing configuration behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.