Skip to content
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

prepare Ditto 3.5.0 release notes #1876

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ These versions of Eclipse Ditto are currently being supported with security upda

| Version | Supported |
|---------| ------------------ |
| 3.5.x | :white_check_mark: |
| 3.4.x | :white_check_mark: |
| 3.3.x | :white_check_mark: |
| < 3.3.0 | :x: |
| < 3.4.0 | :x: |

## Reporting a Vulnerability

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.text.MessageFormat;
import java.time.Duration;
import java.time.Period;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.Objects;
Expand Down Expand Up @@ -217,7 +218,10 @@ public enum DittoTimeUnit {
MILLISECONDS("ms", Duration::ofMillis, ChronoUnit.MILLIS),
MINUTES("m", Duration::ofMinutes, ChronoUnit.MINUTES),
HOURS("h", Duration::ofHours, ChronoUnit.HOURS),
DAYS("d", Duration::ofDays, ChronoUnit.DAYS);
DAYS("d", Duration::ofDays, ChronoUnit.DAYS),
WEEKS("w", weeks -> ofPeriodGreaterThanDays(Period.ofWeeks((int) weeks)), ChronoUnit.WEEKS),
MONTHS("mo", months -> ofPeriodGreaterThanDays(Period.ofMonths((int) months)), ChronoUnit.MONTHS),
YEARS("y", years -> ofPeriodGreaterThanDays(Period.ofYears((int) years)), ChronoUnit.YEARS);

private final String suffix;
private final LongFunction<Duration> toJavaDuration;
Expand All @@ -243,6 +247,13 @@ public static Optional<DittoTimeUnit> forSuffix(final String suffix) {
.findAny();
}

private static Duration ofPeriodGreaterThanDays(final Period period) {
final Duration years = ChronoUnit.YEARS.getDuration().multipliedBy(period.getYears());
final Duration months = ChronoUnit.MONTHS.getDuration().multipliedBy(period.getMonths());
final Duration days = ChronoUnit.DAYS.getDuration().multipliedBy(period.getDays());
return years.plus(months).plus(days);
}

public Matcher getRegexMatcher(final CharSequence duration) {
return regexPattern.matcher(duration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.mutabilitydetector.unittesting.MutabilityMatchers.areImmutable;

import java.time.Duration;
import java.time.temporal.ChronoUnit;

import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.Test;
Expand Down Expand Up @@ -112,6 +113,30 @@ public void createDittoDurationFromStringDays() {
assertThat(dittoDuration.getDuration()).isEqualTo(Duration.ofDays(durationValue));
}

@Test
public void createDittoDurationFromStringWeeks() {
final short durationValue = 5;
final DittoDuration dittoDuration = DittoDuration.parseDuration(durationValue + "w");

assertThat(dittoDuration.getDuration()).isEqualTo(ChronoUnit.WEEKS.getDuration().multipliedBy(durationValue));
}

@Test
public void createDittoDurationFromStringMonths() {
final short durationValue = 2;
final DittoDuration dittoDuration = DittoDuration.parseDuration(durationValue + "mo");

assertThat(dittoDuration.getDuration()).isEqualTo(ChronoUnit.MONTHS.getDuration().multipliedBy(durationValue));
}

@Test
public void createDittoDurationFromStringYears() {
final short durationValue = 3;
final DittoDuration dittoDuration = DittoDuration.parseDuration(durationValue + "y");

assertThat(dittoDuration.getDuration()).isEqualTo(ChronoUnit.YEARS.getDuration().multipliedBy(durationValue));
}

@Test
public void createDittoDurationFromStringWithAndWithoutSecondsIsEqual() {
final byte durationValue = 23;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void acceptDittoDurationStringWithNegativeAmount() {

@Test
public void acceptDittoDurationStringWithInvalidTimeUnit() {
final String invalidDittoDurationString = "1w";
final String invalidDittoDurationString = "1a";

assertThatExceptionOfType(DittoHeaderInvalidException.class)
.isThrownBy(() -> underTest.accept(DittoHeaderDefinition.TIMEOUT, invalidDittoDurationString))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void acceptDittoDurationStringWithNegativeAmount() {

@Test
public void acceptDittoDurationStringWithInvalidTimeUnit() {
final String invalidDittoDurationString = "1y";
final String invalidDittoDurationString = "1a";

assertThatExceptionOfType(TimeoutInvalidException.class)
.isThrownBy(() -> underTest.accept(DittoHeaderDefinition.TIMEOUT, invalidDittoDurationString))
Expand Down
2 changes: 2 additions & 0 deletions documentation/src/main/resources/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ plugins:
docVersions:
- label: "development"
basePath: ""
- label: "3.5"
basePath: "3.5"
- label: "3.4"
basePath: "3.4"
- label: "3.3"
Expand Down
45 changes: 24 additions & 21 deletions documentation/src/main/resources/_data/sidebars/ditto_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ entries:
- title: Release Notes
output: web
folderitems:
- title: 3.5.0
url: /release_notes_350.html
output: web
- title: 3.4.4
url: /release_notes_344.html
output: web
Expand All @@ -38,32 +41,32 @@ entries:
- title: 3.4.0
url: /release_notes_340.html
output: web
- title: 3.3.7
url: /release_notes_337.html
output: web
- title: 3.3.6
url: /release_notes_336.html
output: web
- title: 3.3.5
url: /release_notes_335.html
output: web
- title: 3.3.4
url: /release_notes_334.html
output: web
- title: 3.3.3
url: /release_notes_333.html
output: web
- title: 3.3.2
url: /release_notes_332.html
output: web
- title: 3.3.0
url: /release_notes_330.html
output: web

subfolders:
- title: Archive
output: web
subfolderitems:
- title: 3.3.7
url: /release_notes_337.html
output: web
- title: 3.3.6
url: /release_notes_336.html
output: web
- title: 3.3.5
url: /release_notes_335.html
output: web
- title: 3.3.4
url: /release_notes_334.html
output: web
- title: 3.3.3
url: /release_notes_333.html
output: web
- title: 3.3.2
url: /release_notes_332.html
output: web
- title: 3.3.0
url: /release_notes_330.html
output: web
- title: 3.2.1
url: /release_notes_321.html
output: web
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
title: "Announcing Eclipse Ditto Release 3.5.0"
published: true
permalink: 2024-01-26-release-announcement-350.html
layout: post
author: thomas_jaeckle
tags: [blog]
hide_sidebar: true
sidebar: false
toc: false
---

The Eclipse Ditto team wished you a happy new year and is excited to announce availability of Ditto
[3.5.0](https://projects.eclipse.org/projects/iot.ditto/releases/3.5.0).

In 3.5.0 a lot of UI improvements are contained and several smaller but very useful features were added.
Thanks a lot to the contributors who contributed to this release, this is really appreciated.


## Adoption

Companies are willing to show their adoption of Eclipse Ditto publicly:
[https://iot.eclipse.org/adopters/?#iot.ditto](https://iot.eclipse.org/adopters/?#iot.ditto)

When you use Eclipse Ditto it would be great to support the project by putting your logo there.


## Changelog

The main improvements and additions of Ditto 3.5.0 are:

Eclipse Ditto 3.5.0 focuses on the following areas:

* **Search in the history** of a **single thing** using an RQL filter
* **Configure per namespace** the **fields to index** in Ditto's **search index**
* Configure **defined search count queries** to be **exposed as Prometheus metrics** by Ditto periodically
* Providing **new placeholder functionality** to the **time placeholder**, being able to **add and subtract to/from
the current time** and to truncate the time to a given unit
* Enhance **WoT (Web of Things) JSON skeleton creation** to be able to **fail with an exception** on **invalid** WoT models
* Provide **negative numbers** when **querying for the historical events** of an entity (thing, policy, connection) in order to
**e.g. get "latest 10" events**
* UI enhancements:
* Show **policy imports** in Ditto explorer UI
* Enhance UI **Operations** functionality to be able to **perform devops/piggyback commands**
* Allow **editors in UI** to toggle **full screen mode**
* **Display attributes in UI** inside a **JSON editor** in order to correctly display structured JSON payloads
* Enhance "**Incoming Thing Updates**" section by **displaying "Action" and "Path" in the table** and adding a **dropdown to
select the amount of details** to show per event
* Add **client side filter option** for filtering **Incoming Thing Updates** and **Connection logs**

The following non-functional work is also included:

* Configured docker-compose to by default retain only the last 50m of log messages per Ditto service
* Migrated SLF4J to version 2.x and logback to version 1.4.x
* Benchmark tool improvements and fixes
* Improve cluster stability when running in Kubernetes, e.g. on updates or k8s node-shutdowns

The following notable fixes are included:

* Fix enriching Thing creation events with the inlined `_policy`
* Fixed that Ditto's own calculated "health" was not exposed to the `/alive` endpoint scraped by Kubernetes to check for
aliveness of single services
* Fixed that no cache was used when updating the search index when an "imported" policy was modified

Please have a look at the [3.5.0 release notes](release_notes_350.html) for a more detailed information on the release.


## Artifacts

The new Java artifacts have been published at the [Eclipse Maven repository](https://repo.eclipse.org/content/repositories/ditto/)
as well as [Maven central](https://repo1.maven.org/maven2/org/eclipse/ditto/).

The Ditto JavaScript client release was published on [npmjs.com](https://www.npmjs.com/~eclipse_ditto):
* [@eclipse-ditto/ditto-javascript-client-dom](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-dom)
* [@eclipse-ditto/ditto-javascript-client-node](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-node)


The Docker images have been pushed to Docker Hub:
* [eclipse/ditto-policies](https://hub.docker.com/r/eclipse/ditto-policies/)
* [eclipse/ditto-things](https://hub.docker.com/r/eclipse/ditto-things/)
* [eclipse/ditto-things-search](https://hub.docker.com/r/eclipse/ditto-things-search/)
* [eclipse/ditto-gateway](https://hub.docker.com/r/eclipse/ditto-gateway/)
* [eclipse/ditto-connectivity](https://hub.docker.com/r/eclipse/ditto-connectivity/)

The Ditto Helm chart has been published to Docker Hub:
* [eclipse/ditto](https://hub.docker.com/r/eclipse/ditto/)

<br/>
<br/>
{% include image.html file="ditto.svg" alt="Ditto" max-width=500 %}
--<br/>
The Eclipse Ditto team
20 changes: 10 additions & 10 deletions documentation/src/main/resources/pages/ditto/basic-placeholders.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ Which placeholder values are available depends on the context where the placehol

### Time Placeholder

| Placeholder | Description |
|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `{%raw%}{{ time:now }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone |
| `{%raw%}{{ time:now_epoch_millis }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string |
| `{%raw%}{{ time:now<+-offset> }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d` |
| `{%raw%}{{ time:now_epoch_millis<+-offset> }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d` |
| `{%raw%}{{ time:now[<truncation-unit>] }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone, truncated to the unit defined in square brackets, being one of `ms s m h d` |
| `{%raw%}{{ time:now_epoch_millis[<truncation-unit>] }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string, truncated to the unit defined in square brackets, being one of `ms s m h d` |
| `{%raw%}{{ time:now<+-offset>[<truncation-unit>] }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d`, truncated to the unit defined in square brackets, being one of `ms s m h d` |
| `{%raw%}{{ time:now_epoch_millis<+-offset>[<truncation-unit>] }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d`, truncated to the unit defined in square brackets, being one of `ms s m h d` |
| Placeholder | Description |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `{%raw%}{{ time:now }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone |
| `{%raw%}{{ time:now_epoch_millis }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string |
| `{%raw%}{{ time:now<+-offset> }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d w mo y` |
| `{%raw%}{{ time:now_epoch_millis<+-offset> }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d w mo y` |
| `{%raw%}{{ time:now[<truncation-unit>] }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone, truncated to the unit defined in square brackets, being one of `ms s m h d w mo y` |
| `{%raw%}{{ time:now_epoch_millis[<truncation-unit>] }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string, truncated to the unit defined in square brackets, being one of `ms s m h d w mo y` |
| `{%raw%}{{ time:now<+-offset>[<truncation-unit>] }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d w mo y`, truncated to the unit defined in square brackets, being one of `ms s m h d w mo y` |
| `{%raw%}{{ time:now_epoch_millis<+-offset>[<truncation-unit>] }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string plus or minus the offset in format `<integer><unit>` where unit is one of `ms s m h d w mo y`, truncated to the unit defined in square brackets, being one of `ms s m h d w mo y` |

Examples - assuming that the `now` timestamp is: `2024-01-06T14:23:42.123Z`
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ge(attributes/tags/floor,2)
```


## Search count queries
## Search count queries

The same syntax applies for search count queries - only the [sorting](basic-rql.html#rql-sorting) and
[paging](#rql-paging-deprecated) makes no sense here, so there are not necessary to specify.
Expand Down
Loading
Loading