Skip to content

Commit b2139dc

Browse files
authored
Feature: Firestore (#394)
* Feature: Firestore This changeset fills out the Firestore adapter structure, including `FirestoreDriver` and associated manager objects like `CollapsedMessage`.
1 parent ee6d681 commit b2139dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+9459
-5777
lines changed

.bazelproject

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ targets:
1919
//js/...
2020
//style/...
2121
//tests/...
22+
//javatests/...
2223
//jstests/...
2324

2425
ts_config_rules:

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.1
1+
3.7.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ bazel-out
1313
.bazelrc.user
1414
reports
1515
report-ci.py
16+
crypto/build-key.json

Makefile

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
##
1717

1818
CI ?= no
19+
DEV ?= no
1920
CACHE ?= no
2021
REMOTE ?= no
2122
DEBUG ?= no
@@ -51,7 +52,7 @@ OUTPATH ?= $(DISTPATH)/out
5152
BINPATH ?= $(DISTPATH)/bin
5253
UNZIP ?= $(shell which unzip)
5354
REVISION ?= $(shell git describe --abbrev=7 --always --tags HEAD)
54-
BASE_VERSION ?= v1a
55+
BASE_VERSION ?= v1b
5556
VERSION ?= $(shell (cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]' | sed 's/version\://g'))
5657
CHROME_COVERAGE ?= $(shell find dist/out/$(OUTPUT_BASE)/bin -name "coverage*.dat" | grep chrome | xargs)
5758
COVERAGE_DATA ?= $(OUTPATH)/_coverage/_coverage_report.dat
@@ -81,9 +82,18 @@ endif
8182
TEST_ARGS_WITH_COVERAGE ?= --combined_report=lcov --nocache_test_results
8283
BUILD_ARGS ?= --define project=$(PROJECT)
8384

85+
BUILDKEY_PLAINTEXT ?= $(shell pwd)/crypto/build-key.json
86+
BUILDKEY_CIPHERTEXT ?= $(BUILDKEY_PLAINTEXT).enc
87+
BUILDKEY_KMS_LOCATION ?= global
88+
BUILDKEY_KMS_KEYRING ?= dev
89+
BUILDKEY_KMS_KEY ?= key-material
90+
BUILDKEY_BASE_ARGS ?= --location=$(BUILDKEY_KMS_LOCATION) --keyring=$(BUILDKEY_KMS_KEYRING) --key=$(BUILDKEY_KMS_KEY) \
91+
--plaintext-file=$(BUILDKEY_PLAINTEXT) --ciphertext-file=$(BUILDKEY_CIPHERTEXT) --project=$(IMAGE_PROJECT)
92+
8493
POSIX_FLAGS ?=
8594
BAZELISK_ARGS ?=
8695
BASE_ARGS ?=
96+
BAZELISK_PREAMBLE ?=
8797

8898

8999
# Flag: `FORCE_COVERAGE`
@@ -94,6 +104,12 @@ else
94104
TEST_COMMAND ?= test
95105
endif
96106

107+
# Flag: `DEV`
108+
ifeq ($(DEV),yes)
109+
BASE_ARGS += --config=devkey --test_output=errors
110+
BAZELISK_PREAMBLE = GOOGLE_APPLICATION_CREDENTIALS=$(BUILDKEY_PLAINTEXT)
111+
endif
112+
97113
# Flag: `STRICT`.
98114
ifeq ($(STRICT),yes)
99115
BAZELISK_ARGS += --strict
@@ -125,7 +141,7 @@ GENHTML ?= /bin/genhtml
125141
else
126142
TAG += --config=dev
127143
IBAZEL ?= $(shell which ibazel)
128-
BAZELISK ?= $(shell which bazelisk)
144+
BAZELISK ?= $(BAZELISK_PREAMBLE) $(shell which bazelisk)
129145
GENHTML ?= $(shell which genhtml)
130146
endif
131147

@@ -163,6 +179,7 @@ dev: ## Develop against the specified target.
163179
$(_RULE)$(IBAZEL) run $(TAG) --define=LIVE_RELOAD=enabled --define=dev=enabled $(APP)
164180

165181
clean: clean-docs clean-reports ## Clean ephemeral targets.
182+
$(_RULE)rm -f $(BUILDKEY_PLAINTEXT)
166183
$(_RULE)$(BAZELISK) $(BAZELISK_ARGS) clean
167184

168185
clean-docs: ## Clean built documentation.
@@ -189,7 +206,7 @@ samples: ## Build and push sample app images.
189206
done
190207

191208
distclean: clean ## Clean targets, caches and dependencies.
192-
$(_RULE)$(BAZELISK) $(BAZELISK_ARGS) clean --expunge_async
209+
$(_RULE)$(BAZELISK) $(BAZELISK_ARGS) clean --expunge
193210

194211
forceclean: distclean ## Clean everything, and sanitize the codebase (DANGEROUS).
195212
$(_RULE)git reset --hard && git clean -xdf
@@ -287,5 +304,21 @@ release-images: ## Pull, tag, and release Docker images.
287304
$(_RULE)docker push $(REGISTRY)/sample-ssr-jvm:$(VERSION);
288305

289306

307+
## Crypto
308+
$(BUILDKEY_CIPHERTEXT):
309+
@echo "Encrypting build key..."
310+
$(_RULE)gcloud kms encrypt $(BUILDKEY_BASE_ARGS)
311+
312+
encrypt: $(BUILDKEY_CIPHERTEXT) ## Encrypt private key material.
313+
@echo "Key material encrypted."
314+
315+
$(BUILDKEY_PLAINTEXT):
316+
@echo "Decrypting build key..."
317+
$(_RULE)gcloud kms decrypt $(BUILDKEY_BASE_ARGS)
318+
319+
decrypt: $(BUILDKEY_PLAINTEXT) ## Decrypt private key material.
320+
@echo "Key material decrypted."
321+
322+
290323
.PHONY: build test help samples release-images update-deps devtools
291324

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<hr />
44

5-
_**Gust is alpha software. Consider yourself warned...**_
5+
_**Gust is beta software. Consider yourself warned...**_
66

77
<hr />
88

@@ -95,10 +95,12 @@ builder-image Build a new version of the CI builder image for G
9595
clean-docs Clean built documentation.
9696
clean-reports Clean built reports.
9797
clean Clean ephemeral targets.
98+
decrypt Decrypt private key material.
9899
dev Develop against the specified target.
99100
devtools Install local development dependencies.
100101
distclean Clean targets, caches and dependencies.
101102
docs Build documentation for the framework.
103+
encrypt Encrypt private key material.
102104
forceclean Clean everything, and sanitize the codebase (DANGEROUS).
103105
help Show this help text.
104106
release-images Pull, tag, and release Docker images.

WORKSPACE

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,33 @@ load(
5353
protobuf_deps()
5454

5555

56+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
57+
58+
59+
#
60+
# Java
61+
#
62+
63+
RULES_JVM_EXTERNAL_TAG = "3.2"
64+
RULES_JVM_EXTERNAL_SHA = "82262ff4223c5fda6fb7ff8bd63db8131b51b413d26eb49e3131037e79e324af"
65+
66+
http_archive(
67+
name = "rules_jvm_external",
68+
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
69+
sha256 = RULES_JVM_EXTERNAL_SHA,
70+
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
71+
)
72+
73+
5674
#
5775
# Extensions
5876
#
5977

6078
## NodeJS
61-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
6279
http_archive(
6380
name = "build_bazel_rules_nodejs",
64-
sha256 = "6a67a8a1bf6fddc9113f73471029b819eef4575c3a936a4a01d57e411894d692",
65-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.0.2/rules_nodejs-2.0.2.tar.gz"],
81+
sha256 = "f2194102720e662dbf193546585d705e645314319554c6ce7e47d8b59f459e9c",
82+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz"],
6683
)
6784

6885
load("@build_bazel_rules_nodejs//:index.bzl",
@@ -109,6 +126,9 @@ graal_bindist_repository(
109126
load("//defs/toolchain/java:repos.bzl", "gust_java_repositories")
110127
gust_java_repositories()
111128

129+
load("@maven//:compat.bzl", "compat_repositories")
130+
compat_repositories()
131+
112132
load("@maven//:defs.bzl", "pinned_maven_install")
113133
pinned_maven_install()
114134

@@ -189,10 +209,6 @@ browser_repositories(
189209
firefox = True,
190210
)
191211

192-
## Toolchains (RBE)
193-
load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
194-
rbe_autoconfig(name = "rbe_default")
195-
196212
## Stardoc
197213
load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")
198214
stardoc_repositories()

crypto/build-key-v1.json.enc

2.32 KB
Binary file not shown.

crypto/build-key.json.enc

2.35 KB
Binary file not shown.

0 commit comments

Comments
 (0)