Skip to content

Commit

Permalink
Merge branch 'master' into actor_tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
artursouza authored Nov 11, 2024
2 parents 4000478 + 3dc96d7 commit 5645796
Show file tree
Hide file tree
Showing 16 changed files with 493 additions and 32 deletions.
14 changes: 11 additions & 3 deletions .github/scripts/update_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ set -uex

DAPR_JAVA_SDK_VERSION=$1

# Alpha artifacts of the sdk tracks the regular SDK minor and patch versions, just not the major.
# Replaces the SDK major version to 0 for alpha artifacts.
DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'`

if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md
sed -i bak "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i bak "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i bak "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_ALPHA_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/spring-boot/_index.md
rm README.mdbak
else
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" README.md
sed -i "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" README.md
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i "s/compile('io.dapr:\(.*\):.*')/compile('io.dapr:\\1:${DAPR_JAVA_SDK_VERSION}')/g" daprdocs/content/en/java-sdk-docs/_index.md
sed -i "s/<version>.*<\/version>\$/<version>${DAPR_JAVA_SDK_ALPHA_VERSION}<\/version>/g" daprdocs/content/en/java-sdk-docs/spring-boot/_index.md
fi

rm -rf docs
mvn -Dmaven.test.skip=false -Djacoco.skip=true clean install
mvn site-deploy
rm -f daprdocs/content/en/java-sdk-docs/_index.mdbak || echo
rm -f daprdocs/content/en/java-sdk-docs/spring-boot/_index.md/_index.mdbak || echo

rm -rf docs
./mvnw -Dmaven.test.skip=false -Djacoco.skip=true clean install
./mvnw site-deploy
4 changes: 4 additions & 0 deletions .github/scripts/update_sdk_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DAPR_JAVA_SDK_ALPHA_VERSION=`echo $DAPR_JAVA_SDK_VERSION | sed 's/^[0-9]*\./0./'

mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_VERSION
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION
mvn versions:set-property -Dproperty=dapr.sdk.version -DnewVersion=$DAPR_JAVA_SDK_VERSION -f sdk-tests/pom.xml
mvn versions:set-property -Dproperty=dapr.sdk.alpha.version -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-tests/pom.xml

Expand All @@ -23,4 +24,7 @@ mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f sdk-workflows/pom.
# testcontainers-dapr
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f testcontainers-dapr/pom.xml

# dapr-spring
mvn versions:set -DnewVersion=$DAPR_JAVA_SDK_ALPHA_VERSION -f dapr-spring/pom.xml

git clean -f
34 changes: 34 additions & 0 deletions .github/workflows/validate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Validate Javadocs Generation

on:
workflow_dispatch:
push:
branches:
- master
- release-*
tags:
- v*

pull_request:
branches:
- master
- release-*

jobs:
build:
name: "Validate Javadocs generation"
runs-on: linux-arm64-latest-4-cores
timeout-minutes: 30
env:
JDK_VER: 17
steps:
- uses: actions/checkout@v4
- name: Set up OpenJDK ${{ env.JDK_VER }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JDK_VER }}
- name: Install jars
run: ./mvnw install -q -B -DskipTests
- name: Validate Java docs generation
run: ./mvnw site-deploy
4 changes: 2 additions & 2 deletions dapr-spring/dapr-spring-boot-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class DaprPubSubProperties {
* Name of the PubSub Dapr component.
*/
private String name;
private boolean observationEnabled;

public String getName() {
return name;
Expand All @@ -34,4 +35,11 @@ public void setName(String name) {
this.name = name;
}

public boolean isObservationEnabled() {
return observationEnabled;
}

public void setObservationEnabled(boolean observationEnabled) {
this.observationEnabled = observationEnabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ private String createSql(String sqlPattern, String keyspace) {
private String createSql(String sqlPattern, String keyspace, Object criteria) {
String keyspaceFilter = getKeyspaceFilter(keyspace);

if (criteria instanceof DaprPredicate daprPredicate) {
if (criteria instanceof DaprPredicate) {
var daprPredicate = (DaprPredicate) criteria;
String path = daprPredicate.getPath().toString();
String pathWithOutType = String.format("'%s'", path.substring(path.indexOf(".") + 1));
String value = String.format("'%s'", daprPredicate.getValue().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public Predicate<Object> isFalse() {
public Predicate<Object> isEqualTo(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (!ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
if (o instanceof String s1 && value instanceof String s2) {
if ((o instanceof String) && (value instanceof String)) {
var s1 = (String)o;
var s2 = (String)value;
return s1.equalsIgnoreCase(s2);
}
}
Expand Down Expand Up @@ -85,7 +87,8 @@ public Predicate<Object> matches(Object value) {
return ObjectUtils.nullSafeEquals(o, value);
}

if (value instanceof Pattern pattern) {
if (value instanceof Pattern) {
var pattern = (Pattern)value;
return pattern.matcher(o.toString()).find();
}

Expand All @@ -95,8 +98,10 @@ public Predicate<Object> matches(Object value) {

public Predicate<Object> in(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (value instanceof Collection<?> collection) {
if (o instanceof Collection<?> subSet) {
if (value instanceof Collection<?>) {
var collection = (Collection<?>)value;
if (o instanceof Collection<?>) {
var subSet = (Collection<?>)o;
return collection.containsAll(subSet);
}

Expand All @@ -117,15 +122,17 @@ public Predicate<Object> contains(Object value) {
return false;
}

if (o instanceof Collection<?> collection) {
if (o instanceof Collection<?>) {
var collection = (Collection<?>)o;
return collection.contains(value);
}

if (ObjectUtils.isArray(o)) {
return ObjectUtils.containsElement(ObjectUtils.toObjectArray(o), value);
}

if (o instanceof Map<?, ?> map) {
if (o instanceof Map<?, ?>) {
var map = (Map<?, ?>)o;
return map.containsValue(value);
}

Expand All @@ -145,9 +152,10 @@ public Predicate<Object> contains(Object value) {

public Predicate<Object> startsWith(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (!(o instanceof String s)) {
if (!(o instanceof String)) {
return false;
}
var s = (String)o;

if (ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
return s.startsWith(value.toString());
Expand All @@ -159,10 +167,11 @@ public Predicate<Object> startsWith(Object value) {

public Predicate<Object> endsWith(Object value) {
return new DaprPredicate(part.getProperty(), value, o -> {
if (!(o instanceof String s)) {
if (!(o instanceof String)) {
return false;
}

var s = (String)o;
if (ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
return s.endsWith(value.toString());
}
Expand Down
2 changes: 1 addition & 1 deletion dapr-spring/dapr-spring-messaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
<artifactId>dapr-spring-messaging</artifactId>
<name>dapr-spring-messaging</name>
<description>Dapr Spring Messaging</description>
<packaging>jar</packaging>
<packaging>jar</packaging>

</project>
Loading

0 comments on commit 5645796

Please sign in to comment.