Skip to content

Commit

Permalink
Merge branch 'release/0.45.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
AudreyKj committed Jun 9, 2022
2 parents e7bfdf1 + e535a5e commit a3be247
Show file tree
Hide file tree
Showing 236 changed files with 12,853 additions and 3,121 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: joschi/setup-jdk@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
architecture: 'x64'

- name: Install bazelisk
run: |
Expand All @@ -39,6 +39,12 @@ jobs:
env:
GCS_SA_KEY: ${{secrets.GCS_SA_KEY}}

- name: Install dependencies
run: yarn install

- name: Run unit testing
run: yarn jest --coverage

- name: Lint
run: |
sudo apt-get install -y shellcheck
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ package-lock.json

# Testing
cypress
coverage

# Airy config files
airy.yaml
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.44.0
0.45.0
13 changes: 7 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# Airy Bazel tools

git_repository(
name = "com_github_airyhq_bazel_tools",
commit = "340e636d2ad91b8d9c03bb3c6d829b6d845f498e",
commit = "3da34dbb12d47ac9b1759fd6b5bafce754dac679",
remote = "https://github.com/airyhq/bazel-tools.git",
shallow_since = "1650889500 +0200",
shallow_since = "1653559887 +0200",
)

load("@com_github_airyhq_bazel_tools//:repositories.bzl", "airy_bazel_tools_dependencies", "airy_jvm_deps")
Expand Down Expand Up @@ -43,10 +44,10 @@ pinned_maven_install()
# This needs to come before any rules_docker usage as it brings its own version of Gazelle
http_archive(
name = "bazel_gazelle",
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
sha256 = "5982e5463f171da99e3bdaeff8c0f48283a7a5f396ec5282910b9e8a49c0dd7e",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
],
)

Expand All @@ -71,7 +72,7 @@ go_embed_data_dependencies()

go_register_toolchains(
nogo = "@//:airy_nogo",
version = "1.16",
version = "1.18.2",
) # airy_nogo is in the top-level BUILD file of this workspace

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package co.airy.core.api.config;

import co.airy.log.AiryLoggerFactory;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
Expand All @@ -15,18 +13,24 @@

