When called from distillery as a provider, config isn't actually merged an instead is overrwritten for any app in the TOML config.

オープン
#26 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

@idyll がすでに取り組んでいます。

2020年5月23日 から。

  • #27 @idyll による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
elixir
領域
tooling

調査の方向性

init が load([], opts) を呼び出す load 内の Distillery ブランチを、persist とその Config.Reader.merge 呼び出しまで追跡します。既存のアプリケーション設定がどこで利用可能になるかを特定します。Distillery provider として使用したときに、入力された TOML 設定が既存のアプリケーションレベルの設定を上書きせずにマージされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

When called from distillery as a provider, config isn't actually merged and instead is overrwritten for any app in the TOML config.

It's unclear to me if we should be solving this here or at the Distillery level, however other config providers appear to solve it internally...

The issue is that persist tries to merge the incoming config, but with Distillery the incoming config is always empty.

    defp persist(config, keyword) when is_list(keyword) do
      config = Config.Reader.merge(config, keyword)
      Application.put_all_env(config, persistent: true)
      config
    end

In persist config is always [] when called from Distillery because load is called as:

    if is_distillery_env?() do
      # When running under Distillery, init performs load
      load([], opts)
      opts
    else

Because of this we end up with any existing config being overwritten on an application level.

主要言語
Elixir
スター
206
フォーク
33
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bitwalker/toml-elixir のほかの issue

bitwalker/toml-elixir の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。