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

App Config Feature Mangement ISO 8601 Support #22392

Merged
merged 2 commits into from
Jun 21, 2021
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 eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ com.microsoft.azure:spring-cloud-azure-feature-management;1.3.0;1.4.0-beta.1
com.microsoft.azure:spring-cloud-starter-azure-appconfiguration-config;1.3.0;1.4.0-beta.1
com.azure.spring:azure-spring-cloud-appconfiguration-config-web;2.0.0-beta.1;2.0.0-beta.2
com.azure.spring:azure-spring-cloud-appconfiguration-config;2.0.0-beta.1;2.0.0-beta.2
com.azure.spring:azure-spring-cloud-feature-management-web;2.0.0-beta.1;2.0.0-beta.2
com.azure.spring:azure-spring-cloud-feature-management;2.0.0-beta.1;2.0.0-beta.2
com.azure.spring:azure-spring-cloud-feature-management-web;2.0.0-beta.1;2.0.0
com.azure.spring:azure-spring-cloud-feature-management;2.0.0-beta.1;2.0.0
com.azure.spring:azure-spring-cloud-starter-appconfiguration-config;2.0.0-beta.1;2.0.0-beta.2
com.azure.spring:azure-identity-spring;1.5.0;1.6.0-beta.1
com.azure.spring:azure-spring-boot-starter-active-directory-b2c;3.5.0;3.6.0-beta.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Release History

## 2.0.0-beta.2 (Unreleased)

## 2.0.0-beta.2 (2021-06-21)
- Changed package path to `com.azure.spring.cloud.config`

## 2.0.0-beta.1 (2021-05-04)
### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Release History

## 2.0.0-beta.2 (Unreleased)

## 2.0.0-beta.2 (2021-06-21)
### Breaking Changes
- Changed package path to `com.azure.spring.cloud.config`
- Renamed cache-expiration to refresh-interval
- Moved and renamed feature-flag cache-expiration to `spring.cloud.azure.appconfiguration.stores[0].monitoring.feature-flag-refresh-interval`
- Removed use of revisions endpoint

## 2.0.0-beta.1 (2021-05-04)
### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Release History

## 2.0.0-beta.2 (Unreleased)
## 2.0.0 (2021-06-21)

### Breaking Change

- Changed package path to `com.azure.spring.cloud.feature.manager`

## 2.0.0-beta.1 (2021-05-04)
### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-feature-management-web</artifactId>
<version>2.0.0-beta.2</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management-web;current} -->
<version>2.0.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management-web;current} -->
<name>Azure Spring Cloud Feature Management Web</name>
<description>Adds Feature Management into Spring Web</description>

Expand Down Expand Up @@ -41,7 +41,7 @@
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-feature-management</artifactId>
<version>2.0.0-beta.2</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management;current} -->
<version>2.0.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management;current} -->
</dependency>
<!-- Added this dependency to include necessary annotations used by reactor core.
Without this dependency, javadoc throws a warning as it cannot find enum When.MAYBE
Expand Down Expand Up @@ -69,7 +69,7 @@
<rules>
<bannedDependencies>
<includes>
<include>com.azure.spring:azure-spring-cloud-feature-management:[2.0.0-beta.2]</include> <!-- {x-include-update;com.azure.spring:azure-spring-cloud-feature-management;current} -->
<include>com.azure.spring:azure-spring-cloud-feature-management:[2.0.0]</include> <!-- {x-include-update;com.azure.spring:azure-spring-cloud-feature-management;current} -->
<include>javax.servlet:javax.servlet-api:[4.0.1]</include> <!-- {x-include-update;javax.servlet:javax.servlet-api;external_dependency} -->
<include>org.springframework:spring-web:[5.3.7]</include> <!-- {x-include-update;org.springframework:spring-web;external_dependency} -->
<include>org.springframework:spring-webmvc:[5.3.7]</include> <!-- {x-include-update;org.springframework:spring-webmvc;external_dependency} -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Release History

## 2.0.0-beta.2 (Unreleased)
## 2.0.0 (2021-06-21)

- Updated TimeWindowFilter to support ISO-8601

### Breaking Change

- Changed package path to `com.azure.spring.cloud.feature.manager`

