Skip to content

Commit

Permalink
Update changelog #
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilge committed Sep 6, 2022
2 parents 9b8b629 + 6def5ed commit 3338765
Show file tree
Hide file tree
Showing 561 changed files with 5,164 additions and 2,492 deletions.
9 changes: 9 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ java_library(
],
)

java_library(
name = "feign",
exports = [
"@maven//:io_github_openfeign_feign_core",
"@maven//:io_github_openfeign_feign_jackson",
"@maven//:io_github_openfeign_feign_okhttp",
],
)

java_plugin(
name = "lombok_plugin",
generates_api = True,
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.48.0
0.49.0
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
name = "com_github_airyhq_bazel_tools",
commit = "6ea38fe01069589ad57e66ae43c6d320fd18e3e5",
commit = "f33ecc4e2e3349f7f7634bb8491b2e431dd41fa6",
remote = "https://github.com/airyhq/bazel-tools.git",
shallow_since = "1660208058 +0200",
shallow_since = "1660918023 +0200",
)

load("@com_github_airyhq_bazel_tools//:repositories.bzl", "airy_bazel_tools_dependencies", "airy_jvm_deps")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import co.airy.spring.core.AirySpringBootApplication;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -215,7 +215,7 @@ public StompSession connect(String jwtToken, int port) throws ExecutionException
final WebSocketStompClient stompClient = new WebSocketStompClient(new StandardWebSocketClient());

MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
ObjectMapper objectMapper = new ObjectMapper().setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
ObjectMapper objectMapper = new ObjectMapper().setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
messageConverter.setObjectMapper(objectMapper);
stompClient.setMessageConverter(messageConverter);

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import org.springframework.stereotype.Component;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
Expand All @@ -19,7 +19,7 @@ public class TestContact {
public TestContact(WebTestHelper webTestHelper) {
this.webTestHelper = webTestHelper;
this.objectMapper = new ObjectMapper();
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public List<KeyValue<String, SpecificRecordBase>> sendMessage(SendMessageRequest
results.add(KeyValue.pair(getId(errorPayload).toString(), errorPayload));
}
updateDeliveryState(message, DeliveryState.FAILED);
results.add(KeyValue.pair(message.getId(), message));
return results;
} catch (Exception e) {
log.error(String.format("Failed to send a \n SendMessageRequest: %s", sendMessageRequest), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.event.ApplicationReadyEvent;
Expand Down Expand Up @@ -65,7 +65,7 @@ public Api(RestTemplateBuilder restTemplateBuilder,
this.objectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(DeserializationFeature.FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY, false)
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
this.restTemplateBuilder = restTemplateBuilder;
this.appId = appId;
this.apiSecret = apiSecret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

import java.util.Arrays;
import java.util.List;
import java.util.UUID;

import static co.airy.test.Timing.retryOnException;
import static org.apache.kafka.streams.KafkaStreams.State.RUNNING;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
import java.util.List;

import static co.airy.model.metadata.MetadataKeys.ConversationKeys;
import static co.airy.test.Timing.retryOnException;
import static org.apache.kafka.streams.KafkaStreams.State.RUNNING;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static co.airy.test.Timing.retryOnException;

@SpringBootTest(classes = AirySpringBootApplication.class)
@TestPropertySource(value = "classpath:test.properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void beforeEach() throws InterruptedException {

// This tests simulates multiple users sending messages via multiple facebook pages
// It ensures that we create the correct number of conversations and messages
//@Test
@Test
void joinsAndCountsMessagesCorrectly() throws Exception {
Random rand = new Random();
List<String> pageIds = Arrays.asList("p1", "p2", "p3", "p4", "p5");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -17,6 +17,6 @@ public ObjectMapper objectMapper() {
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(DeserializationFeature.FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY, false)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.setPropertyNamingStrategy(PropertyNamingStrategy.LOWER_CAMEL_CASE);
.setPropertyNamingStrategy(PropertyNamingStrategies.LOWER_CAMEL_CASE);
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
50 changes: 50 additions & 0 deletions backend/components/rasa/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
load("//tools/build:springboot.bzl", "springboot")
load("//tools/build:junit5.bzl", "junit5")
load("//tools/build:container_release.bzl", "container_release")
load("@com_github_airyhq_bazel_tools//lint:buildifier.bzl", "check_pkg")

check_pkg(name = "buildifier")

app_deps = [
"//:spring",
"//:springboot",
"//:springboot_actuator",
"//:jackson",
"//:lombok",
"//backend/model/message",
"//backend/model/metadata",
"//:feign",
"//lib/java/log",
"//lib/java/spring/kafka/core:spring-kafka-core",
"//lib/java/spring/core:spring-core",
"//lib/java/spring/kafka/streams:spring-kafka-streams",
"//lib/java/spring/async:spring-async",
]

springboot(
name = "rasa-connector",
srcs = glob(["src/main/java/**/*.java"]),
main_class = "co.airy.spring.core.AirySpringBootApplication",
deps = app_deps,
)

[
junit5(
size = "medium",
file = file,
resources = glob(["src/test/resources/**/*"]),
deps = [
":app",
"//backend:base_test",
"//lib/java/test",
"//lib/java/kafka/test:kafka-test",
"//lib/java/spring/test:spring-test",
] + app_deps,
)
for file in glob(["src/test/java/**/*Test.java"])
]

container_release(
registry = "ghcr.io/airyhq/connectors",
repository = "rasa-connector",
)
28 changes: 28 additions & 0 deletions backend/components/rasa/helm/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@com_github_airyhq_bazel_tools//helm:helm.bzl", "helm_template_test")
load("//tools/build:helm.bzl", "helm_push")

filegroup(
name = "files",
srcs = glob(
["**/*"],
exclude = ["BUILD"],
),
visibility = ["//visibility:public"],
)

pkg_tar(
name = "package",
srcs = [":files"],
extension = "tgz",
strip_prefix = "./",
)

helm_template_test(
name = "template",
chart = ":package",
)

helm_push(
chart = ":package",
)
5 changes: 5 additions & 0 deletions backend/components/rasa/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
appVersion: "1.0"
description: A Helm chart for the Rasa connector
name: rasa-connector
version: 1.0
11 changes: 11 additions & 0 deletions backend/components/rasa/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ .Values.component }}"
labels:
core.airy.co/managed: "true"
core.airy.co/mandatory: "{{ .Values.mandatory }}"
core.airy.co/component: "{{ .Values.component }}"
core.airy.co/enterprise: "false"
annotations:
core.airy.co/enabled: "{{ .Values.enabled }}"
75 changes: 75 additions & 0 deletions backend/components/rasa/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.component }}
labels:
app: {{ .Values.component }}
core.airy.co/managed: "true"
core.airy.co/mandatory: "{{ .Values.mandatory }}"
core.airy.co/component: {{ .Values.component }}
spec:
replicas: {{ if .Values.enabled }} 1 {{ else }} 0 {{ end }}
selector:
matchLabels:
app: {{ .Values.component }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: {{ .Values.component }}
spec:
containers:
- name: app
image: "{{ .Values.global.containerRegistry}}/{{ .Values.image }}:{{ default .Chart.Version }}"
imagePullPolicy: Always
envFrom:
- configMapRef:
name: security
- configMapRef:
name: kafka-config
env:
- name: RASA_WEBHOOK_URL
valueFrom:
configMapKeyRef:
key: rasaWebhookUrl
name: {{ .Values.component }}
- name: SERVICE_NAME
value: {{ .Values.component }}
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: REQUESTED_CPU
valueFrom:
resourceFieldRef:
containerName: app
resource: requests.cpu
- name: LIMIT_CPU
valueFrom:
resourceFieldRef:
containerName: app
resource: limits.cpu
- name: LIMIT_MEMORY
valueFrom:
resourceFieldRef:
containerName: app
resource: limits.memory
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
httpHeaders:
- name: Health-Check
value: health-check
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 3
volumes:
- name: {{ .Values.component }}
configMap:
name: {{ .Values.component }}
14 changes: 14 additions & 0 deletions backend/components/rasa/helm/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ .Values.component }}
name: {{ .Values.component }}
spec:
ports:
- port: 80
protocol: TCP
targetPort: 8080
selector:
app: {{ .Values.component }}
type: ClusterIP
7 changes: 7 additions & 0 deletions backend/components/rasa/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
component: rasa-connector
mandatory: false
enabled: false
image: connectors/rasa-connector
global:
containerRegistry: ghcr.io/airyhq
resources: {}
Loading

0 comments on commit 3338765

Please sign in to comment.