@Component
public class HealthApi {
private static final Logger log = AiryLoggerFactory.getLogger(HealthApi.class);
private final ObjectMapper objectMapper = new ObjectMapper();
private final String namespace;
private final String adminAppName;
private final RestTemplate restTemplate;

public HealthApi(@Value("${kubernetes.namespace}") String namespace, RestTemplate restTemplate) {
public HealthApi(@Value("${kubernetes.namespace}") String namespace, @Value("${kubernetes.app}") String adminAppName, RestTemplate restTemplate) {
this.namespace = namespace;
this.adminAppName = adminAppName;
this.restTemplate = restTemplate;
}

@Async
public Future<Boolean> isHealthy(String service) {
if (service.equalsIgnoreCase(adminAppName)) {
// Loop-back requests might not be possible in minikube (https://github.com/kubernetes/minikube/issues/1568)
return new AsyncResult<>(true);
}

try {
final ResponseEntity<String> response = restTemplate.getForEntity(String.format("http://%s.%s/actuator/health", service, namespace), String.class);
final JsonNode jsonNode = objectMapper.readTree(response.getBody());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ kafka.schema-registry-url=${KAFKA_SCHEMA_REGISTRY_URL}
kafka.cleanup=${KAFKA_CLEANUP:false}
kafka.commit-interval-ms=${KAFKA_COMMIT_INTERVAL_MS}
kubernetes.namespace=${KUBERNETES_NAMESPACE}
kubernetes.app=${KUBERNETES_APP}
1 change: 1 addition & 0 deletions backend/api/admin/src/test/resources/test.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
kafka.cleanup=true
kafka.commit-interval-ms=100
kubernetes.namespace=default
kubernetes.app=api-admin
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.Comparator;

import static java.util.stream.Collectors.toList;

Expand Down Expand Up @@ -106,8 +107,11 @@ public ResponseEntity<?> importContacts(@RequestBody @Valid List<CreateContactPa
public ResponseEntity<?> listContacts(@Valid @RequestBody(required = false) ListContactsRequestPayload payload) {
payload = payload == null ? new ListContactsRequestPayload() : payload;
final List<Contact> contacts = stores.getAllContacts();
final List<Contact> sortedContacts = contacts.stream()
.sorted(Comparator.comparing(Contact::getDisplayName, Comparator.nullsLast(Comparator.naturalOrder())))
.collect(toList());

Paginator<Contact> paginator = new Paginator<>(contacts, Contact::getId)
Paginator<Contact> paginator = new Paginator<>(sortedContacts, Contact::getId)
.perPage(payload.getPageSize()).from(payload.getCursor());

Page<Contact> page = paginator.page();
Expand Down
6 changes: 6 additions & 0 deletions bazel.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
"dates/*": [
"./lib/typescript/dates/*"
],
"translations": [
"./lib/typescript/translations"
],
"translations/*": [
"./lib/typescript/translations/*"
],
"render": [
"./lib/typescript/render"
],
Expand Down
111 changes: 90 additions & 21 deletions cli/go.mod
Original file line number Diff line number Diff line change
@@ -1,37 +1,106 @@
module cli

go 1.16
go 1.18

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/TwinProduction/go-color v1.0.0
github.com/airyhq/airy/infrastructure/lib/go/k8s/util v0.0.0-20210813123122-f26352d78a88
github.com/airyhq/airy v0.0.0-20220525151558-d1b9cb353828
github.com/airyhq/airy/infrastructure/lib/go/k8s/util v0.0.0-20220525151558-d1b9cb353828
github.com/airyhq/airy/lib/go/httpclient v0.0.0
github.com/aws/aws-sdk-go v1.37.29
github.com/aws/aws-sdk-go-v2/config v1.1.1
github.com/aws/aws-sdk-go-v2/service/ec2 v1.1.1
github.com/aws/aws-sdk-go-v2/service/eks v1.1.1
github.com/aws/aws-sdk-go-v2/service/iam v1.1.1
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/kr/pretty v0.2.1
github.com/mitchellh/copystructure v1.1.2 // indirect
github.com/aws/aws-sdk-go v1.44.21
github.com/aws/aws-sdk-go-v2/config v1.15.7
github.com/aws/aws-sdk-go-v2/service/ec2 v1.44.0
github.com/aws/aws-sdk-go-v2/service/eks v1.21.1
github.com/aws/aws-sdk-go-v2/service/iam v1.18.5
github.com/kr/pretty v0.3.0
github.com/mitchellh/go-homedir v1.1.0
github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.1.1
github.com/spf13/viper v1.7.1
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.11.0
github.com/thanhpk/randstr v1.0.4
github.com/txn2/txeh v1.3.0
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
goji.io v2.0.2+incompatible
gopkg.in/segmentio/analytics-go.v3 v3.1.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.19.0
k8s.io/apimachinery v0.19.0
k8s.io/client-go v0.19.0
k8s.io/api v0.24.0
k8s.io/apimachinery v0.24.0
k8s.io/client-go v0.24.0
)

require (
cloud.google.com/go v0.100.2 // indirect
cloud.google.com/go/compute v1.6.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/aws/aws-sdk-go-v2 v1.16.4 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.12 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.16.6 // indirect
github.com/aws/smithy-go v1.11.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.15.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.3.0 // indirect
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect
golang.org/x/net v0.0.0-20220524220425-1d687d428aca // indirect
golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220413171646-5e7f5fdc6da6 // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
sigs.k8s.io/json v0.0.0-20220525155127-227cbc7cc124 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/airyhq/airy/lib/go/httpclient => ../lib/go/httpclient
Loading

0 comments on commit a3be247

Please sign in to comment.