-
Notifications
You must be signed in to change notification settings - Fork 344
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
Changing the library used to read the properties files #1733
Conversation
70d9fea
to
b09b717
Compare
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
b09b717
to
5190299
Compare
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
aefbfc9
to
54239a8
Compare
@haroon-sheikh thanks, this is indeed worth changing. Some builds are failing, let me know if you need any help in sorting these out. |
Yes please, I'm not sure why the tests are failing. All of them passing when I run it locally. Is there something environmental I need to do? |
Signed-off-by: Haroon Sheikh <[email protected]>
16837ef
to
c051233
Compare
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Should be okay now @sriv, can you review for me please? |
Signed-off-by: Haroon Sheikh <[email protected]>
Benchmark Results
Notes
See Workflow log for more details. |
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
85eb647
to
e3d069e
Compare
Signed-off-by: Haroon Sheikh <[email protected]>
40dbe38
to
37e80d7
Compare
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
Signed-off-by: Haroon Sheikh <[email protected]>
hi @haroon-sheikh - the change makes it better, but I still feel that ex: with
whereas this change shows:
The cyclic graph is missing, and I worry that it can be hard to locate it when it happens. |
@sriv Thanks for reviewing and I completely agree with you. I'm now thinking if we should actually do this update. I was looking to implement a simpler solution so that we remove custom code but it looks like with our requirements, it's required to implement our own version of properties module. Shall we leave it as is for now? |
I think we should address the fact that the current dependency is not maintained. And I appreciate all the work that has gone into this PR. I'll take a shot at looking at some way to get the cyclic graph in. Since this fixes #1734 (which I believe is more important than the cyclic deps), I'd like this to be pursued (and am happy to help get this in). All this deliberation is just because this is sort of regressing :( |
Yes please, I'm happy for you to takeover from here to fix the regression if you've got some time. |
Signed-off-by: Haroon Sheikh <[email protected]>
ac216f9
to
2a77941
Compare
I've pushed another failing test if you can have a look at that also please. |
hi @haroon-sheikh I finally got to spend some more time on this. I felt the best place for this change would still be in the upstream, so I've raised another pull request: magiconair/properties#50 |
@haroon-sheikh magiconair/properties#50 is now merged and released. Can you please try updating the dep? Also, note instead of |
Signed-off-by: Haroon Sheikh <[email protected]>
Thanks @sriv. I've now updated the lib and failing unit tests. There's a unit test scenario |
Thanks @haroon-sheikh . @BugDiver has accepted to look into this further. |
@haroon-sheikh I looked into the PR. The failing test is because of the way we are substituting the env. We parse the env To fix it I tried using IMO library method should return an error instead of panicking. I trying to find a way if I can recover from panic and create a proper error message. |
Thanks for looking into this @BugDiver. I think one of the problems in the new lib is that the files take priority over env vars. And we want env vars to take precedence instead. Do you think it's worth us creating our own properties module in the project (or is it an overkill)? This can then later be shared in other projects. That would let us define the logic in the way we want. |
True
Not sure if it will be overkill. But I think it's quite an effort Also since this lib panic on errors, it's hard for us to give proper error messages. We can either submit patches to the lib or fork it and change it according to our requirements. |
@haroon-sheikh I have pushed a few changes to the |
Thanks @BugDiver. I've had a look at the env branch and it seems to do the job and all of the tests are passing too. |
@haroon-sheikh Thanks for the quick response. If you want you can rebase your PR with the branch, or I can raise a PR from that branch |
Please raise another PR and I'll close this one down. ;) |
Signed-off-by: Haroon [email protected]
Problem:
If a properties file has a lot of properties split into different sections by comments. E.g.
Then all of the properties below including prop2 is being skipped by the old properties reader and not set as env vars.
The dmotylev/goproperties library hasn't had any update since 2014 so it would be a good idea to move onto something like magiconair/properties which is more widely used.
Fixes #1734