## 2.0.0-beta.1 (2021-05-04)
### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-feature-management</artifactId>
<version>2.0.0-beta.2</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management;current} -->
<version>2.0.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management;current} -->
<name>Azure Spring Cloud Feature Management</name>
<description>Adds Feature Management into Spring</description>

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

import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -42,14 +44,25 @@ public boolean evaluate(FeatureFilterEvaluationContext context) {
TIME_WINDOW_FILTER_SETTING_END);
return false;
}

ZonedDateTime startTime = null;
ZonedDateTime endTime = null;

ZonedDateTime startTime = StringUtils.hasText(start)
? ZonedDateTime.parse(start, DateTimeFormatter.RFC_1123_DATE_TIME)
: null;
ZonedDateTime endTime = StringUtils.hasText(end)
? ZonedDateTime.parse(end, DateTimeFormatter.RFC_1123_DATE_TIME)
: null;

try {
startTime = StringUtils.hasText(start)
? ZonedDateTime.parse(start, DateTimeFormatter.ISO_DATE_TIME)
: null;
endTime = StringUtils.hasText(end)
? ZonedDateTime.parse(end, DateTimeFormatter.ISO_DATE_TIME)
: null;
} catch (DateTimeParseException e) {
startTime = StringUtils.hasText(start)
? ZonedDateTime.parse(start, DateTimeFormatter.RFC_1123_DATE_TIME)
: null;
endTime = StringUtils.hasText(end)
? ZonedDateTime.parse(end, DateTimeFormatter.RFC_1123_DATE_TIME)
: null;
}
return (!StringUtils.hasText(start) || now.isAfter(startTime))
&& (!StringUtils.hasText(end) || now.isBefore(endTime));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 2.0.0-beta.2 (Unreleased)
## 2.0.0-beta.2 (2021-06-21)
### Breaking Changes
- Changed package path to `com.azure.spring.cloud.config` and `com.azure.spring.cloud.feature.manager`


## 2.0.0-beta.1 (2021-05-04)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There are two libraries that can be used azure-spring-cloud-appconfiguration-con
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-appconfiguration-config</artifactId>
<version>1.2.8-beta.1</version>
<version>2.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -33,7 +33,7 @@ or
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-appconfiguration-config-web</artifactId>
<version>1.2.8-beta.1</version>
<version>2.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -76,6 +76,7 @@ Name | Description | Required | Default
---|---|---|---
spring.cloud.azure.appconfiguration.stores[0].monitoring.enabled | Whether the configurations and feature flags will be re-loaded if a change is detected. | No | false
spring.cloud.azure.appconfiguration.stores[0].monitoring.watch-interval | Amount of time, of type Duration, configurations are stored before a check can occur. | No | 30s
spring.cloud.azure.appconfiguration.stores[0].monitoring.feature-flags.watch-interval | Amount of time, of type Duration, feature flags are stored before a check can occur. | No | 30s
spring.cloud.azure.appconfiguration.stores[0].monitoring.triggers[0].key | A key that is watched for change via etag. If a change is detected on the key then a refresh of all configurations will be triggered. | Yes (If monitoring enabled) | null
spring.cloud.azure.appconfiguration.stores[0].monitoring.triggers[0].label | The label of the key that is being watched for etag changes. | No | \0
spring.cloud.azure.appconfiguration.stores[0].monitoring.push-notification.primary-token.name | The name of a token used with Event Hub to trigger push based refresh. | No | null
Expand All @@ -89,7 +90,6 @@ Name | Description | Required | Default
---|---|---|---
spring.cloud.azure.appconfiguration.stores[0].feature-flags.enable | Whether feature flags are loaded from the config store. | No | false
spring.cloud.azure.appconfiguration.stores[0].feature-flags.label-filter | The label used to indicate which feature flags will be loaded. | No | \0
spring.cloud.azure.appconfiguration.stores[0].feature-flags.watch-interval | Amount of time, of type Duration, feature flags are stored before a check can occur. | No | 30s

### Advanced usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-cloud-feature-management-web</artifactId>
<version>2.0.0-beta.2</version><!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management-web;current} -->
<version>2.0.0</version><!-- {x-version-update;com.azure.spring:azure-spring-cloud-feature-management-web;current} -->
</dependency>
</dependencies>
</project>