Skip to content

Ageris 0.3.0

Choose a tag to compare

@lichtsinn lichtsinn released this 10 Oct 23:48
· 35 commits to master since this release

Ageris 0.3.0 adds targeting: a feature flag, config or policy can now apply to a list of values and to a percentage of callers.

Get it

<dependency>
    <groupId>io.github.lichtsinn</groupId>
    <artifactId>ageris-core</artifactId>
    <version>0.3.0</version>
</dependency>
implementation 'io.github.lichtsinn:ageris-core:0.3.0'

Requires Java 17 or later.

Targeting

A modifier picks a nested entry by the exact value of its context type. It can now also hold rules for the values that have no entry of their own:

"modifiers": {
  "type": "user",
  "contexts": { "joe": { "value": true } },
  "rules": [
    { "in": ["anna", "ben"], "value": true },
    { "percent": 10, "value": true }
  ]
}

The feature flag is on for joe, for anna and ben, and for 10 percent of the other users.

  • At each level a named entry in contexts wins, then the rules are tried from top to bottom, then the value of that level applies.
  • A percentage is decided by hashing the caller's value together with the name of the feature flag or config. Nothing is stored, the same caller always gets the same answer, and raising a percentage keeps everyone who was in.
  • Rules work for feature flags, configs, JSON configs and policies alike, so a policy can be rolled out to a share of users.
  • A lookup through rules creates no objects, like every other lookup.
  • A malformed rule is refused when the file is loaded, and what was loaded before keeps being served.

See Targeting in the README.

Before you use rules in a file

Upgrade every application that reads the file first. An application on Ageris 0.2.0 does not know rules:

  • With the defaults it cannot load the entry and keeps the configuration it loaded before.
  • If it was told to skip entries it cannot load, it stops serving that entry.
  • If it was given a JSON mapper that ignores unknown properties, it loads the entry and leaves the rules out, without a failure.

Files without rules mean what they meant in 0.2.0. The build now loads files in the 0.2.0 format and checks their answers, so that this stays true.

Also changed

  • The failure of an entry now names the entry: Cannot read enable-checkout: .... Before, the message began with the name of a Java exception. The file and the application are still named in front of it.
  • The build runs on Java 17 as well as Java 25.

Dependencies

Unchanged from 0.2.0: Jackson 2.22, slf4j 2.0 and commons-io 2.22. The library is also tested with Jackson 2.15.4, slf4j 1.7.36 and commons-io 2.11.0.