Skip to content

conform now guarantees order of configuration options#8

Open
0xAX wants to merge 1 commit into
xerions:masterfrom
0xAX:conform-order-guranteed
Open

conform now guarantees order of configuration options#8
0xAX wants to merge 1 commit into
xerions:masterfrom
0xAX:conform-order-guranteed

Conversation

@0xAX

@0xAX 0xAX commented Nov 20, 2015

Copy link
Copy Markdown
Member

No description provided.

@0xAX

0xAX commented Nov 20, 2015

Copy link
Copy Markdown
Member Author

@thz this patch provides functional that we talked about. Waiting for review from somebody.

It also provides test in the test/integration_test.exs ():

 test "for the complex data types" do
....

and config (test/confs/complex_example.conf) which represents current behaviour.

@grundrauschen

Copy link
Copy Markdown

I tried this test and get, for a more complex configuration, a response with wrong order.
For a configuration with test.*.foo and test.*.bar I tried the following in the app.conf

test.egg3.foo = "string1"
test.egg3.bar = "string2"
test.egg0.foo = "string3"
test.egg0.bar = "string4"
test.egg1.foo = "string5"
test.egg1.bar = "string6"

and the result in mix conform.effective was

...
{:test, 
  [egg3: [foo: "string1", bar: "string2"],
  egg1: [foo: "string5", bar: "string6"],
  egg0: [foo: "string3", bar: "string4]]},
...

So the order is not preserved in the resulting list.

@0xAX

0xAX commented Dec 4, 2015

Copy link
Copy Markdown
Member Author

Hello

I've update the PR.

cc: @thz @grundrauschen

@grundrauschen

Copy link
Copy Markdown

@0xAX: as far as I can tell from a few tests, the branch works now as intended.

@surik

surik commented Dec 8, 2015

Copy link
Copy Markdown
Member

The diff has a lot of unrelated changes with code style. Please clean it up.

@surik

surik commented Dec 8, 2015

Copy link
Copy Markdown
Member

Does somebody know usecase of this PR?
Is it really important to have this

...
{:test, 
  [egg3: [foo: "string1", bar: "string2"],
   egg0: [foo: "string3", bar: "string4"],
   egg1: [foo: "string5", bar: "string6]]},
...

instead of

{:test, 
  [egg3: [foo: "string1", bar: "string2"],
   egg1: [foo: "string5", bar: "string6"],
   egg0: [foo: "string3", bar: "string4]]},
...

in sys.config for

test.egg3.foo = "string1"
test.egg3.bar = "string2"
test.egg0.foo = "string3"
test.egg0.bar = "string4"
test.egg1.foo = "string5"
test.egg1.bar = "string6"

?

@surik

surik commented Dec 8, 2015

Copy link
Copy Markdown
Member

OK. Looks it is useful for some routing-rules with matching

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.

3 participants