A Warm Welcome to Erna

Besides the usual variables like Slack tokens and database information, the variables that affect the lunch dates and how they are arranged are of particular interest.Not only the desired group size and the necessary locations with their timezones can be defined, but also the detailed time-of-day: time, weekday, week number..The aim was to make the passing of environment variables as simple as possible..Not only the file format, but also the values themselves..Thus, .env files can be defined, which are either recognized and loaded directly by erna, or can be specified during deployment.A typical file might look like this:TOKEN=xoxb-123456-7890SECRET=oursupersecretslacksecretDB=mongodb://username:password@one.myinstance.com:27017LOCATIONS=#America/Chicago:Austin#Europe/Berlin:Berlin,MunichMATCH_TIME=10:00MATCH_DAY=TUEMATCH_SIZE=3MATCH_INTERVAL=1,3ManagementWe have developed our own module for erna, which validates and handles environment variables..The reason for this is, on the one hand, that the necessary environment variables are often needed in different representations inside the Slack bot..On the other hand, this should simplify extensibility and increase comprehensibility.The schema to be passed defines which variables are required, their default values, RegEx patterns to be matched and how to transform the input.DB: { name: 'db', default: undefined, props: { url (x) { return x }, type (x) { if (!x) { return x } const url = new URL(x.split(',')[0]) return url.protocol.slice(0, -1) } }}The above example shows the definition of the database variable, which enables access to the passed value via env.db.url and to the related protocol via env.db.type.Erna’s Role at car2goWell, how do we use erna at car2go?.Lunch Dates take place regularly — every first Monday of the month — at all locations..These lunch dates are made up of groups of 2–3 people, depending on whether the number of participants is even or odd..In order to have enough time, but at the same time to keep it up to date, the lunch dates are announced at 11:30 local time.In addition to the regular lunch dates, other events are scheduled by departments such as HR..A common example are our Welcome Days, where all newcomers are usually at one location and thus have the opportunity to get to know a colleague better while having lunch.You want to try erna by yourself, contribute something technical/editorial or spread the word about erna?.Have a look at our repository, there you will find all necessary information..We provide erna as an open source module — so there are no limits to your creativity and the use ????.car2go/ernaslack slash command to match people for having lunch github.comCheers,Felix. More details

Leave a Reply