forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[featureflag] expose feature flag API via frontend
Also: * propagate the change from bool to float introduced in open-telemetry#1237 more consistently via proto definitions by differentiating between the GetFlag operation (which evaluates the probabilty and therefore returns a bool) and all other operations, which need to operate with a float value/probability directly. To that end, the Flag grpc message has been split into two new types, FlagEvaluationResult and FlagDefinition. * Rename the UpdateFlag operation to UpdateFlagProbability, as it actually only updates the enabled/probability value, but not the description or the name.
- Loading branch information
Showing
14 changed files
with
1,369 additions
and
807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/bin/sh | ||
|
||
set -euo pipefail | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# This script is used to update generated code after changing demo.proto. | ||
|
||
cd -P -- "$(dirname -- "$0")" | ||
pwd | ||
|
||
command -v npm >/dev/null 2>&1 || { | ||
cat <<EOF >&2 | ||
npm needs to be installed but it isn't. | ||
Aborting. | ||
EOF | ||
exit 1 | ||
} | ||
|
||
command -v go >/dev/null 2>&1 || { | ||
cat <<EOF >&2 | ||
go needs to be installed but it isn't. | ||
Aborting. | ||
EOF | ||
exit 1 | ||
} | ||
|
||
command -v rebar3 >/dev/null 2>&1 || { | ||
cat <<EOF >&2 | ||
rebar3 needs to be installed but it isn't. | ||
Aborting. | ||
EOF | ||
exit 1 | ||
} | ||
|
||
|
||
command -v protoc >/dev/null 2>&1 || { | ||
cat <<EOF >&2 | ||
protoc needs to be installed but it isn't. | ||
Aborting. | ||
EOF | ||
exit 1 | ||
} | ||
|
||
echo "Regenerating typescript code in src/frontend based on demo.proto" | ||
pushd src/frontend > /dev/null | ||
# The npm script grpc:generate expects the pb directory to be available in the current directory (src/frontend) because it is | ||
# intended to be used during Docker build, where pb is copied to the same working directory as src/frontend. To get around that | ||
# difference, we temporarily create a symlink to pb and then remove it after the script is done. | ||
ln -s ../../pb pb | ||
npm run grpc:generate | ||
rm pb | ||
popd > /dev/null | ||
|
||
echo "Regenerating Go code in src/accountingservice based on demo.proto" | ||
pushd src/accountingservice > /dev/null | ||
go generate | ||
popd > /dev/null | ||
|
||
echo "Regenerating Go code in src/checkoutservice based on demo.proto" | ||
pushd src/checkoutservice > /dev/null | ||
go generate | ||
popd > /dev/null | ||
|
||
echo "Regenerating Go code in src/productcatalogservice based on demo.proto" | ||
pushd src/productcatalogservice > /dev/null | ||
go generate | ||
popd > /dev/null | ||
|
||
echo "Regenerating Java code in src/adservice based on demo.proto" | ||
pushd src/adservice > /dev/null | ||
./gradlew generateProto | ||
popd > /dev/null | ||
|
||
echo "Recompiling Erlang code in src/featureflagservice based on demo.proto" | ||
pushd src/featureflagservice > /dev/null | ||
# The Erlang build expects the proto file to be available in src/featureflagservice/proto) because it is | ||
# intended to be used during Docker build, where demo.proto is copied to the the proto directory in the same working directory | ||
# as the Erlang source code. To get around that difference, we temporarily create a symlink to ../../pb as proto and then remove | ||
# it after the script is done. | ||
ln -s ../../pb proto | ||
rebar3 grpc_regen | ||
rm proto | ||
popd > /dev/null | ||
|
||
|
||
echo done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -euo pipefail | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
Oops, something went wrong.