Skip to content

Commit 65200d4

Browse files
committed
prepare Ditto 3.5.0 release notes
* added missing duration time units to DittoDuration Signed-off-by: Thomas Jäckle <[email protected]>
1 parent 2042b6f commit 65200d4

File tree

13 files changed

+432
-40
lines changed

13 files changed

+432
-40
lines changed

SECURITY.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ These versions of Eclipse Ditto are currently being supported with security upda
99

1010
| Version | Supported |
1111
|---------| ------------------ |
12+
| 3.5.x | :white_check_mark: |
1213
| 3.4.x | :white_check_mark: |
13-
| 3.3.x | :white_check_mark: |
14-
| < 3.3.0 | :x: |
14+
| < 3.4.0 | :x: |
1515

1616
## Reporting a Vulnerability
1717

base/model/src/main/java/org/eclipse/ditto/base/model/common/DittoDuration.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.text.MessageFormat;
1919
import java.time.Duration;
20+
import java.time.Period;
2021
import java.time.temporal.ChronoUnit;
2122
import java.util.Arrays;
2223
import java.util.Objects;
@@ -217,7 +218,10 @@ public enum DittoTimeUnit {
217218
MILLISECONDS("ms", Duration::ofMillis, ChronoUnit.MILLIS),
218219
MINUTES("m", Duration::ofMinutes, ChronoUnit.MINUTES),
219220
HOURS("h", Duration::ofHours, ChronoUnit.HOURS),
220-
DAYS("d", Duration::ofDays, ChronoUnit.DAYS);
221+
DAYS("d", Duration::ofDays, ChronoUnit.DAYS),
222+
WEEKS("w", weeks -> ofPeriodGreaterThanDays(Period.ofWeeks((int) weeks)), ChronoUnit.WEEKS),
223+
MONTHS("mo", months -> ofPeriodGreaterThanDays(Period.ofMonths((int) months)), ChronoUnit.MONTHS),
224+
YEARS("y", years -> ofPeriodGreaterThanDays(Period.ofYears((int) years)), ChronoUnit.YEARS);
221225

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

250+
private static Duration ofPeriodGreaterThanDays(final Period period) {
251+
final Duration years = ChronoUnit.YEARS.getDuration().multipliedBy(period.getYears());
252+
final Duration months = ChronoUnit.MONTHS.getDuration().multipliedBy(period.getMonths());
253+
final Duration days = ChronoUnit.DAYS.getDuration().multipliedBy(period.getDays());
254+
return years.plus(months).plus(days);
255+
}
256+
246257
public Matcher getRegexMatcher(final CharSequence duration) {
247258
return regexPattern.matcher(duration);
248259
}

base/model/src/test/java/org/eclipse/ditto/base/model/common/DittoDurationTest.java

+25
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.mutabilitydetector.unittesting.MutabilityMatchers.areImmutable;
2121

2222
import java.time.Duration;
23+
import java.time.temporal.ChronoUnit;
2324

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

116+
@Test
117+
public void createDittoDurationFromStringWeeks() {
118+
final short durationValue = 5;
119+
final DittoDuration dittoDuration = DittoDuration.parseDuration(durationValue + "w");
120+
121+
assertThat(dittoDuration.getDuration()).isEqualTo(ChronoUnit.WEEKS.getDuration().multipliedBy(durationValue));
122+
}
123+
124+
@Test
125+
public void createDittoDurationFromStringMonths() {
126+
final short durationValue = 2;
127+
final DittoDuration dittoDuration = DittoDuration.parseDuration(durationValue + "mo");
128+
129+
assertThat(dittoDuration.getDuration()).isEqualTo(ChronoUnit.MONTHS.getDuration().multipliedBy(durationValue));
130+
}
131+
132+
@Test
133+
public void createDittoDurationFromStringYears() {
134+
final short durationValue = 3;
135+
final DittoDuration dittoDuration = DittoDuration.parseDuration(durationValue + "y");
136+
137+
assertThat(dittoDuration.getDuration()).isEqualTo(ChronoUnit.YEARS.getDuration().multipliedBy(durationValue));
138+
}
139+
115140
@Test
116141
public void createDittoDurationFromStringWithAndWithoutSecondsIsEqual() {
117142
final byte durationValue = 23;

base/model/src/test/java/org/eclipse/ditto/base/model/headers/DittoDurationValueValidatorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void acceptDittoDurationStringWithNegativeAmount() {
111111

112112
@Test
113113
public void acceptDittoDurationStringWithInvalidTimeUnit() {
114-
final String invalidDittoDurationString = "1w";
114+
final String invalidDittoDurationString = "1a";
115115

116116
assertThatExceptionOfType(DittoHeaderInvalidException.class)
117117
.isThrownBy(() -> underTest.accept(DittoHeaderDefinition.TIMEOUT, invalidDittoDurationString))

base/model/src/test/java/org/eclipse/ditto/base/model/headers/TimeoutValueValidatorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void acceptDittoDurationStringWithNegativeAmount() {
111111

112112
@Test
113113
public void acceptDittoDurationStringWithInvalidTimeUnit() {
114-
final String invalidDittoDurationString = "1y";
114+
final String invalidDittoDurationString = "1a";
115115

116116
assertThatExceptionOfType(TimeoutInvalidException.class)
117117
.isThrownBy(() -> underTest.accept(DittoHeaderDefinition.TIMEOUT, invalidDittoDurationString))

documentation/src/main/resources/_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ plugins:
114114
docVersions:
115115
- label: "development"
116116
basePath: ""
117+
- label: "3.5"
118+
basePath: "3.5"
117119
- label: "3.4"
118120
basePath: "3.4"
119121
- label: "3.3"

documentation/src/main/resources/_data/sidebars/ditto_sidebar.yml

+24-21
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ entries:
2323
- title: Release Notes
2424
output: web
2525
folderitems:
26+
- title: 3.5.0
27+
url: /release_notes_350.html
28+
output: web
2629
- title: 3.4.4
2730
url: /release_notes_344.html
2831
output: web
@@ -38,32 +41,32 @@ entries:
3841
- title: 3.4.0
3942
url: /release_notes_340.html
4043
output: web
41-
- title: 3.3.7
42-
url: /release_notes_337.html
43-
output: web
44-
- title: 3.3.6
45-
url: /release_notes_336.html
46-
output: web
47-
- title: 3.3.5
48-
url: /release_notes_335.html
49-
output: web
50-
- title: 3.3.4
51-
url: /release_notes_334.html
52-
output: web
53-
- title: 3.3.3
54-
url: /release_notes_333.html
55-
output: web
56-
- title: 3.3.2
57-
url: /release_notes_332.html
58-
output: web
59-
- title: 3.3.0
60-
url: /release_notes_330.html
61-
output: web
6244

6345
subfolders:
6446
- title: Archive
6547
output: web
6648
subfolderitems:
49+
- title: 3.3.7
50+
url: /release_notes_337.html
51+
output: web
52+
- title: 3.3.6
53+
url: /release_notes_336.html
54+
output: web
55+
- title: 3.3.5
56+
url: /release_notes_335.html
57+
output: web
58+
- title: 3.3.4
59+
url: /release_notes_334.html
60+
output: web
61+
- title: 3.3.3
62+
url: /release_notes_333.html
63+
output: web
64+
- title: 3.3.2
65+
url: /release_notes_332.html
66+
output: web
67+
- title: 3.3.0
68+
url: /release_notes_330.html
69+
output: web
6770
- title: 3.2.1
6871
url: /release_notes_321.html
6972
output: web
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: "Announcing Eclipse Ditto Release 3.5.0"
3+
published: true
4+
permalink: 2024-01-26-release-announcement-350.html
5+
layout: post
6+
author: thomas_jaeckle
7+
tags: [blog]
8+
hide_sidebar: true
9+
sidebar: false
10+
toc: false
11+
---
12+
13+
The Eclipse Ditto team wished you a happy new year and is excited to announce availability of Ditto
14+
[3.5.0](https://projects.eclipse.org/projects/iot.ditto/releases/3.5.0).
15+
16+
In 3.5.0 a lot of UI improvements are contained and several smaller but very useful features were added.
17+
Thanks a lot to the contributors who contributed to this release, this is really appreciated.
18+
19+
20+
## Adoption
21+
22+
Companies are willing to show their adoption of Eclipse Ditto publicly:
23+
[https://iot.eclipse.org/adopters/?#iot.ditto](https://iot.eclipse.org/adopters/?#iot.ditto)
24+
25+
When you use Eclipse Ditto it would be great to support the project by putting your logo there.
26+
27+
28+
## Changelog
29+
30+
The main improvements and additions of Ditto 3.5.0 are:
31+
32+
Eclipse Ditto 3.5.0 focuses on the following areas:
33+
34+
* **Search in the history** of a **single thing** using an RQL filter
35+
* **Configure per namespace** the **fields to index** in Ditto's **search index**
36+
* Configure **defined search count queries** to be **exposed as Prometheus metrics** by Ditto periodically
37+
* Providing **new placeholder functionality** to the **time placeholder**, being able to **add and subtract to/from
38+
the current time** and to truncate the time to a given unit
39+
* Enhance **WoT (Web of Things) JSON skeleton creation** to be able to **fail with an exception** on **invalid** WoT models
40+
* Provide **negative numbers** when **querying for the historical events** of an entity (thing, policy, connection) in order to
41+
**e.g. get "latest 10" events**
42+
* UI enhancements:
43+
* Show **policy imports** in Ditto explorer UI
44+
* Enhance UI **Operations** functionality to be able to **perform devops/piggyback commands**
45+
* Allow **editors in UI** to toggle **full screen mode**
46+
* **Display attributes in UI** inside a **JSON editor** in order to correctly display structured JSON payloads
47+
* Enhance "**Incoming Thing Updates**" section by **displaying "Action" and "Path" in the table** and adding a **dropdown to
48+
select the amount of details** to show per event
49+
* Add **client side filter option** for filtering **Incoming Thing Updates** and **Connection logs**
50+
51+
The following non-functional work is also included:
52+
53+
* Configured docker-compose to by default retain only the last 50m of log messages per Ditto service
54+
* Migrated SLF4J to version 2.x and logback to version 1.4.x
55+
* Benchmark tool improvements and fixes
56+
* Improve cluster stability when running in Kubernetes, e.g. on updates or k8s node-shutdowns
57+
58+
The following notable fixes are included:
59+
60+
* Fix enriching Thing creation events with the inlined `_policy`
61+
* Fixed that Ditto's own calculated "health" was not exposed to the `/alive` endpoint scraped by Kubernetes to check for
62+
aliveness of single services
63+
* Fixed that no cache was used when updating the search index when an "imported" policy was modified
64+
65+
Please have a look at the [3.5.0 release notes](release_notes_350.html) for a more detailed information on the release.
66+
67+
68+
## Artifacts
69+
70+
The new Java artifacts have been published at the [Eclipse Maven repository](https://repo.eclipse.org/content/repositories/ditto/)
71+
as well as [Maven central](https://repo1.maven.org/maven2/org/eclipse/ditto/).
72+
73+
The Ditto JavaScript client release was published on [npmjs.com](https://www.npmjs.com/~eclipse_ditto):
74+
* [@eclipse-ditto/ditto-javascript-client-dom](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-dom)
75+
* [@eclipse-ditto/ditto-javascript-client-node](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-node)
76+
77+
78+
The Docker images have been pushed to Docker Hub:
79+
* [eclipse/ditto-policies](https://hub.docker.com/r/eclipse/ditto-policies/)
80+
* [eclipse/ditto-things](https://hub.docker.com/r/eclipse/ditto-things/)
81+
* [eclipse/ditto-things-search](https://hub.docker.com/r/eclipse/ditto-things-search/)
82+
* [eclipse/ditto-gateway](https://hub.docker.com/r/eclipse/ditto-gateway/)
83+
* [eclipse/ditto-connectivity](https://hub.docker.com/r/eclipse/ditto-connectivity/)
84+
85+
The Ditto Helm chart has been published to Docker Hub:
86+
* [eclipse/ditto](https://hub.docker.com/r/eclipse/ditto/)
87+
88+
<br/>
89+
<br/>
90+
{% include image.html file="ditto.svg" alt="Ditto" max-width=500 %}
91+
--<br/>
92+
The Eclipse Ditto team

documentation/src/main/resources/pages/ditto/basic-placeholders.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ Which placeholder values are available depends on the context where the placehol
9494

9595
### Time Placeholder
9696

97-
| Placeholder | Description |
98-
|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
99-
| `{%raw%}{{ time:now }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone |
100-
| `{%raw%}{{ time:now_epoch_millis }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string |
101-
| `{%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` |
102-
| `{%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` |
103-
| `{%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` |
104-
| `{%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` |
105-
| `{%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` |
106-
| `{%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` |
97+
| Placeholder | Description |
98+
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
99+
| `{%raw%}{{ time:now }}{%endraw%}` | the current timestamp in ISO-8601 format as string in UTC timezone |
100+
| `{%raw%}{{ time:now_epoch_millis }}{%endraw%}` | the current timestamp in "milliseconds since epoch" formatted as string |
101+
| `{%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` |
102+
| `{%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` |
103+
| `{%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` |
104+
| `{%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` |
105+
| `{%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` |
106+
| `{%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` |
107107

108108
Examples - assuming that the `now` timestamp is: `2024-01-06T14:23:42.123Z`
109109
```

documentation/src/main/resources/pages/ditto/basic-search.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ ge(attributes/tags/floor,2)
124124
```
125125

126126

127-
## Search count queries
127+
## Search count queries
128128

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

0 commit comments

Comments
 (0)