Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

upgrade typesafe-config to version 1.3.1 (backport to 1.x branch) #177

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

mattnworb
Copy link
Member

a backport of #176 to the 1.x branch, assuming #176 makes sense in the first place.

@mattnworb mattnworb changed the title upgrade typesafe-config to version 1.3.1 upgrade typesafe-config to version 1.3.1 (backport to 1.x branch) Nov 4, 2016
The main purpose of the upgrade is to get access to the
`include required(...)` feature to have includes that fail if the
resource is not found.

For example, the config library already supports being able to include a
second config file from the main one, such as

```yaml
foo = bar
include file('/etc/something/else.conf')
```

however if the resource being included fails to load, no error message
is thrown by the typesafe-config library. This can be confusing if you
use the `include` flavor that looks like
`include '/etc/something/else.conf`, as the library uses some heuristics
to decide if that string represents a URL, a file, or a classpath entry,
and what it chooses might not be what is expected. No error is thrown if
the included resource cannot be loaded (whether you use `'path'` or
`file('path')`, which seems quite confusing if the developer is relying
on a second resource to be merged into the main config.

v1.3.1 adds support for a "required include" so that you can instead do

```yaml
foo = bar
include required(file('/etc/something/else.conf'))
```

[Changelog for the typesafe-config
library](https://github.com/typesafehub/config/blob/master/NEWS.md#131-september-24-2016).
The changelog for the 1.3.x family of releases warns about
ABI-incompatible changes compared to 1.2.x, but from a quick glance of
the changes I do not see anything related to features that Apollo uses.

One small additional improvement from the typesafe-config library now
being built on Java 1.8 is that for anyone using the
`long getDuration(String path, TimeUnit unit)` in `Config` there is now
an overload  for `java.time.Duration getDuration(String path)`.
@mattnworb mattnworb force-pushed the typesafe-config-1.3.1-backport branch from ef1d253 to 7a5d74d Compare November 4, 2016 18:35
@codecov-io
Copy link

codecov-io commented Nov 4, 2016

Current coverage is 69.47% (diff: 100%)

Merging #177 into 1.x will not change coverage

@@                1.x       #177   diff @@
==========================================
  Files           138        138          
  Lines          2880       2880          
  Methods           0          0          
  Messages          0          0          
  Branches        226        226          
==========================================
  Hits           2001       2001          
  Misses          836        836          
  Partials         43         43          

Powered by Codecov. Last update 3ea016c...7a5d74d

@pettermahlen pettermahlen merged commit e2aa146 into spotify:1.x Nov 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants