Contributing

Last updated: oct.14, 2020 - 9:55:00

Overview

Hesperides consists of two parts :

  • a backend module developed in Java (repo git hesperides")
  • a frontend module developed in Angular JS (repo git hesperides-gui)

The architecture is detailed here: documentation/architecture on GitHub.

For more recent instructions, in French, on how to contribute: CONTRIBUTING.md.

Model and Valuation

Overview

Hesperides works with a principle of Model and Valuation. On the one hand we have a model (property name, annotation ) and on the other side valuation (property name/value). Model and valuation are not store together in database.

Actually :

  • model is not store, it is deducted from template/module. In fact, with the module (and its associated templates), we can extract the model : that's what Hesperides does.
  • platform (application) stores properties keys and values.

Example

If we consider the module module-test, version 1.0 and template appliaction.properties with the following content :

spring.datasource.jndi-name=jdbc/demoKatana
overload_property={{overload_property|@comment "some other comments" @required}}
password={{password|@comment "some comments" @password}}
default={{default|@default foo}}
regular_expression={{regular_expression|@pattern t.*t}}

Calling REST service /modules/module-test/1.0/workingcopy/model, we get this :

{
  "key_value_properties": [
    {
      "name": "regular_expression",
      "comment": null,
      "required": false,
      "defaultValue": "",
      "pattern": "t.*t",
      "password": false
    },
    {
      "name": "default",
      "comment": null,
      "required": false,
      "defaultValue": "foo",
      "pattern": "",
      "password": false
    },
    {
      "name": "password",
      "comment": "some comments",
      "required": false,
      "defaultValue": "",
      "pattern": "",
      "password": true
    },
    {
      "name": "overload_property",
      "comment": "some other comments",
      "required": true,
      "defaultValue": "",
      "pattern": "",
      "password": false
    }
  ],
  "iterable_properties": []
}

When REST service is called, the class HesperidesModuleResource receive it. Then we get the module (with class ModuleAggregate) and for each file we ask to mustache to give properties (class TemplateSlurper).

Now to get properties values, as they are stored in the platform, we can call REST service /applications/MYAPPLICATION/platforms/MY-PLATFORM/properties?path=#FIRSTLEVEL#SECONDLEVEL#module-test#1.0#WORKINGCOPY :

{
  "key_value_properties": [
    {
      "name": "overload_property",
      "value": "FOO"
    },
    {
      "name": "regular_expression",
      "value": "tfgehzrgyierhgergert"
    },
    {
      "name": "password",
      "value": "{{hesperides.application.version}}"
    },
    {
      "name": "missing",
      "value": "Where am I ?"
    }
  ],
  "iterable_properties": []
}

With model and platform, we can make the connection :

  • the "default" property is not valuated because it is in the model but not in the platform
  • the "missing" property has been deleted in the template because the property is in the platform but not in the model