From b103a25810a31d4558e705288c86f65d743cca35 Mon Sep 17 00:00:00 2001 From: "luke.kraus@datadoghq.com" Date: Fri, 12 Apr 2024 13:22:27 -0400 Subject: [PATCH 1/2] Adding in fixes to build --- src/accountingservice/Dockerfile | 2 +- src/accountingservice/go.mod | 2 +- src/accountingservice/go.sum | 2 +- src/adservice/Dockerfile | 2 +- src/checkoutservice/Dockerfile | 2 +- src/featureflagservice/README.md | 45 ++++++ src/featureflagservice/assets/css/app.css | 135 ++++++++++++++++++ src/featureflagservice/assets/css/phoenix.css | 101 +++++++++++++ src/featureflagservice/assets/js/app.js | 48 +++++++ src/featureflagservice/config/config.exs | 47 ++++++ src/featureflagservice/config/dev.exs | 80 +++++++++++ src/featureflagservice/config/prod.exs | 54 +++++++ src/featureflagservice/config/runtime.exs | 63 ++++++++ src/featureflagservice/config/test.exs | 31 ++++ .../lib/featureflagservice.ex | 13 ++ .../lib/featureflagservice/application.ex | 41 ++++++ .../lib/featureflagservice/feature_flags.ex | 133 +++++++++++++++++ .../feature_flags/feature_flag.ex | 24 ++++ .../lib/featureflagservice/release.ex | 32 +++++ .../lib/featureflagservice/repo.ex | 9 ++ .../lib/featureflagservice_web.ex | 116 +++++++++++++++ .../controllers/feature_flag_controller.ex | 66 +++++++++ .../controllers/page_controller.ex | 14 ++ .../lib/featureflagservice_web/endpoint.ex | 50 +++++++ .../lib/featureflagservice_web/gettext.ex | 28 ++++ .../lib/featureflagservice_web/router.ex | 27 ++++ .../templates/feature_flag/edit.html.heex | 21 +++ .../templates/feature_flag/form.html.heex | 44 ++++++ .../templates/feature_flag/index.html.heex | 46 ++++++ .../templates/feature_flag/new.html.heex | 21 +++ .../templates/feature_flag/show.html.heex | 39 +++++ .../templates/layout/app.html.heex | 21 +++ .../templates/layout/live.html.heex | 27 ++++ .../templates/layout/root.html.heex | 46 ++++++ .../templates/page/index.html.heex | 46 ++++++ .../views/error_helpers.ex | 51 +++++++ .../views/error_view.ex | 20 +++ .../views/feature_flag_view.ex | 7 + .../views/layout_view.ex | 7 + .../featureflagservice_web/views/page_view.ex | 7 + src/featureflagservice/mix.exs | 86 +++++++++++ src/featureflagservice/mix.lock | 56 ++++++++ .../priv/gettext/en/LC_MESSAGES/errors.po | 112 +++++++++++++++ .../priv/gettext/errors.pot | 95 ++++++++++++ .../priv/repo/migrations/.formatter.exs | 4 + .../20220524172636_create_featureflags.exs | 50 +++++++ src/featureflagservice/priv/repo/seeds.exs | 13 ++ .../priv/static/favicon.ico | Bin 0 -> 1258 bytes .../priv/static/images/phoenix.png | Bin 0 -> 13900 bytes src/featureflagservice/priv/static/robots.txt | 5 + src/featureflagservice/rebar.config | 30 ++++ src/featureflagservice/rebar.lock | 31 ++++ .../src/featureflagservice.app.src | 28 ++++ src/featureflagservice/src/ffs_service.erl | 80 +++++++++++ .../featureflagservice/feature_flags_test.exs | 77 ++++++++++ .../feature_flag_controller_test.exs | 100 +++++++++++++ .../controllers/page_controller_test.exs | 12 ++ .../views/error_view_test.exs | 19 +++ .../views/layout_view_test.exs | 12 ++ .../views/page_view_test.exs | 7 + .../test/support/conn_case.ex | 42 ++++++ .../test/support/data_case.ex | 64 +++++++++ .../fixtures/feature_flags_fixtures.ex | 31 ++++ src/featureflagservice/test/test_helper.exs | 6 + src/productcatalogservice/Dockerfile | 2 +- src/productcatalogservice/go.mod | 51 +++++-- src/productcatalogservice/go.sum | 100 ++++++------- src/productcatalogservice/main.go | 2 - 68 files changed, 2613 insertions(+), 72 deletions(-) create mode 100644 src/featureflagservice/README.md create mode 100644 src/featureflagservice/assets/css/app.css create mode 100644 src/featureflagservice/assets/css/phoenix.css create mode 100644 src/featureflagservice/assets/js/app.js create mode 100644 src/featureflagservice/config/config.exs create mode 100644 src/featureflagservice/config/dev.exs create mode 100644 src/featureflagservice/config/prod.exs create mode 100644 src/featureflagservice/config/runtime.exs create mode 100644 src/featureflagservice/config/test.exs create mode 100644 src/featureflagservice/lib/featureflagservice.ex create mode 100644 src/featureflagservice/lib/featureflagservice/application.ex create mode 100644 src/featureflagservice/lib/featureflagservice/feature_flags.ex create mode 100644 src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex create mode 100644 src/featureflagservice/lib/featureflagservice/release.ex create mode 100644 src/featureflagservice/lib/featureflagservice/repo.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/endpoint.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/gettext.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/router.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex create mode 100644 src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/views/error_view.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex create mode 100644 src/featureflagservice/lib/featureflagservice_web/views/page_view.ex create mode 100644 src/featureflagservice/mix.exs create mode 100644 src/featureflagservice/mix.lock create mode 100644 src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po create mode 100644 src/featureflagservice/priv/gettext/errors.pot create mode 100644 src/featureflagservice/priv/repo/migrations/.formatter.exs create mode 100644 src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs create mode 100644 src/featureflagservice/priv/repo/seeds.exs create mode 100644 src/featureflagservice/priv/static/favicon.ico create mode 100644 src/featureflagservice/priv/static/images/phoenix.png create mode 100644 src/featureflagservice/priv/static/robots.txt create mode 100644 src/featureflagservice/rebar.config create mode 100644 src/featureflagservice/rebar.lock create mode 100644 src/featureflagservice/src/featureflagservice.app.src create mode 100644 src/featureflagservice/src/ffs_service.erl create mode 100644 src/featureflagservice/test/featureflagservice/feature_flags_test.exs create mode 100644 src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs create mode 100644 src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs create mode 100644 src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs create mode 100644 src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs create mode 100644 src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs create mode 100644 src/featureflagservice/test/support/conn_case.ex create mode 100644 src/featureflagservice/test/support/data_case.ex create mode 100644 src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex create mode 100644 src/featureflagservice/test/test_helper.exs diff --git a/src/accountingservice/Dockerfile b/src/accountingservice/Dockerfile index e4e042afb4..2ebde28515 100644 --- a/src/accountingservice/Dockerfile +++ b/src/accountingservice/Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -FROM registry.ddbuild.io/images/mirror/golang:1.21.4-alpine AS builder +FROM registry.ddbuild.io/images/mirror/golang:1.22-alpine AS builder WORKDIR /usr/src/app/ COPY ./src/accountingservice/ ./ diff --git a/src/accountingservice/go.mod b/src/accountingservice/go.mod index 3de67e95a4..bfccb84d59 100644 --- a/src/accountingservice/go.mod +++ b/src/accountingservice/go.mod @@ -45,4 +45,4 @@ require ( golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect -) +) \ No newline at end of file diff --git a/src/accountingservice/go.sum b/src/accountingservice/go.sum index 32fa63be25..97e5698b16 100644 --- a/src/accountingservice/go.sum +++ b/src/accountingservice/go.sum @@ -146,4 +146,4 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= \ No newline at end of file diff --git a/src/adservice/Dockerfile b/src/adservice/Dockerfile index 1166e8423d..60f31e0889 100644 --- a/src/adservice/Dockerfile +++ b/src/adservice/Dockerfile @@ -24,7 +24,7 @@ ARG version=2.0.0 WORKDIR /usr/src/app/ COPY --from=builder /usr/src/app/ ./ -ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$version/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar +ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$version/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar EXPOSE ${AD_SERVICE_PORT} diff --git a/src/checkoutservice/Dockerfile b/src/checkoutservice/Dockerfile index 08877ed507..e0d3702edb 100644 --- a/src/checkoutservice/Dockerfile +++ b/src/checkoutservice/Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -FROM registry.ddbuild.io/images/mirror/golang:1.21.4-alpine AS builder +FROM registry.ddbuild.io/images/mirror/golang:1.22-alpine AS builder WORKDIR /usr/src/app/ COPY ./src/checkoutservice/ ./ diff --git a/src/featureflagservice/README.md b/src/featureflagservice/README.md new file mode 100644 index 0000000000..dab7f0232d --- /dev/null +++ b/src/featureflagservice/README.md @@ -0,0 +1,45 @@ +# Feature Flag Service + +This project provides an web interface for creating and updating feature flags +and a GRPC service for fetching the status of flags by their name. Each runs on +their own port but are in the same Release. + +## Running + +To run individually and not part of the demo the Release can be built with +`mix`: + +``` shell +MIX_ENV=prod mix release +``` + +Then start Postgres with `docker compose` + +``` shell +docker compose up +``` + +And run the Release: + +``` shell +PHX_SERVER=1 FEATURE_FLAG_SERVICE_PORT=4000 FEATURE_FLAG_GRPC_SERVICE_PORT=4001 _build/prod/rel/featureflagservice/bin/featureflagservice start_iex +``` + +## Instrumentation + +Traces of interaction with the web interface is provided by the OpenTelemetry +[Phoenix +instrumentation](https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/instrumentation/opentelemetry_phoenix) +with Spans for database queries added through the [Ecto +instrumentation](https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/instrumentation/opentelemetry_ecto). + +The GRPC service uses [grpcbox](https://github.com/tsloughter/grpcbox) and uses +the [grpcbox +interceptor](https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/instrumentation/opentelemetry_grpcbox) +for instrumentation. + +## Building Protos + +A copy of the protos from `pb/demo.proto` are kept in +`proto/demo.proto` and `rebar3 grpc_regen` will update the corresponding +Erlang module `src/ffs_demo_pb.erl`. diff --git a/src/featureflagservice/assets/css/app.css b/src/featureflagservice/assets/css/app.css new file mode 100644 index 0000000000..eff8666199 --- /dev/null +++ b/src/featureflagservice/assets/css/app.css @@ -0,0 +1,135 @@ +/** +* Copyright The OpenTelemetry Authors +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +@import "./phoenix.css"; + +/* Alerts and form errors used by phx.new */ +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.alert p { + margin-bottom: 0; +} +.alert:empty { + display: none; +} +.invalid-feedback { + color: #a94442; + display: block; + margin: -1rem 0 2rem; +} + +/* LiveView specific classes for your customization */ +.phx-no-feedback.invalid-feedback, +.phx-no-feedback .invalid-feedback { + display: none; +} + +.phx-click-loading { + opacity: 0.5; + transition: opacity 1s ease-out; +} + +.phx-loading{ + cursor: wait; +} + +.phx-modal { + opacity: 1!important; + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0,0,0,0.4); +} + +.phx-modal-content { + background-color: #fefefe; + margin: 15vh auto; + padding: 20px; + border: 1px solid #888; + width: 80%; +} + +.phx-modal-close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.phx-modal-close:hover, +.phx-modal-close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} + +.fade-in-scale { + animation: 0.2s ease-in 0s normal forwards 1 fade-in-scale-keys; +} + +.fade-out-scale { + animation: 0.2s ease-out 0s normal forwards 1 fade-out-scale-keys; +} + +.fade-in { + animation: 0.2s ease-out 0s normal forwards 1 fade-in-keys; +} +.fade-out { + animation: 0.2s ease-out 0s normal forwards 1 fade-out-keys; +} + +@keyframes fade-in-scale-keys{ + 0% { scale: 0.95; opacity: 0; } + 100% { scale: 1.0; opacity: 1; } +} + +@keyframes fade-out-scale-keys{ + 0% { scale: 1.0; opacity: 1; } + 100% { scale: 0.95; opacity: 0; } +} + +@keyframes fade-in-keys{ + 0% { opacity: 0; } + 100% { opacity: 1; } +} + +@keyframes fade-out-keys{ + 0% { opacity: 1; } + 100% { opacity: 0; } +} diff --git a/src/featureflagservice/assets/css/phoenix.css b/src/featureflagservice/assets/css/phoenix.css new file mode 100644 index 0000000000..0d59050f89 --- /dev/null +++ b/src/featureflagservice/assets/css/phoenix.css @@ -0,0 +1,101 @@ +/* Includes some default style for the starter application. + * This can be safely deleted to start fresh. + */ + +/* Milligram v1.4.1 https://milligram.github.io + * Copyright (c) 2020 CJ Patoilo Licensed under the MIT license + */ + +*,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{color:#000000;font-family:'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;font-size:1.6em;font-weight:300;letter-spacing:.01em;line-height:1.6}blockquote{border-left:0.3rem solid #d1d1d1;margin-left:0;margin-right:0;padding:1rem 1.5rem}blockquote *:last-child{margin-bottom:0}.button,button,input[type='button'],input[type='reset'],input[type='submit']{background-color:#0069d9;border:0.1rem solid #0069d9;border-radius:.4rem;color:#fff;cursor:pointer;display:inline-block;font-size:1.1rem;font-weight:700;height:3.8rem;letter-spacing:.1rem;line-height:3.8rem;padding:0 3.0rem;text-align:center;text-decoration:none;text-transform:uppercase;white-space:nowrap}.button:focus,.button:hover,button:focus,button:hover,input[type='button']:focus,input[type='button']:hover,input[type='reset']:focus,input[type='reset']:hover,input[type='submit']:focus,input[type='submit']:hover{background-color:#606c76;border-color:#606c76;color:#fff;outline:0}.button[disabled],button[disabled],input[type='button'][disabled],input[type='reset'][disabled],input[type='submit'][disabled]{cursor:default;opacity:.5}.button[disabled]:focus,.button[disabled]:hover,button[disabled]:focus,button[disabled]:hover,input[type='button'][disabled]:focus,input[type='button'][disabled]:hover,input[type='reset'][disabled]:focus,input[type='reset'][disabled]:hover,input[type='submit'][disabled]:focus,input[type='submit'][disabled]:hover{background-color:#0069d9;border-color:#0069d9}.button.button-outline,button.button-outline,input[type='button'].button-outline,input[type='reset'].button-outline,input[type='submit'].button-outline{background-color:transparent;color:#0069d9}.button.button-outline:focus,.button.button-outline:hover,button.button-outline:focus,button.button-outline:hover,input[type='button'].button-outline:focus,input[type='button'].button-outline:hover,input[type='reset'].button-outline:focus,input[type='reset'].button-outline:hover,input[type='submit'].button-outline:focus,input[type='submit'].button-outline:hover{background-color:transparent;border-color:#606c76;color:#606c76}.button.button-outline[disabled]:focus,.button.button-outline[disabled]:hover,button.button-outline[disabled]:focus,button.button-outline[disabled]:hover,input[type='button'].button-outline[disabled]:focus,input[type='button'].button-outline[disabled]:hover,input[type='reset'].button-outline[disabled]:focus,input[type='reset'].button-outline[disabled]:hover,input[type='submit'].button-outline[disabled]:focus,input[type='submit'].button-outline[disabled]:hover{border-color:inherit;color:#0069d9}.button.button-clear,button.button-clear,input[type='button'].button-clear,input[type='reset'].button-clear,input[type='submit'].button-clear{background-color:transparent;border-color:transparent;color:#0069d9}.button.button-clear:focus,.button.button-clear:hover,button.button-clear:focus,button.button-clear:hover,input[type='button'].button-clear:focus,input[type='button'].button-clear:hover,input[type='reset'].button-clear:focus,input[type='reset'].button-clear:hover,input[type='submit'].button-clear:focus,input[type='submit'].button-clear:hover{background-color:transparent;border-color:transparent;color:#606c76}.button.button-clear[disabled]:focus,.button.button-clear[disabled]:hover,button.button-clear[disabled]:focus,button.button-clear[disabled]:hover,input[type='button'].button-clear[disabled]:focus,input[type='button'].button-clear[disabled]:hover,input[type='reset'].button-clear[disabled]:focus,input[type='reset'].button-clear[disabled]:hover,input[type='submit'].button-clear[disabled]:focus,input[type='submit'].button-clear[disabled]:hover{color:#0069d9}code{background:#f4f5f6;border-radius:.4rem;font-size:86%;margin:0 .2rem;padding:.2rem .5rem;white-space:nowrap}pre{background:#f4f5f6;border-left:0.3rem solid #0069d9;overflow-y:hidden}pre>code{border-radius:0;display:block;padding:1rem 1.5rem;white-space:pre}hr{border:0;border-top:0.1rem solid #f4f5f6;margin:3.0rem 0}input[type='color'],input[type='date'],input[type='datetime'],input[type='datetime-local'],input[type='email'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='url'],input[type='week'],input:not([type]),textarea,select{-webkit-appearance:none;background-color:transparent;border:0.1rem solid #d1d1d1;border-radius:.4rem;box-shadow:none;box-sizing:inherit;height:3.8rem;padding:.6rem 1.0rem .7rem;width:100%}input[type='color']:focus,input[type='date']:focus,input[type='datetime']:focus,input[type='datetime-local']:focus,input[type='email']:focus,input[type='month']:focus,input[type='number']:focus,input[type='password']:focus,input[type='search']:focus,input[type='tel']:focus,input[type='text']:focus,input[type='url']:focus,input[type='week']:focus,input:not([type]):focus,textarea:focus,select:focus{border-color:#0069d9;outline:0}select{background:url('data:image/svg+xml;utf8,') center right no-repeat;padding-right:3.0rem}select:focus{background-image:url('data:image/svg+xml;utf8,')}select[multiple]{background:none;height:auto}textarea{min-height:6.5rem}label,legend{display:block;font-size:1.6rem;font-weight:700;margin-bottom:.5rem}fieldset{border-width:0;padding:0}input[type='checkbox'],input[type='radio']{display:inline}.label-inline{display:inline-block;font-weight:normal;margin-left:.5rem}.container{margin:0 auto;max-width:112.0rem;padding:0 2.0rem;position:relative;width:100%}.row{display:flex;flex-direction:column;padding:0;width:100%}.row.row-no-padding{padding:0}.row.row-no-padding>.column{padding:0}.row.row-wrap{flex-wrap:wrap}.row.row-top{align-items:flex-start}.row.row-bottom{align-items:flex-end}.row.row-center{align-items:center}.row.row-stretch{align-items:stretch}.row.row-baseline{align-items:baseline}.row .column{display:block;flex:1 1 auto;margin-left:0;max-width:100%;width:100%}.row .column.column-offset-10{margin-left:10%}.row .column.column-offset-20{margin-left:20%}.row .column.column-offset-25{margin-left:25%}.row .column.column-offset-33,.row .column.column-offset-34{margin-left:33.3333%}.row .column.column-offset-40{margin-left:40%}.row .column.column-offset-50{margin-left:50%}.row .column.column-offset-60{margin-left:60%}.row .column.column-offset-66,.row .column.column-offset-67{margin-left:66.6666%}.row .column.column-offset-75{margin-left:75%}.row .column.column-offset-80{margin-left:80%}.row .column.column-offset-90{margin-left:90%}.row .column.column-10{flex:0 0 10%;max-width:10%}.row .column.column-20{flex:0 0 20%;max-width:20%}.row .column.column-25{flex:0 0 25%;max-width:25%}.row .column.column-33,.row .column.column-34{flex:0 0 33.3333%;max-width:33.3333%}.row .column.column-40{flex:0 0 40%;max-width:40%}.row .column.column-50{flex:0 0 50%;max-width:50%}.row .column.column-60{flex:0 0 60%;max-width:60%}.row .column.column-66,.row .column.column-67{flex:0 0 66.6666%;max-width:66.6666%}.row .column.column-75{flex:0 0 75%;max-width:75%}.row .column.column-80{flex:0 0 80%;max-width:80%}.row .column.column-90{flex:0 0 90%;max-width:90%}.row .column .column-top{align-self:flex-start}.row .column .column-bottom{align-self:flex-end}.row .column .column-center{align-self:center}@media (min-width: 40rem){.row{flex-direction:row;margin-left:-1.0rem;width:calc(100% + 2.0rem)}.row .column{margin-bottom:inherit;padding:0 1.0rem}}a{color:#0069d9;text-decoration:none}a:focus,a:hover{color:#606c76}dl,ol,ul{list-style:none;margin-top:0;padding-left:0}dl dl,dl ol,dl ul,ol dl,ol ol,ol ul,ul dl,ul ol,ul ul{font-size:90%;margin:1.5rem 0 1.5rem 3.0rem}ol{list-style:decimal inside}ul{list-style:circle inside}.button,button,dd,dt,li{margin-bottom:1.0rem}fieldset,input,select,textarea{margin-bottom:1.5rem}blockquote,dl,figure,form,ol,p,pre,table,ul{margin-bottom:2.5rem}table{border-spacing:0;display:block;overflow-x:auto;text-align:left;width:100%}td,th{border-bottom:0.1rem solid #e1e1e1;padding:1.2rem 1.5rem}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}@media (min-width: 40rem){table{display:table;overflow-x:initial}}b,strong{font-weight:bold}p{margin-top:0}h1,h2,h3,h4,h5,h6{font-weight:300;letter-spacing:-.1rem;margin-bottom:2.0rem;margin-top:0}h1{font-size:4.6rem;line-height:1.2}h2{font-size:3.6rem;line-height:1.25}h3{font-size:2.8rem;line-height:1.3}h4{font-size:2.2rem;letter-spacing:-.08rem;line-height:1.35}h5{font-size:1.8rem;letter-spacing:-.05rem;line-height:1.5}h6{font-size:1.6rem;letter-spacing:0;line-height:1.4}img{max-width:100%}.clearfix:after{clear:both;content:' ';display:table}.float-left{float:left}.float-right{float:right} + +/* General style */ +h1{font-size: 3.6rem; line-height: 1.25} +h2{font-size: 2.8rem; line-height: 1.3} +h3{font-size: 2.2rem; letter-spacing: -.08rem; line-height: 1.35} +h4{font-size: 1.8rem; letter-spacing: -.05rem; line-height: 1.5} +h5{font-size: 1.6rem; letter-spacing: 0; line-height: 1.4} +h6{font-size: 1.4rem; letter-spacing: 0; line-height: 1.2} +pre{padding: 1em;} + +.container{ + margin: 0 auto; + max-width: 80.0rem; + padding: 0 2.0rem; + position: relative; + width: 100% +} +select { + width: auto; +} + +/* Phoenix promo and logo */ +.phx-hero { + text-align: center; + border-bottom: 1px solid #e3e3e3; + background: #eee; + border-radius: 6px; + padding: 3em 3em 1em; + margin-bottom: 3rem; + font-weight: 200; + font-size: 120%; +} +.phx-hero input { + background: #ffffff; +} +.phx-logo { + min-width: 300px; + margin: 1rem; + display: block; +} +.phx-logo img { + width: auto; + display: block; +} + +/* Headers */ +header { + width: 100%; + background: #fdfdfd; + border-bottom: 1px solid #eaeaea; + margin-bottom: 2rem; +} +header section { + align-items: center; + display: flex; + flex-direction: column; + justify-content: space-between; +} +header section :first-child { + order: 2; +} +header section :last-child { + order: 1; +} +header nav ul, +header nav li { + margin: 0; + padding: 0; + display: block; + text-align: right; + white-space: nowrap; +} +header nav ul { + margin: 1rem; + margin-top: 0; +} +header nav a { + display: block; +} + +@media (min-width: 40.0rem) { /* Small devices (landscape phones, 576px and up) */ + header section { + flex-direction: row; + } + header nav ul { + margin: 1rem; + } + .phx-logo { + flex-basis: 527px; + margin: 2rem 1rem; + } +} diff --git a/src/featureflagservice/assets/js/app.js b/src/featureflagservice/assets/js/app.js new file mode 100644 index 0000000000..ab36ce2028 --- /dev/null +++ b/src/featureflagservice/assets/js/app.js @@ -0,0 +1,48 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// We import the CSS which is extracted to its own file by esbuild. +// Remove this line if you add a your own CSS build pipeline (e.g postcss). +import "../css/app.css" + +// If you want to use Phoenix channels, run `mix help phx.gen.channel` +// to get started and then uncomment the line below. +// import "./user_socket.js" + +// You can include dependencies in two ways. +// +// The simplest option is to put them in assets/vendor and +// import them using relative paths: +// +// import "../vendor/some-package.js" +// +// Alternatively, you can `npm install some-package --prefix assets` and import +// them using a path starting with the package name: +// +// import "some-package" +// + +// Include phoenix_html to handle method=PUT/DELETE in forms and buttons. +import "phoenix_html" +// Establish Phoenix Socket and LiveView configuration. +import {Socket} from "phoenix" +import {LiveSocket} from "phoenix_live_view" +import topbar from "../vendor/topbar" + +let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content") +let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}}) + +// Show progress bar on live navigation and form submits +topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"}) +window.addEventListener("phx:page-loading-start", info => topbar.show()) +window.addEventListener("phx:page-loading-stop", info => topbar.hide()) + +// connect if there are any LiveViews on the page +liveSocket.connect() + +// expose liveSocket on window for web console debug logs and latency simulation: +// >> liveSocket.enableDebug() +// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session +// >> liveSocket.disableLatencySim() +window.liveSocket = liveSocket + diff --git a/src/featureflagservice/config/config.exs b/src/featureflagservice/config/config.exs new file mode 100644 index 0000000000..4c4bae47fe --- /dev/null +++ b/src/featureflagservice/config/config.exs @@ -0,0 +1,47 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +# This file is responsible for configuring your application +# and its dependencies with the aid of the Config module. +# +# This configuration file is loaded before any dependency and +# is restricted to this project. + +# General application configuration +import Config + +config :featureflagservice, + ecto_repos: [Featureflagservice.Repo] + +# Configures the endpoint +config :featureflagservice, FeatureflagserviceWeb.Endpoint, + url: [host: "localhost", path: "/feature"], + render_errors: [view: FeatureflagserviceWeb.ErrorView, accepts: ~w(html json), layout: false], + pubsub_server: Featureflagservice.PubSub, + live_view: [signing_salt: "T88WPl/Q"] + +# Configure esbuild (the version is required) +config :esbuild, + version: "0.14.29", + default: [ + args: + ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*), + cd: Path.expand("../assets", __DIR__), + env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)} + ] + +# Configures Elixir's Logger +config :logger, :console, + format: "$time $metadata[$level] $message\n", + metadata: [:request_id] + +config :logger, + level: :debug + +# Use Jason for JSON parsing in Phoenix +config :phoenix, :json_library, Jason + +# Import environment specific config. This must remain at the bottom +# of this file so it overrides the configuration defined above. +import_config "#{config_env()}.exs" diff --git a/src/featureflagservice/config/dev.exs b/src/featureflagservice/config/dev.exs new file mode 100644 index 0000000000..8f5e1f1059 --- /dev/null +++ b/src/featureflagservice/config/dev.exs @@ -0,0 +1,80 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +import Config + +# Configure your database +config :featureflagservice, Featureflagservice.Repo, + username: "postgres", + password: "postgres", + hostname: "localhost", + database: "featureflagservice_dev", + stacktrace: true, + show_sensitive_data_on_connection_error: true, + pool_size: 10 + +# For development, we disable any cache and enable +# debugging and code reloading. +# +# The watchers configuration can be used to run external +# watchers to your application. For example, we use it +# with esbuild to bundle .js and .css sources. +config :featureflagservice, FeatureflagserviceWeb.Endpoint, + # Binding to loopback ipv4 address prevents access from other machines. + # Change to `ip: {0, 0, 0, 0}` to allow access from other machines. + http: [ip: {127, 0, 0, 1}, port: 4000], + check_origin: false, + code_reloader: true, + debug_errors: true, + secret_key_base: "GH1AJrEOJEVmzyUE+5kgz2cfBEOg5qPBlTYVive++6s/QS0BE3xjNoRCd7xI3zSv", + watchers: [ + # Start the esbuild watcher by calling Esbuild.install_and_run(:default, args) + esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]} + ] + +# ## SSL Support +# +# In order to use HTTPS in development, a self-signed +# certificate can be generated by running the following +# Mix task: +# +# mix phx.gen.cert +# +# Note that this task requires Erlang/OTP 20 or later. +# Run `mix help phx.gen.cert` for more information. +# +# The `http:` config above can be replaced with: +# +# https: [ +# port: 4001, +# cipher_suite: :strong, +# keyfile: "priv/cert/selfsigned_key.pem", +# certfile: "priv/cert/selfsigned.pem" +# ], +# +# If desired, both `http:` and `https:` keys can be +# configured to run both http and https servers on +# different ports. + +# Watch static and templates for browser reloading. +config :featureflagservice, FeatureflagserviceWeb.Endpoint, + live_reload: [ + patterns: [ + ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$", + ~r"priv/gettext/.*(po)$", + ~r"lib/featureflagservice_web/(live|views)/.*(ex)$", + ~r"lib/featureflagservice_web/templates/.*(eex)$" + ] + ] + +# Do not include metadata nor timestamps in development logs +config :logger, :console, format: "[$level] $message\n" +config :logger, level: :debug + +# Set a higher stacktrace during development. Avoid configuring such +# in production as building large stacktraces may be expensive. +config :phoenix, :stacktrace_depth, 20 + +# Initialize plugs at runtime for faster development compilation +config :phoenix, :plug_init_mode, :runtime diff --git a/src/featureflagservice/config/prod.exs b/src/featureflagservice/config/prod.exs new file mode 100644 index 0000000000..b4fb5e0ff2 --- /dev/null +++ b/src/featureflagservice/config/prod.exs @@ -0,0 +1,54 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +import Config + +# For production, don't forget to configure the url host +# to something meaningful, Phoenix uses this information +# when generating URLs. +# +# Note we also include the path to a cache manifest +# containing the digested version of static files. This +# manifest is generated by the `mix phx.digest` task, +# which you should run after static files are built and +# before starting your production server. +config :featureflagservice, FeatureflagserviceWeb.Endpoint, + cache_static_manifest: "priv/static/cache_manifest.json" + +# Do not print debug messages in production +config :logger, level: :info + +# ## SSL Support +# +# To get SSL working, you will need to add the `https` key +# to the previous section and set your `:url` port to 443: +# +# config :featureflagservice, FeatureflagserviceWeb.Endpoint, +# ..., +# url: [host: "example.com", port: 443], +# https: [ +# ..., +# port: 443, +# cipher_suite: :strong, +# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"), +# certfile: System.get_env("SOME_APP_SSL_CERT_PATH") +# ] +# +# The `cipher_suite` is set to `:strong` to support only the +# latest and more secure SSL ciphers. This means old browsers +# and clients may not be supported. You can set it to +# `:compatible` for wider support. +# +# `:keyfile` and `:certfile` expect an absolute path to the key +# and cert in disk or a relative path inside priv, for example +# "priv/ssl/server.key". For all supported SSL configuration +# options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1 +# +# We also recommend setting `force_ssl` in your endpoint, ensuring +# no data is ever sent via http, always redirecting to https: +# +# config :featureflagservice, FeatureflagserviceWeb.Endpoint, +# force_ssl: [hsts: true] +# +# Check `Plug.SSL` for all available options in `force_ssl`. diff --git a/src/featureflagservice/config/runtime.exs b/src/featureflagservice/config/runtime.exs new file mode 100644 index 0000000000..c16d214d35 --- /dev/null +++ b/src/featureflagservice/config/runtime.exs @@ -0,0 +1,63 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +import Config + +if System.get_env("PHX_SERVER") do + config :featureflagservice, FeatureflagserviceWeb.Endpoint, server: true +end + +grpc_port = String.to_integer(System.get_env("FEATURE_FLAG_GRPC_SERVICE_PORT")) + +config :grpcbox, + servers: [ + %{ + :grpc_opts => %{ + :service_protos => [:ffs_demo_pb], + :unary_interceptor => {:otel_grpcbox_interceptor, :unary}, + :services => %{:"oteldemo.FeatureFlagService" => :ffs_service} + }, + :listen_opts => %{:port => grpc_port} + } + ] + +if config_env() == :prod do + database_url = + System.get_env("DATABASE_URL") || + raise """ + environment variable DATABASE_URL is missing. + For example: ecto://USER:PASS@HOST/DATABASE + """ + + maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: [] + + config :featureflagservice, Featureflagservice.Repo, + # ssl: true, + url: database_url, + pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), + socket_options: maybe_ipv6 + + # The secret key base is used to sign/encrypt cookies and other secrets. + # A default value is used in config/dev.exs and config/test.exs but you + # want to use a different value for prod and you most likely don't want + # to check this value into version control, so we use an environment + # variable instead. + secret_key_base = + System.get_env("SECRET_KEY_BASE") || + raise """ + environment variable SECRET_KEY_BASE is missing. + You can generate one by calling: mix phx.gen.secret + """ + + host = System.get_env("PHX_HOST") || "localhost" + port = String.to_integer(System.get_env("FEATURE_FLAG_SERVICE_PORT")) + + config :featureflagservice, FeatureflagserviceWeb.Endpoint, + url: [host: host, port: 443, scheme: "https"], + http: [ + ip: {0, 0, 0, 0}, + port: port + ], + secret_key_base: secret_key_base +end diff --git a/src/featureflagservice/config/test.exs b/src/featureflagservice/config/test.exs new file mode 100644 index 0000000000..8da154d22c --- /dev/null +++ b/src/featureflagservice/config/test.exs @@ -0,0 +1,31 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +import Config + +# Configure your database +# +# The MIX_TEST_PARTITION environment variable can be used +# to provide built-in test partitioning in CI environment. +# Run `mix help test` for more information. +config :featureflagservice, Featureflagservice.Repo, + username: "postgres", + password: "postgres", + hostname: "localhost", + database: "featureflagservice_test#{System.get_env("MIX_TEST_PARTITION")}", + pool: Ecto.Adapters.SQL.Sandbox, + pool_size: 10 + +# We don't run a server during test. If one is required, +# you can enable the server option below. +config :featureflagservice, FeatureflagserviceWeb.Endpoint, + http: [ip: {127, 0, 0, 1}, port: 4002], + secret_key_base: "HcCBiW6WwFO9llsQig9V6rxpIwlHoKC722YEs/ANSl+w6uJG1aAbeSZOcR/3sA57", + server: false + +# Print only warnings and errors during test +config :logger, level: :warn + +# Initialize plugs at runtime for faster test compilation +config :phoenix, :plug_init_mode, :runtime diff --git a/src/featureflagservice/lib/featureflagservice.ex b/src/featureflagservice/lib/featureflagservice.ex new file mode 100644 index 0000000000..fca24ccdc5 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice.ex @@ -0,0 +1,13 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice do + @moduledoc """ + Featureflagservice keeps the contexts that define your domain + and business logic. + + Contexts are also responsible for managing your data, regardless + if it comes from the database, an external API or others. + """ +end diff --git a/src/featureflagservice/lib/featureflagservice/application.ex b/src/featureflagservice/lib/featureflagservice/application.ex new file mode 100644 index 0000000000..8f2d3332a1 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice/application.ex @@ -0,0 +1,41 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.Application do + # See https://hexdocs.pm/elixir/Application.html + # for more information on OTP Applications + @moduledoc false + + use Application + + @impl true + def start(_type, _args) do + OpentelemetryEcto.setup([:featureflagservice, :repo]) + OpentelemetryPhoenix.setup() + + children = [ + # Start the Ecto repository + Featureflagservice.Repo, + # Start the PubSub system + {Phoenix.PubSub, name: Featureflagservice.PubSub}, + # Start the Endpoint (http/https) + FeatureflagserviceWeb.Endpoint + # Start a worker by calling: Featureflagservice.Worker.start_link(arg) + # {Featureflagservice.Worker, arg} + ] + + # See https://hexdocs.pm/elixir/Supervisor.html + # for other strategies and supported options + opts = [strategy: :one_for_one, name: Featureflagservice.Supervisor] + Supervisor.start_link(children, opts) + end + + # Tell Phoenix to update the endpoint configuration + # whenever the application is updated. + @impl true + def config_change(changed, _new, removed) do + FeatureflagserviceWeb.Endpoint.config_change(changed, removed) + :ok + end +end diff --git a/src/featureflagservice/lib/featureflagservice/feature_flags.ex b/src/featureflagservice/lib/featureflagservice/feature_flags.ex new file mode 100644 index 0000000000..7897c49989 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice/feature_flags.ex @@ -0,0 +1,133 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.FeatureFlags do + @moduledoc """ + The FeatureFlags context. + """ + + import Ecto.Query, warn: false + + require OpenTelemetry.Tracer + + alias Featureflagservice.Repo + + alias Featureflagservice.FeatureFlags.FeatureFlag + + @doc """ + Returns the list of featureflags. + + ## Examples + + iex> list_feature_flags() + [%FeatureFlag{}, ...] + + """ + def list_feature_flags do + Repo.all(FeatureFlag) + end + + @doc """ + Gets a single feature_flag. + + Raises `Ecto.NoResultsError` if the Feature flag does not exist. + + ## Examples + + iex> get_feature_flag!(123) + %FeatureFlag{} + + iex> get_feature_flag!(456) + ** (Ecto.NoResultsError) + + """ + def get_feature_flag!(id), do: Repo.get!(FeatureFlag, id) + + @doc """ + Gets a single feature_flag by name. + + ## Examples + + iex> get_feature_flag_by_name("feature-1") + %FeatureFlag{} + + iex> get_feature_flag_by_name("not-a-feature-flag") + nil + + """ + def get_feature_flag_by_name(name), do: Repo.get_by(FeatureFlag, name: name) + + @doc """ + Creates a feature_flag. + + ## Examples + + iex> create_feature_flag(%{field: value}) + {:ok, %FeatureFlag{}} + + iex> create_feature_flag(%{field: bad_value}) + {:error, %Ecto.Changeset{}} + + """ + def create_feature_flag(attrs \\ %{}) do + {function_name, arity} = __ENV__.function + OpenTelemetry.Tracer.with_span "featureflagservice.featureflags.#{function_name}/#{arity}" do + OpenTelemetry.Tracer.set_attributes(%{ + "app.featureflag.name" => attrs["name"], + "app.featureflag.description" => attrs["description"], + "app.featureflag.enabled" => attrs["enabled"] + }) + %FeatureFlag{} + |> FeatureFlag.changeset(attrs) + |> Repo.insert() + end + end + + @doc """ + Updates a feature_flag. + + ## Examples + + iex> update_feature_flag(feature_flag, %{field: new_value}) + {:ok, %FeatureFlag{}} + + iex> update_feature_flag(feature_flag, %{field: bad_value}) + {:error, %Ecto.Changeset{}} + + """ + def update_feature_flag(%FeatureFlag{} = feature_flag, attrs) do + feature_flag + |> FeatureFlag.changeset(attrs) + |> Repo.update() + end + + @doc """ + Deletes a feature_flag. + + ## Examples + + iex> delete_feature_flag(feature_flag) + {:ok, %FeatureFlag{}} + + iex> delete_feature_flag(feature_flag) + {:error, %Ecto.Changeset{}} + + """ + def delete_feature_flag(%FeatureFlag{} = feature_flag) do + Repo.delete(feature_flag) + end + + @doc """ + Returns an `%Ecto.Changeset{}` for tracking feature_flag changes. + + ## Examples + + iex> change_feature_flag(feature_flag) + %Ecto.Changeset{data: %FeatureFlag{}} + + """ + def change_feature_flag(%FeatureFlag{} = feature_flag, attrs \\ %{}) do + FeatureFlag.changeset(feature_flag, attrs) + end +end diff --git a/src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex b/src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex new file mode 100644 index 0000000000..ed68a5841a --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex @@ -0,0 +1,24 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +defmodule Featureflagservice.FeatureFlags.FeatureFlag do + use Ecto.Schema + import Ecto.Changeset + + schema "featureflags" do + field :description, :string + field :enabled, :float, default: 0.0 + field :name, :string + + timestamps() + end + + @doc false + def changeset(feature_flag, attrs) do + feature_flag + |> cast(attrs, [:name, :description, :enabled]) + |> validate_required([:name, :description, :enabled]) + |> validate_number(:enabled, greater_than_or_equal_to: 0.0, less_than_or_equal_to: 1.0) + |> unique_constraint(:name) + end +end diff --git a/src/featureflagservice/lib/featureflagservice/release.ex b/src/featureflagservice/lib/featureflagservice/release.ex new file mode 100644 index 0000000000..0bcfdceb97 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice/release.ex @@ -0,0 +1,32 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.Release do + @moduledoc """ + Used for executing DB release tasks when run in production without Mix + installed. + """ + @app :featureflagservice + + def migrate do + load_app() + + for repo <- repos() do + {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) + end + end + + def rollback(repo, version) do + load_app() + {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) + end + + defp repos do + Application.fetch_env!(@app, :ecto_repos) + end + + defp load_app do + Application.load(@app) + end +end diff --git a/src/featureflagservice/lib/featureflagservice/repo.ex b/src/featureflagservice/lib/featureflagservice/repo.ex new file mode 100644 index 0000000000..0cf9c3807d --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice/repo.ex @@ -0,0 +1,9 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.Repo do + use Ecto.Repo, + otp_app: :featureflagservice, + adapter: Ecto.Adapters.Postgres +end diff --git a/src/featureflagservice/lib/featureflagservice_web.ex b/src/featureflagservice/lib/featureflagservice_web.ex new file mode 100644 index 0000000000..711f36e56d --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web.ex @@ -0,0 +1,116 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb do + @moduledoc """ + The entrypoint for defining your web interface, such + as controllers, views, channels and so on. + + This can be used in your application as: + + use FeatureflagserviceWeb, :controller + use FeatureflagserviceWeb, :view + + The definitions below will be executed for every view, + controller, etc, so keep them short and clean, focused + on imports, uses and aliases. + + Do NOT define functions inside the quoted expressions + below. Instead, define any helper function in modules + and import those modules here. + """ + + def controller do + quote do + use Phoenix.Controller, namespace: FeatureflagserviceWeb + + import Plug.Conn + import FeatureflagserviceWeb.Gettext + alias FeatureflagserviceWeb.Router.Helpers, as: Routes + end + end + + def view do + quote do + use Phoenix.View, + root: "lib/featureflagservice_web/templates", + namespace: FeatureflagserviceWeb + + # Import moved helpers + use Phoenix.Component + # Import convenience functions from controllers + import Phoenix.Controller, + only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1] + + # Include shared imports and aliases for views + unquote(view_helpers()) + end + end + + def live_view do + quote do + use Phoenix.LiveView, + layout: {FeatureflagserviceWeb.LayoutView, "live.html"} + + unquote(view_helpers()) + end + end + + def live_component do + quote do + use Phoenix.LiveComponent + + unquote(view_helpers()) + end + end + + def component do + quote do + use Phoenix.Component + + unquote(view_helpers()) + end + end + + def router do + quote do + use Phoenix.Router + + import Plug.Conn + import Phoenix.Controller + import Phoenix.LiveView.Router + end + end + + def channel do + quote do + use Phoenix.Channel + import FeatureflagserviceWeb.Gettext + end + end + + defp view_helpers do + quote do + # Use all HTML functionality (forms, tags, etc) + use Phoenix.HTML + + # Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc) + import Phoenix.LiveView.Helpers + + # Import basic rendering functionality (render, render_layout, etc) + import Phoenix.View + + import FeatureflagserviceWeb.ErrorHelpers + import FeatureflagserviceWeb.Gettext + alias FeatureflagserviceWeb.Router.Helpers, as: Routes + end + end + + @doc """ + When used, dispatch to the appropriate controller/view/etc. + """ + defmacro __using__(which) when is_atom(which) do + apply(__MODULE__, which, []) + end +end diff --git a/src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex b/src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex new file mode 100644 index 0000000000..00639df0c9 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex @@ -0,0 +1,66 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.FeatureFlagController do + use FeatureflagserviceWeb, :controller + + alias Featureflagservice.FeatureFlags + alias Featureflagservice.FeatureFlags.FeatureFlag + + def index(conn, _params) do + featureflags = FeatureFlags.list_feature_flags() + render(conn, "index.html", featureflags: featureflags) + end + + def new(conn, _params) do + changeset = FeatureFlags.change_feature_flag(%FeatureFlag{}) + render(conn, "new.html", changeset: changeset) + end + + def create(conn, %{"feature_flag" => feature_flag_params}) do + case FeatureFlags.create_feature_flag(feature_flag_params) do + {:ok, feature_flag} -> + conn + |> put_flash(:info, "Feature flag created successfully.") + |> redirect(to: Routes.feature_flag_path(conn, :show, feature_flag)) + + {:error, %Ecto.Changeset{} = changeset} -> + render(conn, "new.html", changeset: changeset) + end + end + + def show(conn, %{"id" => id}) do + feature_flag = FeatureFlags.get_feature_flag!(id) + render(conn, "show.html", feature_flag: feature_flag) + end + + def edit(conn, %{"id" => id}) do + feature_flag = FeatureFlags.get_feature_flag!(id) + changeset = FeatureFlags.change_feature_flag(feature_flag) + render(conn, "edit.html", feature_flag: feature_flag, changeset: changeset) + end + + def update(conn, %{"id" => id, "feature_flag" => feature_flag_params}) do + feature_flag = FeatureFlags.get_feature_flag!(id) + + case FeatureFlags.update_feature_flag(feature_flag, feature_flag_params) do + {:ok, feature_flag} -> + conn + |> put_flash(:info, "Feature flag updated successfully.") + |> redirect(to: Routes.feature_flag_path(conn, :show, feature_flag)) + + {:error, %Ecto.Changeset{} = changeset} -> + render(conn, "edit.html", feature_flag: feature_flag, changeset: changeset) + end + end + + def delete(conn, %{"id" => id}) do + feature_flag = FeatureFlags.get_feature_flag!(id) + {:ok, _feature_flag} = FeatureFlags.delete_feature_flag(feature_flag) + + conn + |> put_flash(:info, "Feature flag deleted successfully.") + |> redirect(to: Routes.feature_flag_path(conn, :index)) + end +end diff --git a/src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex b/src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex new file mode 100644 index 0000000000..fbaf4f4e95 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex @@ -0,0 +1,14 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.PageController do + use FeatureflagserviceWeb, :controller + + alias Featureflagservice.FeatureFlags + + def index(conn, _params) do + featureflags = FeatureFlags.list_feature_flags() + render(conn, "index.html", featureflags: featureflags) + end +end diff --git a/src/featureflagservice/lib/featureflagservice_web/endpoint.ex b/src/featureflagservice/lib/featureflagservice_web/endpoint.ex new file mode 100644 index 0000000000..e42fce4d69 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/endpoint.ex @@ -0,0 +1,50 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.Endpoint do + use Phoenix.Endpoint, otp_app: :featureflagservice + + # The session will be stored in the cookie and signed, + # this means its contents can be read but not tampered with. + # Set :encryption_salt if you would also like to encrypt it. + @session_options [ + store: :cookie, + key: "_featureflagservice_key", + signing_salt: "B7PAq71f" + ] + + socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]] + + # Serve at "/" the static files from "priv/static" directory. + # + # You should set gzip to true if you are running phx.digest + # when deploying your static files in production. + plug Plug.Static, + at: "/", + from: :featureflagservice, + gzip: false, + only: ~w(assets fonts images favicon.ico robots.txt) + + # Code reloading can be explicitly enabled under the + # :code_reloader configuration of your endpoint. + if code_reloading? do + socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket + plug Phoenix.LiveReloader + plug Phoenix.CodeReloader + plug Phoenix.Ecto.CheckRepoStatus, otp_app: :featureflagservice + end + + plug Plug.RequestId + plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint] + + plug Plug.Parsers, + parsers: [:urlencoded, :multipart, :json], + pass: ["*/*"], + json_decoder: Phoenix.json_library() + + plug Plug.MethodOverride + plug Plug.Head + plug Plug.Session, @session_options + plug FeatureflagserviceWeb.Router +end diff --git a/src/featureflagservice/lib/featureflagservice_web/gettext.ex b/src/featureflagservice/lib/featureflagservice_web/gettext.ex new file mode 100644 index 0000000000..a28990a986 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/gettext.ex @@ -0,0 +1,28 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.Gettext do + @moduledoc """ + A module providing Internationalization with a gettext-based API. + + By using [Gettext](https://hexdocs.pm/gettext), + your module gains a set of macros for translations, for example: + + import FeatureflagserviceWeb.Gettext + + # Simple translation + gettext("Here is the string to translate") + + # Plural translation + ngettext("Here is the string to translate", + "Here are the strings to translate", + 3) + + # Domain-based translation + dgettext("errors", "Here is the error message to translate") + + See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. + """ + use Gettext, otp_app: :featureflagservice +end diff --git a/src/featureflagservice/lib/featureflagservice_web/router.ex b/src/featureflagservice/lib/featureflagservice_web/router.ex new file mode 100644 index 0000000000..0dd814fe4e --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/router.ex @@ -0,0 +1,27 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.Router do + use FeatureflagserviceWeb, :router + + pipeline :browser do + plug :accepts, ["html"] + plug :fetch_session + plug :fetch_live_flash + plug :put_root_layout, {FeatureflagserviceWeb.LayoutView, :root} + plug :protect_from_forgery + plug :put_secure_browser_headers + end + + pipeline :api do + plug :accepts, ["json"] + end + + scope "/", FeatureflagserviceWeb do + pipe_through :browser + + get "/", PageController, :index + resources "/featureflags", FeatureFlagController + end +end diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex new file mode 100644 index 0000000000..c66d59cb2d --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex @@ -0,0 +1,21 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +

Edit feature flag

+ +<%= render "form.html", Map.put(assigns, :action, Routes.feature_flag_path(@conn, :update, @feature_flag)) %> + +<%= link "Back", class: "button button-outline", to: Routes.feature_flag_path(@conn, :index) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex new file mode 100644 index 0000000000..442fa4942b --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex @@ -0,0 +1,44 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<.form :let={f} for={@changeset} action={@action}> + <%= if @changeset.action do %> +
+

Oops, something went wrong! Please check the errors below.

+
+ <% end %> + + <%= label f, :name %> + <%= text_input f, :name %> + <%= error_tag f, :name %> + + <%= label f, :description %> + <%= text_input f, :description %> + <%= error_tag f, :description %> + + <%= label f, :enabled %> + <%= number_input f, :enabled, min: 0, max: 1, step: 0.01, "aria-describedby": "enabled_help_text" %> +

+ A decimal value between 0 and 1 (inclusive)
+ 0.0 is always disabled
+ 1.0 is always enabled
+ All values between set a percentage chance on each request
+ example: 0.55 is enabled 55% of the time
+

+ <%= error_tag f, :enabled %> + + <%= submit "Save" %> + diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex new file mode 100644 index 0000000000..26fa34f5e4 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex @@ -0,0 +1,46 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +

Listing feature flags

+ + + + + + + + + + + + +<%= for feature_flag <- @featureflags do %> + + + + + + + +<% end %> + +
NameDescriptionEnabled
<%= feature_flag.name %><%= feature_flag.description %><%= feature_flag.enabled %> + <%= link "Show", to: Routes.feature_flag_path(@conn, :show, feature_flag) %> + <%= link "Edit", to: Routes.feature_flag_path(@conn, :edit, feature_flag) %> + <%= link "Delete", to: Routes.feature_flag_path(@conn, :delete, feature_flag), method: :delete, data: [confirm: "Are you sure?"] %> +
+ +<%= link "New Feature flag", to: Routes.feature_flag_path(@conn, :new) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex new file mode 100644 index 0000000000..df15a10836 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex @@ -0,0 +1,21 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +

New Feature flag

+ +<%= render "form.html", Map.put(assigns, :action, Routes.feature_flag_path(@conn, :create)) %> + +<%= link "Back", class: "button button-outline", to: Routes.feature_flag_path(@conn, :index) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex new file mode 100644 index 0000000000..994436b0ae --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex @@ -0,0 +1,39 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +

Show feature flag

+ + + +<%= link "Edit", to: Routes.feature_flag_path(@conn, :edit, @feature_flag) %> | +<%= link "Back", to: Routes.feature_flag_path(@conn, :index) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex new file mode 100644 index 0000000000..8dbaf9bfed --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex @@ -0,0 +1,21 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +
+ + + <%= @inner_content %> +
diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex new file mode 100644 index 0000000000..54e49194d8 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex @@ -0,0 +1,27 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +
+ + + + + <%= @inner_content %> +
diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex new file mode 100644 index 0000000000..abbbc741ce --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex @@ -0,0 +1,46 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + + + + + + + + + <.live_title> + <%= assigns[:page_title] || "Feature flag service" %> + + + + + +
+
+ + + Feature Flags + +
+
+ <%= @inner_content %> + + diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex new file mode 100644 index 0000000000..6900a26c3a --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex @@ -0,0 +1,46 @@ +<%!-- + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +

Listing Feature flags

+ + + + + + + + + + + + +<%= for feature_flag <- @featureflags do %> + + + + + + + +<% end %> + +
NameDescriptionEnabled
<%= feature_flag.name %><%= feature_flag.description %><%= feature_flag.enabled %> + <%= link "Show", to: Routes.feature_flag_path(@conn, :show, feature_flag) %> + <%= link "Edit", to: Routes.feature_flag_path(@conn, :edit, feature_flag) %> + <%= link "Delete", to: Routes.feature_flag_path(@conn, :delete, feature_flag), method: :delete, data: [confirm: "Are you sure?"] %> +
+ +<%= link "New Feature flag", to: Routes.feature_flag_path(@conn, :new) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex b/src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex new file mode 100644 index 0000000000..98aa8f3736 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex @@ -0,0 +1,51 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.ErrorHelpers do + @moduledoc """ + Conveniences for translating and building error messages. + """ + + use Phoenix.HTML + + @doc """ + Generates tag for inlined form input errors. + """ + def error_tag(form, field) do + Enum.map(Keyword.get_values(form.errors, field), fn error -> + content_tag(:span, translate_error(error), + class: "invalid-feedback", + phx_feedback_for: input_name(form, field) + ) + end) + end + + @doc """ + Translates an error message using gettext. + """ + def translate_error({msg, opts}) do + # When using gettext, we typically pass the strings we want + # to translate as a static argument: + # + # # Translate "is invalid" in the "errors" domain + # dgettext("errors", "is invalid") + # + # # Translate the number of files with plural rules + # dngettext("errors", "1 file", "%{count} files", count) + # + # Because the error messages we show in our forms and APIs + # are defined inside Ecto, we need to translate them dynamically. + # This requires us to call the Gettext module passing our gettext + # backend as first argument. + # + # Note we use the "errors" domain, which means translations + # should be written to the errors.po file. The :count option is + # set by Ecto and indicates we should also apply plural rules. + if count = opts[:count] do + Gettext.dngettext(FeatureflagserviceWeb.Gettext, "errors", msg, msg, count, opts) + else + Gettext.dgettext(FeatureflagserviceWeb.Gettext, "errors", msg, opts) + end + end +end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/error_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/error_view.ex new file mode 100644 index 0000000000..e49031556f --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/views/error_view.ex @@ -0,0 +1,20 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.ErrorView do + use FeatureflagserviceWeb, :view + + # If you want to customize a particular status code + # for a certain format, you may uncomment below. + # def render("500.html", _assigns) do + # "Internal Server Error" + # end + + # By default, Phoenix returns the status message from + # the template name. For example, "404.html" becomes + # "Not Found". + def template_not_found(template, _assigns) do + Phoenix.Controller.status_message_from_template(template) + end +end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex new file mode 100644 index 0000000000..ad4bb48e7e --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex @@ -0,0 +1,7 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.FeatureFlagView do + use FeatureflagserviceWeb, :view +end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex new file mode 100644 index 0000000000..1a8a694372 --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex @@ -0,0 +1,7 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.LayoutView do + use FeatureflagserviceWeb, :view +end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/page_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/page_view.ex new file mode 100644 index 0000000000..d76f8c036d --- /dev/null +++ b/src/featureflagservice/lib/featureflagservice_web/views/page_view.ex @@ -0,0 +1,7 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.PageView do + use FeatureflagserviceWeb, :view +end diff --git a/src/featureflagservice/mix.exs b/src/featureflagservice/mix.exs new file mode 100644 index 0000000000..83f35e6fff --- /dev/null +++ b/src/featureflagservice/mix.exs @@ -0,0 +1,86 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.MixProject do + use Mix.Project + + def project do + [ + app: :featureflagservice, + version: "1.4.0", + elixir: "~> 1.14", + elixirc_paths: elixirc_paths(Mix.env()), + compilers: [] ++ Mix.compilers(), + start_permanent: Mix.env() == :prod, + aliases: aliases(), + deps: deps(), + releases: [ + featureflagservice: [ + applications: [opentelemetry_exporter: :permanent, opentelemetry: :temporary] + ] + ] + ] + end + + # Configuration for the OTP application. + # + # Type `mix help compile.app` for more information. + def application do + [ + mod: {Featureflagservice.Application, []}, + extra_applications: [:logger, :runtime_tools] + ] + end + + # Specifies which paths to compile per environment. + defp elixirc_paths(:test), do: ["lib", "test/support"] + defp elixirc_paths(_), do: ["lib"] + + # Specifies your project dependencies. + # + # Type `mix help deps` for examples and options. + defp deps do + [ + {:phoenix, "~> 1.7.0"}, + {:phoenix_ecto, "~> 4.4"}, + {:ecto_sql, "~> 3.10"}, + {:postgrex, "~> 0.17.2"}, + {:phoenix_html, "~> 3.0"}, + {:phoenix_live_reload, "~> 1.2", only: :dev}, + {:phoenix_live_view, "~> 0.20.0"}, + {:phoenix_view, "~> 2.0"}, + {:floki, "~> 0.35.0", only: :test}, + {:esbuild, "~> 0.8", runtime: Mix.env() == :dev}, + {:telemetry_metrics, "~> 0.6"}, + {:telemetry_poller, "~> 1.0"}, + {:gettext, "~> 0.23"}, + {:jason, "~> 1.4"}, + {:plug_cowboy, "~> 2.6"}, + + {:grpcbox, "~> 0.16.0", override: true}, + {:opentelemetry_exporter, "~> 1.6.0"}, + {:opentelemetry_grpcbox, "~> 0.2"}, + {:opentelemetry_api, "~> 1.2.1"}, + {:opentelemetry, "~> 1.3.0"}, + {:opentelemetry_phoenix, "~> 1.1.1"}, + {:opentelemetry_ecto, "~> 1.1.1"} + ] + end + + # Aliases are shortcuts or tasks specific to the current project. + # For example, to install project dependencies and perform other setup tasks, run: + # + # $ mix setup + # + # See the documentation for `Mix` for more info on aliases. + defp aliases do + [ + setup: ["deps.get", "ecto.setup"], + "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], + "ecto.reset": ["ecto.drop", "ecto.setup"], + test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], + "assets.deploy": ["esbuild default --minify", "phx.digest"] + ] + end +end diff --git a/src/featureflagservice/mix.lock b/src/featureflagservice/mix.lock new file mode 100644 index 0000000000..4b50f90d81 --- /dev/null +++ b/src/featureflagservice/mix.lock @@ -0,0 +1,56 @@ +%{ + "acceptor_pool": {:hex, :acceptor_pool, "1.0.0", "43c20d2acae35f0c2bcd64f9d2bde267e459f0f3fd23dab26485bf518c281b21", [:rebar3], [], "hexpm", "0cbcd83fdc8b9ad2eee2067ef8b91a14858a5883cb7cd800e6fcd5803e158788"}, + "castore": {:hex, :castore, "1.0.4", "ff4d0fb2e6411c0479b1d965a814ea6d00e51eb2f58697446e9c41a97d940b28", [:mix], [], "hexpm", "9418c1b8144e11656f0be99943db4caf04612e3eaecefb5dae9a2a87565584f8"}, + "chatterbox": {:hex, :ts_chatterbox, "0.13.0", "6f059d97bcaa758b8ea6fffe2b3b81362bd06b639d3ea2bb088335511d691ebf", [:rebar3], [{:hpack, "~> 0.2.3", [hex: :hpack_erl, repo: "hexpm", optional: false]}], "hexpm", "b93d19104d86af0b3f2566c4cba2a57d2e06d103728246ba1ac6c3c0ff010aa7"}, + "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, + "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, + "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, + "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, + "ctx": {:hex, :ctx, "0.6.0", "8ff88b70e6400c4df90142e7f130625b82086077a45364a78d208ed3ed53c7fe", [:rebar3], [], "hexpm", "a14ed2d1b67723dbebbe423b28d7615eb0bdcba6ff28f2d1f1b0a7e1d4aa5fc2"}, + "db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"}, + "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, + "ecto": {:hex, :ecto, "3.10.1", "c6757101880e90acc6125b095853176a02da8f1afe056f91f1f90b80c9389822", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2ac4255f1601bdf7ac74c0ed971102c6829dc158719b94bd30041bbad77f87a"}, + "ecto_sql": {:hex, :ecto_sql, "3.10.1", "6ea6b3036a0b0ca94c2a02613fd9f742614b5cfe494c41af2e6571bb034dd94c", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f6a25bdbbd695f12c8171eaff0851fa4c8e72eec1e98c7364402dda9ce11c56b"}, + "esbuild": {:hex, :esbuild, "0.8.1", "0cbf919f0eccb136d2eeef0df49c4acf55336de864e63594adcea3814f3edf41", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "25fc876a67c13cb0a776e7b5d7974851556baeda2085296c14ab48555ea7560f"}, + "expo": {:hex, :expo, "0.4.1", "1c61d18a5df197dfda38861673d392e642649a9cef7694d2f97a587b2cfb319b", [:mix], [], "hexpm", "2ff7ba7a798c8c543c12550fa0e2cbc81b95d4974c65855d8d15ba7b37a1ce47"}, + "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, + "floki": {:hex, :floki, "0.35.2", "87f8c75ed8654b9635b311774308b2760b47e9a579dabf2e4d5f1e1d42c39e0b", [:mix], [], "hexpm", "6b05289a8e9eac475f644f09c2e4ba7e19201fd002b89c28c1293e7bd16773d9"}, + "gettext": {:hex, :gettext, "0.23.1", "821e619a240e6000db2fc16a574ef68b3bd7fe0167ccc264a81563cc93e67a31", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "19d744a36b809d810d610b57c27b934425859d158ebd56561bc41f7eeb8795db"}, + "gproc": {:hex, :gproc, "0.8.0", "cea02c578589c61e5341fce149ea36ccef236cc2ecac8691fba408e7ea77ec2f", [:rebar3], [], "hexpm", "580adafa56463b75263ef5a5df4c86af321f68694e7786cb057fd805d1e2a7de"}, + "grpcbox": {:hex, :grpcbox, "0.16.0", "b83f37c62d6eeca347b77f9b1ec7e9f62231690cdfeb3a31be07cd4002ba9c82", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.13.0", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.8.0", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "294df743ae20a7e030889f00644001370a4f7ce0121f3bbdaf13cf3169c62913"}, + "hpack": {:hex, :hpack_erl, "0.2.3", "17670f83ff984ae6cd74b1c456edde906d27ff013740ee4d9efaa4f1bf999633", [:rebar3], [], "hexpm", "06f580167c4b8b8a6429040df36cc93bba6d571faeaec1b28816523379cbb23a"}, + "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, + "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, + "nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"}, + "opentelemetry": {:hex, :opentelemetry, "1.3.0", "988ac3c26acac9720a1d4fb8d9dc52e95b45ecfec2d5b5583276a09e8936bc5e", [:rebar3], [{:opentelemetry_api, "~> 1.2.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "8e09edc26aad11161509d7ecad854a3285d88580f93b63b0b1cf0bac332bfcc0"}, + "opentelemetry_api": {:hex, :opentelemetry_api, "1.2.1", "7b69ed4f40025c005de0b74fce8c0549625d59cb4df12d15c32fe6dc5076ff42", [:mix, :rebar3], [{:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "6d7a27b7cad2ad69a09cabf6670514cafcec717c8441beb5c96322bac3d05350"}, + "opentelemetry_ecto": {:hex, :opentelemetry_ecto, "1.1.1", "218b791d2883becaf28d3fe25627b48f862ad63d4982dd0d10d307861eafa847", [:mix], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_process_propagator, "~> 0.2", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e5f4c76aa9385cefa099a88e19eba90a7a19ef82deec43e0c03c987528bdd826"}, + "opentelemetry_exporter": {:hex, :opentelemetry_exporter, "1.6.0", "f4fbf69aa9f1541b253813221b82b48a9863bc1570d8ecc517bc510c0d1d3d8c", [:rebar3], [{:grpcbox, ">= 0.0.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry, "~> 1.3", [hex: :opentelemetry, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.2", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:tls_certificate_check, "~> 1.18", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "1802d1dca297e46f21e5832ecf843c451121e875f73f04db87355a6cb2ba1710"}, + "opentelemetry_grpcbox": {:hex, :opentelemetry_grpcbox, "0.2.0", "85e546dd632274ce8552a05f433d07fecde67aada7a83f1a1e1a78a62c744608", [:rebar3], [{:grpcbox, "~> 0.14.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2.0", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "7fa6fd5fa65eed3aa88c3799aaec257c0a7754774dcf67c31dea4e20ffc5723d"}, + "opentelemetry_phoenix": {:hex, :opentelemetry_phoenix, "1.1.1", "b6ab632d39138c2cc9b6e52b65d560545904f659c42647856d669e593110521f", [:mix], [{:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_process_propagator, "~> 0.2", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}, {:opentelemetry_telemetry, "~> 1.0", [hex: :opentelemetry_telemetry, repo: "hexpm", optional: false]}, {:plug, ">= 1.11.0", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "942850ce28fe21f98d98a743b94163820ce5ba6488333a806dbd1e8161a653d8"}, + "opentelemetry_process_propagator": {:hex, :opentelemetry_process_propagator, "0.2.2", "85244a49f0c32ae1e2f3d58c477c265bd6125ee3480ade82b0fa9324b85ed3f0", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}], "hexpm", "04db13302a34bea8350a13ed9d49c22dfd32c4bc590d8aa88b6b4b7e4f346c61"}, + "opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "0.2.0", "b67fe459c2938fcab341cb0951c44860c62347c005ace1b50f8402576f241435", [:mix, :rebar3], [], "hexpm", "d61fa1f5639ee8668d74b527e6806e0503efc55a42db7b5f39939d84c07d6895"}, + "opentelemetry_telemetry": {:hex, :opentelemetry_telemetry, "1.0.0", "d5982a319e725fcd2305b306b65c18a86afdcf7d96821473cf0649ff88877615", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_registry, "~> 0.3.0", [hex: :telemetry_registry, repo: "hexpm", optional: false]}], "hexpm", "3401d13a1d4b7aa941a77e6b3ec074f0ae77f83b5b2206766ce630123a9291a9"}, + "phoenix": {:hex, :phoenix, "1.7.10", "02189140a61b2ce85bb633a9b6fd02dff705a5f1596869547aeb2b2b95edd729", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "cf784932e010fd736d656d7fead6a584a4498efefe5b8227e9f383bf15bb79d0"}, + "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"}, + "phoenix_html": {:hex, :phoenix_html, "3.3.3", "380b8fb45912b5638d2f1d925a3771b4516b9a78587249cabe394e0a5d579dc9", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "923ebe6fec6e2e3b3e569dfbdc6560de932cd54b000ada0208b5f45024bdd76c"}, + "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"}, + "phoenix_live_view": {:hex, :phoenix_live_view, "0.20.1", "92a37acf07afca67ac98bd326532ba8f44ad7d4bdf3e4361b03f7f02594e5ae9", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "be494fd1215052729298b0e97d5c2ce8e719c00854b82cd8cf15c1cd7fcf6294"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, + "phoenix_template": {:hex, :phoenix_template, "1.0.3", "32de561eefcefa951aead30a1f94f1b5f0379bc9e340bb5c667f65f1edfa4326", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "16f4b6588a4152f3cc057b9d0c0ba7e82ee23afa65543da535313ad8d25d8e2c"}, + "phoenix_view": {:hex, :phoenix_view, "2.0.2", "6bd4d2fd595ef80d33b439ede6a19326b78f0f1d8d62b9a318e3d9c1af351098", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "a929e7230ea5c7ee0e149ffcf44ce7cf7f4b6d2bfe1752dd7c084cdff152d36f"}, + "plug": {:hex, :plug, "1.15.1", "b7efd81c1a1286f13efb3f769de343236bd8b7d23b4a9f40d3002fc39ad8f74c", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "459497bd94d041d98d948054ec6c0b76feacd28eec38b219ca04c0de13c79d30"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"}, + "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, + "postgrex": {:hex, :postgrex, "0.17.2", "a3ec9e3239d9b33f1e5841565c4eb200055c52cc0757a22b63ca2d529bbe764c", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "80a918a9e9531d39f7bd70621422f3ebc93c01618c645f2d91306f50041ed90c"}, + "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, + "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, + "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, + "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, + "telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"}, + "telemetry_registry": {:hex, :telemetry_registry, "0.3.1", "14a3319a7d9027bdbff7ebcacf1a438f5f5c903057b93aee484cca26f05bdcba", [:mix, :rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6d0ca77b691cf854ed074b459a93b87f4c7f5512f8f7743c635ca83da81f939e"}, + "tls_certificate_check": {:hex, :tls_certificate_check, "1.19.0", "c76c4c5d79ee79a2b11c84f910c825d6f024a78427c854f515748e9bd025e987", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "4083b4a298add534c96125337cb01161c358bb32dd870d5a893aae685fd91d70"}, + "websock": {:hex, :websock, "0.5.2", "b3c08511d8d79ed2c2f589ff430bd1fe799bb389686dafce86d28801783d8351", [:mix], [], "hexpm", "925f5de22fca6813dfa980fb62fd542ec43a2d1a1f83d2caec907483fe66ff05"}, + "websock_adapter": {:hex, :websock_adapter, "0.5.3", "4908718e42e4a548fc20e00e70848620a92f11f7a6add8cf0886c4232267498d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "cbe5b814c1f86b6ea002b52dd99f345aeecf1a1a6964e209d208fb404d930d3d"}, +} diff --git a/src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po b/src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po new file mode 100644 index 0000000000..844c4f5cea --- /dev/null +++ b/src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po @@ -0,0 +1,112 @@ +## `msgid`s in this file come from POT (.pot) files. +## +## Do not add, change, or remove `msgid`s manually here as +## they're tied to the ones in the corresponding POT file +## (with the same domain). +## +## Use `mix gettext.extract --merge` or `mix gettext.merge` +## to merge POT files into PO files. +msgid "" +msgstr "" +"Language: en\n" + +## From Ecto.Changeset.cast/4 +msgid "can't be blank" +msgstr "" + +## From Ecto.Changeset.unique_constraint/3 +msgid "has already been taken" +msgstr "" + +## From Ecto.Changeset.put_change/3 +msgid "is invalid" +msgstr "" + +## From Ecto.Changeset.validate_acceptance/3 +msgid "must be accepted" +msgstr "" + +## From Ecto.Changeset.validate_format/3 +msgid "has invalid format" +msgstr "" + +## From Ecto.Changeset.validate_subset/3 +msgid "has an invalid entry" +msgstr "" + +## From Ecto.Changeset.validate_exclusion/3 +msgid "is reserved" +msgstr "" + +## From Ecto.Changeset.validate_confirmation/3 +msgid "does not match confirmation" +msgstr "" + +## From Ecto.Changeset.no_assoc_constraint/3 +msgid "is still associated with this entry" +msgstr "" + +msgid "are still associated with this entry" +msgstr "" + +## From Ecto.Changeset.validate_length/3 +msgid "should have %{count} item(s)" +msgid_plural "should have %{count} item(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be %{count} character(s)" +msgid_plural "should be %{count} character(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be %{count} byte(s)" +msgid_plural "should be %{count} byte(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should have at least %{count} item(s)" +msgid_plural "should have at least %{count} item(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be at least %{count} character(s)" +msgid_plural "should be at least %{count} character(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be at least %{count} byte(s)" +msgid_plural "should be at least %{count} byte(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should have at most %{count} item(s)" +msgid_plural "should have at most %{count} item(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be at most %{count} character(s)" +msgid_plural "should be at most %{count} character(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be at most %{count} byte(s)" +msgid_plural "should be at most %{count} byte(s)" +msgstr[0] "" +msgstr[1] "" + +## From Ecto.Changeset.validate_number/3 +msgid "must be less than %{number}" +msgstr "" + +msgid "must be greater than %{number}" +msgstr "" + +msgid "must be less than or equal to %{number}" +msgstr "" + +msgid "must be greater than or equal to %{number}" +msgstr "" + +msgid "must be equal to %{number}" +msgstr "" diff --git a/src/featureflagservice/priv/gettext/errors.pot b/src/featureflagservice/priv/gettext/errors.pot new file mode 100644 index 0000000000..39a220be35 --- /dev/null +++ b/src/featureflagservice/priv/gettext/errors.pot @@ -0,0 +1,95 @@ +## This is a PO Template file. +## +## `msgid`s here are often extracted from source code. +## Add new translations manually only if they're dynamic +## translations that can't be statically extracted. +## +## Run `mix gettext.extract` to bring this file up to +## date. Leave `msgstr`s empty as changing them here has no +## effect: edit them in PO (`.po`) files instead. + +## From Ecto.Changeset.cast/4 +msgid "can't be blank" +msgstr "" + +## From Ecto.Changeset.unique_constraint/3 +msgid "has already been taken" +msgstr "" + +## From Ecto.Changeset.put_change/3 +msgid "is invalid" +msgstr "" + +## From Ecto.Changeset.validate_acceptance/3 +msgid "must be accepted" +msgstr "" + +## From Ecto.Changeset.validate_format/3 +msgid "has invalid format" +msgstr "" + +## From Ecto.Changeset.validate_subset/3 +msgid "has an invalid entry" +msgstr "" + +## From Ecto.Changeset.validate_exclusion/3 +msgid "is reserved" +msgstr "" + +## From Ecto.Changeset.validate_confirmation/3 +msgid "does not match confirmation" +msgstr "" + +## From Ecto.Changeset.no_assoc_constraint/3 +msgid "is still associated with this entry" +msgstr "" + +msgid "are still associated with this entry" +msgstr "" + +## From Ecto.Changeset.validate_length/3 +msgid "should be %{count} character(s)" +msgid_plural "should be %{count} character(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should have %{count} item(s)" +msgid_plural "should have %{count} item(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be at least %{count} character(s)" +msgid_plural "should be at least %{count} character(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should have at least %{count} item(s)" +msgid_plural "should have at least %{count} item(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should be at most %{count} character(s)" +msgid_plural "should be at most %{count} character(s)" +msgstr[0] "" +msgstr[1] "" + +msgid "should have at most %{count} item(s)" +msgid_plural "should have at most %{count} item(s)" +msgstr[0] "" +msgstr[1] "" + +## From Ecto.Changeset.validate_number/3 +msgid "must be less than %{number}" +msgstr "" + +msgid "must be greater than %{number}" +msgstr "" + +msgid "must be less than or equal to %{number}" +msgstr "" + +msgid "must be greater than or equal to %{number}" +msgstr "" + +msgid "must be equal to %{number}" +msgstr "" diff --git a/src/featureflagservice/priv/repo/migrations/.formatter.exs b/src/featureflagservice/priv/repo/migrations/.formatter.exs new file mode 100644 index 0000000000..49f9151ed2 --- /dev/null +++ b/src/featureflagservice/priv/repo/migrations/.formatter.exs @@ -0,0 +1,4 @@ +[ + import_deps: [:ecto_sql], + inputs: ["*.exs"] +] diff --git a/src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs b/src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs new file mode 100644 index 0000000000..1fd816fbfe --- /dev/null +++ b/src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs @@ -0,0 +1,50 @@ +defmodule Featureflagservice.Repo.Migrations.CreateFeatureflags do + use Ecto.Migration + + def change do + create table(:featureflags) do + add :name, :string + add :description, :string + add :enabled, :float, default: 0.0, null: false + + timestamps() + end + + create unique_index(:featureflags, [:name]) + + execute(&execute_up/0, &execute_down/0) + end + + defp execute_up do + repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ + name: "productCatalogFailure", + description: "Fail product catalog service on a specific product", + enabled: 0.0 + }) + + repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ + name: "recommendationCache", + description: "Cache recommendations", + enabled: 0.0 + }) + + repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ + name: "adServiceFailure", + description: "Fail ad service requests sporadically", + enabled: 0.0 + }) + + repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ + name: "cartServiceFailure", + description: "Fail cart service requests sporadically", + enabled: 0.0 + }) + end + + defp execute_down do + repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "productCatalogFailure"}) + repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "recommendationCache"}) + repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "adServiceFailure"}) + repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "cartServiceFailure"}) + end +end diff --git a/src/featureflagservice/priv/repo/seeds.exs b/src/featureflagservice/priv/repo/seeds.exs new file mode 100644 index 0000000000..b3d1b65287 --- /dev/null +++ b/src/featureflagservice/priv/repo/seeds.exs @@ -0,0 +1,13 @@ + + +# Script for populating the database. You can run it as: +# +# mix run priv/repo/seeds.exs +# +# Inside the script, you can read and write to any of your +# repositories directly: +# +# Featureflagservice.Repo.insert!(%Featureflagservice.SomeSchema{}) +# +# We recommend using the bang functions (`insert!`, `update!` +# and so on) as they will fail if something goes wrong. diff --git a/src/featureflagservice/priv/static/favicon.ico b/src/featureflagservice/priv/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..73de524aaadcf60fbe9d32881db0aa86b58b5cb9 GIT binary patch literal 1258 zcmbtUO>fgM7{=qN=;Mz_82;lvPEdVaxv-<-&=sZLwab?3I zBP>U*&(Hv<5n@9ZQ$vhg#|u$Zmtq8BV;+W*7(?jOx-{r?#TE&$Sdq77MbdJjD5`-q zMm_z(jLv3t>5NhzK{%aG(Yudfpjd3AFdKe2U7&zdepTe>^s(@!&0X8TJ`h+-I?84Ml# literal 0 HcmV?d00001 diff --git a/src/featureflagservice/priv/static/images/phoenix.png b/src/featureflagservice/priv/static/images/phoenix.png new file mode 100644 index 0000000000000000000000000000000000000000..9c81075f63d2151e6f40e9aa66f665749a87cc6a GIT binary patch literal 13900 zcmaL8WmsF?7A@RTTCBLc6?b=ccXxso4H~R1?gT4RtT+@6?yiLril%4@T7niU{_*z6 z{eIkY^CMY%XUs9jnrrU0pClu(+L}t3=w#^6o;|}(O%cy#x4LjZZH1q*$X;nePbVE4Ruj~ha0EO zKNwDso99#XvuEN`AWs{Bi@gtxt-YhOy9C{FXD=O%vz-K;k$?ubhNqmple2Q5m%Uz~ zramCh1t4NaCnZTE4ibGLaI^QZp#izMx_gU)Bn$}9dm*VB;%os*A`rzjVfzrR1HKOd)umm?RCh=|BP9K5_7PY4e00Cyi75Qn=r z{eKwb?Y#kB&YnKb9_}>%FxuF9`1(lDJt_Uy6x=-jOY83a?=n3Vj0LBly^W8Dm%fLG z>wl`K?d0L(;qBz%Nh7BxK%-#;aCZOa_%B{VLsZ4x+s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ht>Ri`CHLtL;2>NxDqFb41bk*1z+J zhV>B-vfA2MMCt)_#) z3G~quaUUm>*(ov1gX?+|@8-u$!zgCPz9kxLJH$2OO{(l${;)=ie$@*MH+Dtp83U5!%o~k zPQ8KRJ141&WM*HM=`hd+PDS93YX&}Sllg@j-BHpM?!v8!WeV^^4DX@GQ`sea*>H?=b|NHgB}D2V9jt) zJ=prm-}$6M+ZsPel4vwOBmuhqij3Ujz<~(=Z+%`0#*Vm+M8&7Up%ajiBU{{m!_%D9 z1zJjlE#0`HNju{ds8|+m7h{Hj5#iNXfrHNd}8lmEE zQSW{7z*8sq+W$*S6LniEU?Z!#B?GdWkjUeg4$&N$;$N7gqx*-E<^6-zhv(0nSsJz2 UWxWXg`G1#+f~I_}taaG`2PLnS&Hw-a literal 0 HcmV?d00001 diff --git a/src/featureflagservice/priv/static/robots.txt b/src/featureflagservice/priv/static/robots.txt new file mode 100644 index 0000000000..26e06b5f19 --- /dev/null +++ b/src/featureflagservice/priv/static/robots.txt @@ -0,0 +1,5 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/src/featureflagservice/rebar.config b/src/featureflagservice/rebar.config new file mode 100644 index 0000000000..46ea726a93 --- /dev/null +++ b/src/featureflagservice/rebar.config @@ -0,0 +1,30 @@ +% Copyright The OpenTelemetry Authors +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. + +{alias, [ + {grpc_regen, [compile, {grpc, gen}, compile]} +]}. + +{erl_opts, [debug_info]}. +{deps, []}. + +{grpc, [{protos, ["proto"]}, + {service_modules, [{'oteldemo.FeatureFlagService', "ffs_service"}, + {'grpc.health.v1.Health', "grpcbox_health"}, + {'grpc.reflection.v1alpha.ServerReflection', "grpcbox_reflection"}]}, + {gpb_opts, [{descriptor, true}, + {module_name_prefix, "ffs_"}, + {module_name_suffix, "_pb"}]}]}. + +{project_plugins, [grpcbox_plugin]}. diff --git a/src/featureflagservice/rebar.lock b/src/featureflagservice/rebar.lock new file mode 100644 index 0000000000..da04d5ee31 --- /dev/null +++ b/src/featureflagservice/rebar.lock @@ -0,0 +1,31 @@ +{"1.2.0", +[{<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0">>},1}, + {<<"chatterbox">>,{pkg,<<"ts_chatterbox">>,<<"0.12.0">>},1}, + {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},1}, + {<<"gproc">>,{pkg,<<"gproc">>,<<"0.8.0">>},1}, + {<<"grpcbox">>,{pkg,<<"grpcbox">>,<<"0.15.0">>},0}, + {<<"hpack">>,{pkg,<<"hpack_erl">>,<<"0.2.3">>},2}, + {<<"opentelemetry_api">>,{pkg,<<"opentelemetry_api">>,<<"1.0.3">>},0}, + {<<"opentelemetry_grpcbox">>, + {pkg,<<"opentelemetry_grpcbox">>,<<"0.1.0">>}, + 0}]}. +[ +{pkg_hash,[ + {<<"acceptor_pool">>, <<"43C20D2ACAE35F0C2BCD64F9D2BDE267E459F0F3FD23DAB26485BF518C281B21">>}, + {<<"chatterbox">>, <<"4E54F199E15C0320B85372A24E35554A2CCFC4342E0B7CD8DAED9A04F9B8EF4A">>}, + {<<"ctx">>, <<"8FF88B70E6400C4DF90142E7F130625B82086077A45364A78D208ED3ED53C7FE">>}, + {<<"gproc">>, <<"CEA02C578589C61E5341FCE149EA36CCEF236CC2ECAC8691FBA408E7EA77EC2F">>}, + {<<"grpcbox">>, <<"97C7126296A091602D372EBF5860A04F7BC795B45B33A984CAD2B8E362774FD8">>}, + {<<"hpack">>, <<"17670F83FF984AE6CD74B1C456EDDE906D27FF013740EE4D9EFAA4F1BF999633">>}, + {<<"opentelemetry_api">>, <<"77F9644C42340CD8B18C728CDE4822ED55AE136F0D07761B78E8C54DA46AF93A">>}, + {<<"opentelemetry_grpcbox">>, <<"2106E5C1DBCE433537529DF809D773BB6CC243E55ADD8BF6F596F218A63E26DB">>}]}, +{pkg_hash_ext,[ + {<<"acceptor_pool">>, <<"0CBCD83FDC8B9AD2EEE2067EF8B91A14858A5883CB7CD800E6FCD5803E158788">>}, + {<<"chatterbox">>, <<"6478C161BC60244F41CD5847CC3ACCD26D997883E9F7FACD36FF24533B2FA579">>}, + {<<"ctx">>, <<"A14ED2D1B67723DBEBBE423B28D7615EB0BDCBA6FF28F2D1F1B0A7E1D4AA5FC2">>}, + {<<"gproc">>, <<"580ADAFA56463B75263EF5A5DF4C86AF321F68694E7786CB057FD805D1E2A7DE">>}, + {<<"grpcbox">>, <<"161ABE9E17E7D1982EFA6488ADEAA13C3E847A07984A6E6B224E553368918647">>}, + {<<"hpack">>, <<"06F580167C4B8B8A6429040DF36CC93BBA6D571FAEAEC1B28816523379CBB23A">>}, + {<<"opentelemetry_api">>, <<"4293E06BD369BC004E6FAD5EDBB56456D891F14BD3F9F1772B18F1923E0678EA">>}, + {<<"opentelemetry_grpcbox">>, <<"4D54C9376A8EC79ED71A654633E25470C545A1789AB46A589B6562699C677B54">>}]} +]. diff --git a/src/featureflagservice/src/featureflagservice.app.src b/src/featureflagservice/src/featureflagservice.app.src new file mode 100644 index 0000000000..4cda7ee446 --- /dev/null +++ b/src/featureflagservice/src/featureflagservice.app.src @@ -0,0 +1,28 @@ +% Copyright The OpenTelemetry Authors +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. + +{application, featureflagservice, + [{description, "this is here just so rebar3 will build the necessary grpc code"}, + {vsn, "notused"}, + {registered, []}, + {applications, + [kernel, + stdlib + ]}, + {env,[]}, + {modules, []}, + + {licenses, ["Apache 2.0"]}, + {links, []} + ]}. diff --git a/src/featureflagservice/src/ffs_service.erl b/src/featureflagservice/src/ffs_service.erl new file mode 100644 index 0000000000..bab2e38d2b --- /dev/null +++ b/src/featureflagservice/src/ffs_service.erl @@ -0,0 +1,80 @@ +% Copyright The OpenTelemetry Authors +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. + +-module(ffs_service). + +-behaviour(ffs_service_bhvr). + +-export([get_flag/2, + create_flag/2, + update_flag/2, + list_flags/2, + delete_flag/2]). + +-include_lib("grpcbox/include/grpcbox.hrl"). + +-include_lib("opentelemetry_api/include/otel_tracer.hrl"). + +-spec get_flag(ctx:t(), ffs_demo_pb:get_flag_request()) -> + {ok, ffs_demo_pb:get_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). +get_flag(Ctx, #{name := Name}) -> + case 'Elixir.Featureflagservice.FeatureFlags':get_feature_flag_by_name(Name) of + nil -> + {grpc_error, {?GRPC_STATUS_NOT_FOUND, <<"the requested feature flag does not exist">>}}; + #{'__struct__' := 'Elixir.Featureflagservice.FeatureFlags.FeatureFlag', + description := Description, + enabled := Enabled, + inserted_at := CreatedAt, + updated_at := UpdatedAt + } -> + RandomNumber = rand:uniform(100), % Generate a random number between 0 and 100 + Probability = trunc(Enabled * 100), % Convert the Enabled value to a percentage + FlagEnabledValue = RandomNumber =< Probability, % Determine if the random number falls within the probability range + + ?set_attribute('app.featureflag.name', Name), + ?set_attribute('app.featureflag.raw_value', Enabled), + ?set_attribute('app.featureflag.enabled', FlagEnabledValue), + + {ok, Epoch} = 'Elixir.NaiveDateTime':from_erl({{1970, 1, 1}, {0, 0, 0}}), + CreatedAtSeconds = 'Elixir.NaiveDateTime':diff(CreatedAt, Epoch), + UpdatedAtSeconds = 'Elixir.NaiveDateTime':diff(UpdatedAt, Epoch), + + Flag = #{name => Name, + description => Description, + enabled => FlagEnabledValue, + created_at => #{seconds => CreatedAtSeconds, nanos => 0}, + updated_at => #{seconds => UpdatedAtSeconds, nanos => 0}}, + + {ok, #{flag => Flag}, Ctx} + end. + +-spec create_flag(ctx:t(), ffs_demo_pb:create_flag_request()) -> + {ok, ffs_demo_pb:create_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). +create_flag(_Ctx, _) -> + {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to create flags.">>}}. + +-spec update_flag(ctx:t(), ffs_demo_pb:update_flag_request()) -> + {ok, ffs_demo_pb:update_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). +update_flag(_Ctx, _) -> + {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to update flags.">>}}. + +-spec list_flags(ctx:t(), ffs_demo_pb:list_flags_request()) -> + {ok, ffs_demo_pb:list_flags_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). +list_flags(_Ctx, _) -> + {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to view all flags.">>}}. + +-spec delete_flag(ctx:t(), ffs_demo_pb:delete_flag_request()) -> + {ok, ffs_demo_pb:delete_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). +delete_flag(_Ctx, _) -> + {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to delete flags.">>}}. diff --git a/src/featureflagservice/test/featureflagservice/feature_flags_test.exs b/src/featureflagservice/test/featureflagservice/feature_flags_test.exs new file mode 100644 index 0000000000..c3020f3d5c --- /dev/null +++ b/src/featureflagservice/test/featureflagservice/feature_flags_test.exs @@ -0,0 +1,77 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.FeatureFlagsTest do + use Featureflagservice.DataCase + + alias Featureflagservice.FeatureFlags + + describe "featureflags" do + alias Featureflagservice.FeatureFlags.FeatureFlag + + import Featureflagservice.FeatureFlagsFixtures + + @invalid_attrs %{description: nil, enabled: nil, name: nil} + + test "list_feature_flags/0 returns all featureflags" do + feature_flag = feature_flag_fixture() + assert FeatureFlags.list_feature_flags() == [feature_flag] + end + + test "get_feature_flag!/1 returns the feature_flag with given id" do + feature_flag = feature_flag_fixture() + assert FeatureFlags.get_feature_flag!(feature_flag.id) == feature_flag + end + + test "create_feature_flag/1 with valid data creates a feature_flag" do + valid_attrs = %{description: "some description", enabled: true, name: "some name"} + + assert {:ok, %FeatureFlag{} = feature_flag} = FeatureFlags.create_feature_flag(valid_attrs) + assert feature_flag.description == "some description" + assert feature_flag.enabled == true + assert feature_flag.name == "some name" + end + + test "create_feature_flag/1 with invalid data returns error changeset" do + assert {:error, %Ecto.Changeset{}} = FeatureFlags.create_feature_flag(@invalid_attrs) + end + + test "update_feature_flag/2 with valid data updates the feature_flag" do + feature_flag = feature_flag_fixture() + + update_attrs = %{ + description: "some updated description", + enabled: false, + name: "some updated name" + } + + assert {:ok, %FeatureFlag{} = feature_flag} = + FeatureFlags.update_feature_flag(feature_flag, update_attrs) + + assert feature_flag.description == "some updated description" + assert feature_flag.enabled == false + assert feature_flag.name == "some updated name" + end + + test "update_feature_flag/2 with invalid data returns error changeset" do + feature_flag = feature_flag_fixture() + + assert {:error, %Ecto.Changeset{}} = + FeatureFlags.update_feature_flag(feature_flag, @invalid_attrs) + + assert feature_flag == FeatureFlags.get_feature_flag!(feature_flag.id) + end + + test "delete_feature_flag/1 deletes the feature_flag" do + feature_flag = feature_flag_fixture() + assert {:ok, %FeatureFlag{}} = FeatureFlags.delete_feature_flag(feature_flag) + assert_raise Ecto.NoResultsError, fn -> FeatureFlags.get_feature_flag!(feature_flag.id) end + end + + test "change_feature_flag/1 returns a feature_flag changeset" do + feature_flag = feature_flag_fixture() + assert %Ecto.Changeset{} = FeatureFlags.change_feature_flag(feature_flag) + end + end +end diff --git a/src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs b/src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs new file mode 100644 index 0000000000..1836bf5bac --- /dev/null +++ b/src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs @@ -0,0 +1,100 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.FeatureFlagControllerTest do + use FeatureflagserviceWeb.ConnCase + + import Featureflagservice.FeatureFlagsFixtures + + @create_attrs %{description: "some description", enabled: true, name: "some name"} + @update_attrs %{ + description: "some updated description", + enabled: false, + name: "some updated name" + } + @invalid_attrs %{description: nil, enabled: nil, name: nil} + + describe "index" do + test "lists all featureflags", %{conn: conn} do + conn = get(conn, Routes.feature_flag_path(conn, :index)) + assert html_response(conn, 200) =~ "Listing feature flags" + end + end + + describe "new feature_flag" do + test "renders form", %{conn: conn} do + conn = get(conn, Routes.feature_flag_path(conn, :new)) + assert html_response(conn, 200) =~ "New Feature flag" + end + end + + describe "create feature_flag" do + test "redirects to show when data is valid", %{conn: conn} do + conn = post(conn, Routes.feature_flag_path(conn, :create), feature_flag: @create_attrs) + + assert %{id: id} = redirected_params(conn) + assert redirected_to(conn) == Routes.feature_flag_path(conn, :show, id) + + conn = get(conn, Routes.feature_flag_path(conn, :show, id)) + assert html_response(conn, 200) =~ "Show feature flag" + end + + test "renders errors when data is invalid", %{conn: conn} do + conn = post(conn, Routes.feature_flag_path(conn, :create), feature_flag: @invalid_attrs) + assert html_response(conn, 200) =~ "New feature flag" + end + end + + describe "edit feature_flag" do + setup [:create_feature_flag] + + test "renders form for editing chosen feature_flag", %{conn: conn, feature_flag: feature_flag} do + conn = get(conn, Routes.feature_flag_path(conn, :edit, feature_flag)) + assert html_response(conn, 200) =~ "Edit feature flag" + end + end + + describe "update feature_flag" do + setup [:create_feature_flag] + + test "redirects when data is valid", %{conn: conn, feature_flag: feature_flag} do + conn = + put(conn, Routes.feature_flag_path(conn, :update, feature_flag), + feature_flag: @update_attrs + ) + + assert redirected_to(conn) == Routes.feature_flag_path(conn, :show, feature_flag) + + conn = get(conn, Routes.feature_flag_path(conn, :show, feature_flag)) + assert html_response(conn, 200) =~ "some updated description" + end + + test "renders errors when data is invalid", %{conn: conn, feature_flag: feature_flag} do + conn = + put(conn, Routes.feature_flag_path(conn, :update, feature_flag), + feature_flag: @invalid_attrs + ) + + assert html_response(conn, 200) =~ "Edit feature flag" + end + end + + describe "delete feature_flag" do + setup [:create_feature_flag] + + test "deletes chosen feature_flag", %{conn: conn, feature_flag: feature_flag} do + conn = delete(conn, Routes.feature_flag_path(conn, :delete, feature_flag)) + assert redirected_to(conn) == Routes.feature_flag_path(conn, :index) + + assert_error_sent 404, fn -> + get(conn, Routes.feature_flag_path(conn, :show, feature_flag)) + end + end + end + + defp create_feature_flag(_) do + feature_flag = feature_flag_fixture() + %{feature_flag: feature_flag} + end +end diff --git a/src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs b/src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs new file mode 100644 index 0000000000..bc05307d02 --- /dev/null +++ b/src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs @@ -0,0 +1,12 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.PageControllerTest do + use FeatureflagserviceWeb.ConnCase + + test "GET /", %{conn: conn} do + _conn = get(conn, "/") + assert true + end +end diff --git a/src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs b/src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs new file mode 100644 index 0000000000..9711b9ac32 --- /dev/null +++ b/src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs @@ -0,0 +1,19 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.ErrorViewTest do + use FeatureflagserviceWeb.ConnCase, async: true + + # Bring render/3 and render_to_string/3 for testing custom views + import Phoenix.View + + test "renders 404.html" do + assert render_to_string(FeatureflagserviceWeb.ErrorView, "404.html", []) == "Not Found" + end + + test "renders 500.html" do + assert render_to_string(FeatureflagserviceWeb.ErrorView, "500.html", []) == + "Internal Server Error" + end +end diff --git a/src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs b/src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs new file mode 100644 index 0000000000..641f4ac86b --- /dev/null +++ b/src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs @@ -0,0 +1,12 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.LayoutViewTest do + use FeatureflagserviceWeb.ConnCase, async: true + + # When testing helpers, you may want to import Phoenix.HTML and + # use functions such as safe_to_string() to convert the helper + # result into an HTML string. + # import Phoenix.HTML +end diff --git a/src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs b/src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs new file mode 100644 index 0000000000..48707ef49a --- /dev/null +++ b/src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs @@ -0,0 +1,7 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.PageViewTest do + use FeatureflagserviceWeb.ConnCase, async: true +end diff --git a/src/featureflagservice/test/support/conn_case.ex b/src/featureflagservice/test/support/conn_case.ex new file mode 100644 index 0000000000..ffc8384fdf --- /dev/null +++ b/src/featureflagservice/test/support/conn_case.ex @@ -0,0 +1,42 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule FeatureflagserviceWeb.ConnCase do + @moduledoc """ + This module defines the test case to be used by + tests that require setting up a connection. + + Such tests rely on `Phoenix.ConnTest` and also + import other functionality to make it easier + to build common data structures and query the data layer. + + Finally, if the test case interacts with the database, + we enable the SQL sandbox, so changes done to the database + are reverted at the end of every test. If you are using + PostgreSQL, you can even run database tests asynchronously + by setting `use FeatureflagserviceWeb.ConnCase, async: true`, although + this option is not recommended for other databases. + """ + + use ExUnit.CaseTemplate + + using do + quote do + # Import conveniences for testing with connections + import Plug.Conn + import Phoenix.ConnTest + import FeatureflagserviceWeb.ConnCase + + alias FeatureflagserviceWeb.Router.Helpers, as: Routes + + # The default endpoint for testing + @endpoint FeatureflagserviceWeb.Endpoint + end + end + + setup tags do + Featureflagservice.DataCase.setup_sandbox(tags) + {:ok, conn: Phoenix.ConnTest.build_conn()} + end +end diff --git a/src/featureflagservice/test/support/data_case.ex b/src/featureflagservice/test/support/data_case.ex new file mode 100644 index 0000000000..f908052f06 --- /dev/null +++ b/src/featureflagservice/test/support/data_case.ex @@ -0,0 +1,64 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.DataCase do + @moduledoc """ + This module defines the setup for tests requiring + access to the application's data layer. + + You may define functions here to be used as helpers in + your tests. + + Finally, if the test case interacts with the database, + we enable the SQL sandbox, so changes done to the database + are reverted at the end of every test. If you are using + PostgreSQL, you can even run database tests asynchronously + by setting `use Featureflagservice.DataCase, async: true`, although + this option is not recommended for other databases. + """ + + use ExUnit.CaseTemplate + + using do + quote do + alias Featureflagservice.Repo + + import Ecto + import Ecto.Changeset + import Ecto.Query + import Featureflagservice.DataCase + end + end + + setup tags do + Featureflagservice.DataCase.setup_sandbox(tags) + :ok + end + + @doc """ + Sets up the sandbox based on the test tags. + """ + def setup_sandbox(tags) do + pid = + Ecto.Adapters.SQL.Sandbox.start_owner!(Featureflagservice.Repo, shared: not tags[:async]) + + on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end) + end + + @doc """ + A helper that transforms changeset errors into a map of messages. + + assert {:error, changeset} = Accounts.create_user(%{password: "short"}) + assert "password is too short" in errors_on(changeset).password + assert %{password: ["password is too short"]} = errors_on(changeset) + + """ + def errors_on(changeset) do + Ecto.Changeset.traverse_errors(changeset, fn {message, opts} -> + Regex.replace(~r"%{(\w+)}", message, fn _, key -> + opts |> Keyword.get(String.to_existing_atom(key), key) |> to_string() + end) + end) + end +end diff --git a/src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex b/src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex new file mode 100644 index 0000000000..58b77becb3 --- /dev/null +++ b/src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex @@ -0,0 +1,31 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +defmodule Featureflagservice.FeatureFlagsFixtures do + @moduledoc """ + This module defines test helpers for creating + entities via the `Featureflagservice.FeatureFlags` context. + """ + + @doc """ + Generate a unique feature_flag name. + """ + def unique_feature_flag_name, do: "some name#{System.unique_integer([:positive])}" + + @doc """ + Generate a feature_flag. + """ + def feature_flag_fixture(attrs \\ %{}) do + {:ok, feature_flag} = + attrs + |> Enum.into(%{ + description: "some description", + enabled: true, + name: unique_feature_flag_name() + }) + |> Featureflagservice.FeatureFlags.create_feature_flag() + + feature_flag + end +end diff --git a/src/featureflagservice/test/test_helper.exs b/src/featureflagservice/test/test_helper.exs new file mode 100644 index 0000000000..83251b0055 --- /dev/null +++ b/src/featureflagservice/test/test_helper.exs @@ -0,0 +1,6 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + + +ExUnit.start() +Ecto.Adapters.SQL.Sandbox.mode(Featureflagservice.Repo, :manual) diff --git a/src/productcatalogservice/Dockerfile b/src/productcatalogservice/Dockerfile index 3dcb535faa..93645b862f 100644 --- a/src/productcatalogservice/Dockerfile +++ b/src/productcatalogservice/Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -FROM registry.ddbuild.io/images/mirror/golang:1.21.4-alpine AS builder +FROM registry.ddbuild.io/images/mirror/golang:1.22-alpine AS builder WORKDIR /usr/src/app/ diff --git a/src/productcatalogservice/go.mod b/src/productcatalogservice/go.mod index 08d12a7a74..03c180d357 100644 --- a/src/productcatalogservice/go.mod +++ b/src/productcatalogservice/go.mod @@ -31,18 +31,47 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect - go.opentelemetry.io/otel/metric v1.20.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + github.com/go-logr/zapr v1.2.4 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/mitchellh/copystructure v1.2.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/open-feature/flagd/core v0.7.4 // indirect + github.com/open-feature/schemas v0.2.8 // indirect + github.com/twmb/murmur3 v1.1.8 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect + github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect + github.com/xeipuuv/gojsonschema v1.2.0 // indirect + github.com/zeebo/xxh3 v1.0.2 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/proto/otlp v1.1.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.26.0 // indirect + golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.21.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apimachinery v0.29.0 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/controller-runtime v0.16.3 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) require ( - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 - go.opentelemetry.io/otel v1.20.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 - golang.org/x/sys v0.14.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect ) diff --git a/src/productcatalogservice/go.sum b/src/productcatalogservice/go.sum index 58fe80db48..1ca3e5bffe 100644 --- a/src/productcatalogservice/go.sum +++ b/src/productcatalogservice/go.sum @@ -457,7 +457,7 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -523,6 +523,9 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -566,8 +569,8 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= @@ -632,12 +635,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -686,33 +685,42 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= -go.opentelemetry.io/contrib/instrumentation/runtime v0.46.0 h1:dRj4IGqk65IHPLsur40gajPeQXxWWjprjeNq6aMJorU= -go.opentelemetry.io/contrib/instrumentation/runtime v0.46.0/go.mod h1:LD/bFNptUlSeHOX/6FMaAvjfvralTgFd09/EaZtV8X4= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.43.0 h1:tFUz2BE6ucxU9PuPCwzbfDeQjMznIySJ4/73a3FSPUs= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.43.0/go.mod h1:hbzqqcIxyywu6UQ5J1wb4ntla8nCwCfNBZnMo2Dgh48= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0= -go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= -go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= -go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= -go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= -go.opentelemetry.io/otel/sdk/metric v1.20.0 h1:5eD40l/H2CqdKmbSV7iht2KMK0faAIL2pVYzJOWobGk= -go.opentelemetry.io/otel/sdk/metric v1.20.0/go.mod h1:AGvpC+YF/jblITiafMTYgvRBUiwi9hZf0EYE2E5XlS8= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/runtime v0.49.0 h1:dg9y+7ArpumB6zwImJv47RHfdgOGQ1EMkzP5vLkEnTU= +go.opentelemetry.io/contrib/instrumentation/runtime v0.49.0/go.mod h1:Ul4MtXqu/hJBM+v7a6dCF0nHwckPMLpIpLeCi4+zfdw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0 h1:f2jriWfOdldanBwS9jNBdeOKAQN7b4ugAMaNu1/1k9g= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0/go.mod h1:B+bcQI1yTY+N0vqMpoZbEN7+XU4tNM0DmUiOwebFJWI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8= +go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= +go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -931,17 +939,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -1203,10 +1202,10 @@ google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614G google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1245,13 +1244,8 @@ google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= diff --git a/src/productcatalogservice/main.go b/src/productcatalogservice/main.go index 64f77bfd7f..335b0ee2b6 100644 --- a/src/productcatalogservice/main.go +++ b/src/productcatalogservice/main.go @@ -24,7 +24,6 @@ import ( "go.opentelemetry.io/contrib/instrumentation/runtime" "go.opentelemetry.io/otel/sdk/instrumentation" sdkmetric "go.opentelemetry.io/otel/sdk/metric" - healthpb "google.golang.org/grpc/health/grpc_health_v1" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" @@ -32,7 +31,6 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" "go.opentelemetry.io/otel/propagation" - sdkmetric "go.opentelemetry.io/otel/sdk/metric" sdkresource "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/trace" From c57cda2aaba3e8fdaaf3c7e82a85e2c94edd275c Mon Sep 17 00:00:00 2001 From: "luke.kraus@datadoghq.com" Date: Mon, 15 Apr 2024 12:47:06 -0400 Subject: [PATCH 2/2] Removing feature flag service --- .gitlab-ci.yml | 6 - ci/values.yaml | 4 - kubernetes/opentelemetry-demo.yaml | 26 ---- src/featureflagservice/Dockerfile | 111 -------------- src/featureflagservice/README.md | 45 ------ src/featureflagservice/assets/css/app.css | 135 ------------------ src/featureflagservice/assets/css/phoenix.css | 101 ------------- src/featureflagservice/assets/js/app.js | 48 ------- src/featureflagservice/config/config.exs | 47 ------ src/featureflagservice/config/dev.exs | 80 ----------- src/featureflagservice/config/prod.exs | 54 ------- src/featureflagservice/config/runtime.exs | 63 -------- src/featureflagservice/config/test.exs | 31 ---- .../lib/featureflagservice.ex | 13 -- .../lib/featureflagservice/application.ex | 41 ------ .../lib/featureflagservice/feature_flags.ex | 133 ----------------- .../feature_flags/feature_flag.ex | 24 ---- .../lib/featureflagservice/release.ex | 32 ----- .../lib/featureflagservice/repo.ex | 9 -- .../lib/featureflagservice_web.ex | 116 --------------- .../controllers/feature_flag_controller.ex | 66 --------- .../controllers/page_controller.ex | 14 -- .../lib/featureflagservice_web/endpoint.ex | 50 ------- .../lib/featureflagservice_web/gettext.ex | 28 ---- .../lib/featureflagservice_web/router.ex | 27 ---- .../templates/feature_flag/edit.html.heex | 21 --- .../templates/feature_flag/form.html.heex | 44 ------ .../templates/feature_flag/index.html.heex | 46 ------ .../templates/feature_flag/new.html.heex | 21 --- .../templates/feature_flag/show.html.heex | 39 ----- .../templates/layout/app.html.heex | 21 --- .../templates/layout/live.html.heex | 27 ---- .../templates/layout/root.html.heex | 46 ------ .../templates/page/index.html.heex | 46 ------ .../views/error_helpers.ex | 51 ------- .../views/error_view.ex | 20 --- .../views/feature_flag_view.ex | 7 - .../views/layout_view.ex | 7 - .../featureflagservice_web/views/page_view.ex | 7 - src/featureflagservice/mix.exs | 86 ----------- src/featureflagservice/mix.lock | 56 -------- .../priv/gettext/en/LC_MESSAGES/errors.po | 112 --------------- .../priv/gettext/errors.pot | 95 ------------ .../priv/repo/migrations/.formatter.exs | 4 - .../20220524172636_create_featureflags.exs | 50 ------- src/featureflagservice/priv/repo/seeds.exs | 13 -- .../priv/static/favicon.ico | Bin 1258 -> 0 bytes .../priv/static/images/phoenix.png | Bin 13900 -> 0 bytes src/featureflagservice/priv/static/robots.txt | 5 - src/featureflagservice/rebar.config | 30 ---- src/featureflagservice/rebar.lock | 31 ---- .../src/featureflagservice.app.src | 28 ---- src/featureflagservice/src/ffs_service.erl | 80 ----------- .../featureflagservice/feature_flags_test.exs | 77 ---------- .../feature_flag_controller_test.exs | 100 ------------- .../controllers/page_controller_test.exs | 12 -- .../views/error_view_test.exs | 19 --- .../views/layout_view_test.exs | 12 -- .../views/page_view_test.exs | 7 - .../test/support/conn_case.ex | 42 ------ .../test/support/data_case.ex | 64 --------- .../fixtures/feature_flags_fixtures.ex | 31 ---- src/featureflagservice/test/test_helper.exs | 6 - 63 files changed, 2667 deletions(-) delete mode 100644 src/featureflagservice/Dockerfile delete mode 100644 src/featureflagservice/README.md delete mode 100644 src/featureflagservice/assets/css/app.css delete mode 100644 src/featureflagservice/assets/css/phoenix.css delete mode 100644 src/featureflagservice/assets/js/app.js delete mode 100644 src/featureflagservice/config/config.exs delete mode 100644 src/featureflagservice/config/dev.exs delete mode 100644 src/featureflagservice/config/prod.exs delete mode 100644 src/featureflagservice/config/runtime.exs delete mode 100644 src/featureflagservice/config/test.exs delete mode 100644 src/featureflagservice/lib/featureflagservice.ex delete mode 100644 src/featureflagservice/lib/featureflagservice/application.ex delete mode 100644 src/featureflagservice/lib/featureflagservice/feature_flags.ex delete mode 100644 src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex delete mode 100644 src/featureflagservice/lib/featureflagservice/release.ex delete mode 100644 src/featureflagservice/lib/featureflagservice/repo.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/endpoint.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/gettext.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/router.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/views/error_view.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex delete mode 100644 src/featureflagservice/lib/featureflagservice_web/views/page_view.ex delete mode 100644 src/featureflagservice/mix.exs delete mode 100644 src/featureflagservice/mix.lock delete mode 100644 src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po delete mode 100644 src/featureflagservice/priv/gettext/errors.pot delete mode 100644 src/featureflagservice/priv/repo/migrations/.formatter.exs delete mode 100644 src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs delete mode 100644 src/featureflagservice/priv/repo/seeds.exs delete mode 100644 src/featureflagservice/priv/static/favicon.ico delete mode 100644 src/featureflagservice/priv/static/images/phoenix.png delete mode 100644 src/featureflagservice/priv/static/robots.txt delete mode 100644 src/featureflagservice/rebar.config delete mode 100644 src/featureflagservice/rebar.lock delete mode 100644 src/featureflagservice/src/featureflagservice.app.src delete mode 100644 src/featureflagservice/src/ffs_service.erl delete mode 100644 src/featureflagservice/test/featureflagservice/feature_flags_test.exs delete mode 100644 src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs delete mode 100644 src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs delete mode 100644 src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs delete mode 100644 src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs delete mode 100644 src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs delete mode 100644 src/featureflagservice/test/support/conn_case.ex delete mode 100644 src/featureflagservice/test/support/data_case.ex delete mode 100644 src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex delete mode 100644 src/featureflagservice/test/test_helper.exs diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49ecf5948b..0b5e3c1f60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,12 +62,6 @@ build-ci-image-emailservice: DOCKERFILE: src/emailservice/Dockerfile IMAGE_TAG_SUFFIX: emailservice CONTEXT: src/emailservice -build-ci-image-featureflagservice: - !!merge <<: *build-ci-image - variables: - DOCKERFILE: src/featureflagservice/Dockerfile - IMAGE_TAG_SUFFIX: featureflagservice - CONTEXT: . build-ci-image-frauddetectionservice: !!merge <<: *build-ci-image variables: diff --git a/ci/values.yaml b/ci/values.yaml index b1e324c537..5b8172d49e 100644 --- a/ci/values.yaml +++ b/ci/values.yaml @@ -160,10 +160,6 @@ components: resources: limits: memory: 200Mi - featureflagService: - resources: - limits: - memory: 1Gi kafka: resources: limits: diff --git a/kubernetes/opentelemetry-demo.yaml b/kubernetes/opentelemetry-demo.yaml index 776f2ed42d..fbf2ea2236 100644 --- a/kubernetes/opentelemetry-demo.yaml +++ b/kubernetes/opentelemetry-demo.yaml @@ -8607,32 +8607,6 @@ spec: # Source: opentelemetry-demo/templates/component.yaml apiVersion: v1 kind: Service -metadata: - name: opentelemetry-demo-featureflagservice - labels: - - opentelemetry.io/name: opentelemetry-demo-featureflagservice - app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/component: featureflagservice - app.kubernetes.io/name: opentelemetry-demo-featureflagservice - app.kubernetes.io/version: "1.8.0" - app.kubernetes.io/part-of: opentelemetry-demo -spec: - type: ClusterIP - ports: - - port: 50053 - name: grpc - targetPort: 50053 - - port: 8081 - name: http - targetPort: 8081 - selector: - - opentelemetry.io/name: opentelemetry-demo-featureflagservice ---- -# Source: opentelemetry-demo/templates/component.yaml -apiVersion: v1 -kind: Service metadata: name: opentelemetry-demo-ffspostgres labels: diff --git a/src/featureflagservice/Dockerfile b/src/featureflagservice/Dockerfile deleted file mode 100644 index 8c3e194b78..0000000000 --- a/src/featureflagservice/Dockerfile +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -# Find eligible builder and runner images on Docker Hub. We use Ubuntu/Debian instead of -# Alpine to avoid DNS resolution issues in production. -# -# https://hub.docker.com/r/hexpm/elixir/tags?page=1&name=ubuntu -# https://hub.docker.com/_/ubuntu?tab=tags -# -# -# This file is based on these images: -# -# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image -# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20210902-slim - for the release image -# - https://pkgs.org/ - resource for finding needed packages -# - Ex: hexpm/elixir:1.14.3-erlang-25.2.3-debian-buster-20230202-slim -# DO NOT CHANGE ELIXIR OR OTP OR DEBIAN VERSION OR IT WILL BREAK GHA BUILD -# Once there are ARM runners for GHA we can upgrade this. -# Not until then. -ARG ELIXIR_VERSION=1.14.3 -ARG OTP_VERSION=23.3.4.14 -ARG DEBIAN_VERSION=buster-20210902-slim - -ARG BUILDER_IMAGE="registry.ddbuild.io/images/mirror/hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}" -ARG RUNNER_IMAGE="registry.ddbuild.io/images/mirror/debian:${DEBIAN_VERSION}" - -FROM ${BUILDER_IMAGE} as builder - -# install build dependencies -RUN apt-get update -y && apt-get install -y build-essential git wget \ - && apt-get clean && rm -f /var/lib/apt/lists/*_* - -# prepare build dir -WORKDIR /app - -# install hex + rebar -RUN mix local.hex --force --verbose -RUN mix local.rebar --force --verbose -RUN wget https://github.com/erlang/rebar3/releases/download/3.20.0/rebar3 && chmod +x rebar3 && mv rebar3 ~/.mix -RUN wget https://github.com/rebar/rebar/wiki/rebar && chmod +x rebar && mv rebar ~/.mix -RUN mix archive.install github hexpm/hex branch latest --force - -# set build ENV -ENV MIX_ENV="prod" - -# install mix dependencies -COPY ./src/featureflagservice/mix.exs ./src/featureflagservice/mix.lock ./ -RUN mix deps.get --only $MIX_ENV -RUN mkdir config - -# copy compile-time config files before we compile dependencies -# to ensure any relevant config change will trigger the dependencies -# to be re-compiled. -COPY ./src/featureflagservice/config/config.exs ./src/featureflagservice/config/${MIX_ENV}.exs config/ -RUN mix deps.compile - -COPY ./src/featureflagservice/priv priv - -COPY ./src/featureflagservice/lib lib - -COPY ./src/featureflagservice/src src - -COPY ./src/featureflagservice/assets assets - -COPY ./pb/demo.proto proto/ - -COPY ./src/featureflagservice/rebar.config ./src/featureflagservice/rebar.lock ./ - -# generate protobuf files with rebar -RUN ~/.mix/rebar3 grpc_regen - -# compile assets -RUN mix assets.deploy - -# Compile the release -RUN mix compile - -# Changes to config/runtime.exs don't require recompiling the code -COPY ./src/featureflagservice/config/runtime.exs config/ - -COPY ./src/featureflagservice/rel rel -RUN mix release - -# start a new build stage so that the final image will only contain -# the compiled release and other runtime necessities -FROM ${RUNNER_IMAGE} - -RUN apt-get update -y && apt-get install -y openssl libncurses5 locales curl \ - && apt-get clean && rm -f /var/lib/apt/lists/*_* - -# Set the locale -RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen - -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 - -WORKDIR "/app" -RUN chown nobody /app - -# set runner ENV -ENV MIX_ENV="prod" -ENV SECRET_KEY_BASE="mNhoOKKxgyvBIwbtw0P23waQcvUOmusb2U1moG2I7JQ3Bt6+MlGb5ZTrHwqbqy7j" - -# Only copy the final release from the build stage -COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/featureflagservice ./ - -USER nobody - -ENTRYPOINT ["/app/bin/server"] diff --git a/src/featureflagservice/README.md b/src/featureflagservice/README.md deleted file mode 100644 index dab7f0232d..0000000000 --- a/src/featureflagservice/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Feature Flag Service - -This project provides an web interface for creating and updating feature flags -and a GRPC service for fetching the status of flags by their name. Each runs on -their own port but are in the same Release. - -## Running - -To run individually and not part of the demo the Release can be built with -`mix`: - -``` shell -MIX_ENV=prod mix release -``` - -Then start Postgres with `docker compose` - -``` shell -docker compose up -``` - -And run the Release: - -``` shell -PHX_SERVER=1 FEATURE_FLAG_SERVICE_PORT=4000 FEATURE_FLAG_GRPC_SERVICE_PORT=4001 _build/prod/rel/featureflagservice/bin/featureflagservice start_iex -``` - -## Instrumentation - -Traces of interaction with the web interface is provided by the OpenTelemetry -[Phoenix -instrumentation](https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/instrumentation/opentelemetry_phoenix) -with Spans for database queries added through the [Ecto -instrumentation](https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/instrumentation/opentelemetry_ecto). - -The GRPC service uses [grpcbox](https://github.com/tsloughter/grpcbox) and uses -the [grpcbox -interceptor](https://github.com/open-telemetry/opentelemetry-erlang-contrib/tree/main/instrumentation/opentelemetry_grpcbox) -for instrumentation. - -## Building Protos - -A copy of the protos from `pb/demo.proto` are kept in -`proto/demo.proto` and `rebar3 grpc_regen` will update the corresponding -Erlang module `src/ffs_demo_pb.erl`. diff --git a/src/featureflagservice/assets/css/app.css b/src/featureflagservice/assets/css/app.css deleted file mode 100644 index eff8666199..0000000000 --- a/src/featureflagservice/assets/css/app.css +++ /dev/null @@ -1,135 +0,0 @@ -/** -* Copyright The OpenTelemetry Authors -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -@import "./phoenix.css"; - -/* Alerts and form errors used by phx.new */ -.alert { - padding: 15px; - margin-bottom: 20px; - border: 1px solid transparent; - border-radius: 4px; -} -.alert-info { - color: #31708f; - background-color: #d9edf7; - border-color: #bce8f1; -} -.alert-warning { - color: #8a6d3b; - background-color: #fcf8e3; - border-color: #faebcc; -} -.alert-danger { - color: #a94442; - background-color: #f2dede; - border-color: #ebccd1; -} -.alert p { - margin-bottom: 0; -} -.alert:empty { - display: none; -} -.invalid-feedback { - color: #a94442; - display: block; - margin: -1rem 0 2rem; -} - -/* LiveView specific classes for your customization */ -.phx-no-feedback.invalid-feedback, -.phx-no-feedback .invalid-feedback { - display: none; -} - -.phx-click-loading { - opacity: 0.5; - transition: opacity 1s ease-out; -} - -.phx-loading{ - cursor: wait; -} - -.phx-modal { - opacity: 1!important; - position: fixed; - z-index: 1; - left: 0; - top: 0; - width: 100%; - height: 100%; - overflow: auto; - background-color: rgba(0,0,0,0.4); -} - -.phx-modal-content { - background-color: #fefefe; - margin: 15vh auto; - padding: 20px; - border: 1px solid #888; - width: 80%; -} - -.phx-modal-close { - color: #aaa; - float: right; - font-size: 28px; - font-weight: bold; -} - -.phx-modal-close:hover, -.phx-modal-close:focus { - color: black; - text-decoration: none; - cursor: pointer; -} - -.fade-in-scale { - animation: 0.2s ease-in 0s normal forwards 1 fade-in-scale-keys; -} - -.fade-out-scale { - animation: 0.2s ease-out 0s normal forwards 1 fade-out-scale-keys; -} - -.fade-in { - animation: 0.2s ease-out 0s normal forwards 1 fade-in-keys; -} -.fade-out { - animation: 0.2s ease-out 0s normal forwards 1 fade-out-keys; -} - -@keyframes fade-in-scale-keys{ - 0% { scale: 0.95; opacity: 0; } - 100% { scale: 1.0; opacity: 1; } -} - -@keyframes fade-out-scale-keys{ - 0% { scale: 1.0; opacity: 1; } - 100% { scale: 0.95; opacity: 0; } -} - -@keyframes fade-in-keys{ - 0% { opacity: 0; } - 100% { opacity: 1; } -} - -@keyframes fade-out-keys{ - 0% { opacity: 1; } - 100% { opacity: 0; } -} diff --git a/src/featureflagservice/assets/css/phoenix.css b/src/featureflagservice/assets/css/phoenix.css deleted file mode 100644 index 0d59050f89..0000000000 --- a/src/featureflagservice/assets/css/phoenix.css +++ /dev/null @@ -1,101 +0,0 @@ -/* Includes some default style for the starter application. - * This can be safely deleted to start fresh. - */ - -/* Milligram v1.4.1 https://milligram.github.io - * Copyright (c) 2020 CJ Patoilo Licensed under the MIT license - */ - -*,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{color:#000000;font-family:'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;font-size:1.6em;font-weight:300;letter-spacing:.01em;line-height:1.6}blockquote{border-left:0.3rem solid #d1d1d1;margin-left:0;margin-right:0;padding:1rem 1.5rem}blockquote *:last-child{margin-bottom:0}.button,button,input[type='button'],input[type='reset'],input[type='submit']{background-color:#0069d9;border:0.1rem solid #0069d9;border-radius:.4rem;color:#fff;cursor:pointer;display:inline-block;font-size:1.1rem;font-weight:700;height:3.8rem;letter-spacing:.1rem;line-height:3.8rem;padding:0 3.0rem;text-align:center;text-decoration:none;text-transform:uppercase;white-space:nowrap}.button:focus,.button:hover,button:focus,button:hover,input[type='button']:focus,input[type='button']:hover,input[type='reset']:focus,input[type='reset']:hover,input[type='submit']:focus,input[type='submit']:hover{background-color:#606c76;border-color:#606c76;color:#fff;outline:0}.button[disabled],button[disabled],input[type='button'][disabled],input[type='reset'][disabled],input[type='submit'][disabled]{cursor:default;opacity:.5}.button[disabled]:focus,.button[disabled]:hover,button[disabled]:focus,button[disabled]:hover,input[type='button'][disabled]:focus,input[type='button'][disabled]:hover,input[type='reset'][disabled]:focus,input[type='reset'][disabled]:hover,input[type='submit'][disabled]:focus,input[type='submit'][disabled]:hover{background-color:#0069d9;border-color:#0069d9}.button.button-outline,button.button-outline,input[type='button'].button-outline,input[type='reset'].button-outline,input[type='submit'].button-outline{background-color:transparent;color:#0069d9}.button.button-outline:focus,.button.button-outline:hover,button.button-outline:focus,button.button-outline:hover,input[type='button'].button-outline:focus,input[type='button'].button-outline:hover,input[type='reset'].button-outline:focus,input[type='reset'].button-outline:hover,input[type='submit'].button-outline:focus,input[type='submit'].button-outline:hover{background-color:transparent;border-color:#606c76;color:#606c76}.button.button-outline[disabled]:focus,.button.button-outline[disabled]:hover,button.button-outline[disabled]:focus,button.button-outline[disabled]:hover,input[type='button'].button-outline[disabled]:focus,input[type='button'].button-outline[disabled]:hover,input[type='reset'].button-outline[disabled]:focus,input[type='reset'].button-outline[disabled]:hover,input[type='submit'].button-outline[disabled]:focus,input[type='submit'].button-outline[disabled]:hover{border-color:inherit;color:#0069d9}.button.button-clear,button.button-clear,input[type='button'].button-clear,input[type='reset'].button-clear,input[type='submit'].button-clear{background-color:transparent;border-color:transparent;color:#0069d9}.button.button-clear:focus,.button.button-clear:hover,button.button-clear:focus,button.button-clear:hover,input[type='button'].button-clear:focus,input[type='button'].button-clear:hover,input[type='reset'].button-clear:focus,input[type='reset'].button-clear:hover,input[type='submit'].button-clear:focus,input[type='submit'].button-clear:hover{background-color:transparent;border-color:transparent;color:#606c76}.button.button-clear[disabled]:focus,.button.button-clear[disabled]:hover,button.button-clear[disabled]:focus,button.button-clear[disabled]:hover,input[type='button'].button-clear[disabled]:focus,input[type='button'].button-clear[disabled]:hover,input[type='reset'].button-clear[disabled]:focus,input[type='reset'].button-clear[disabled]:hover,input[type='submit'].button-clear[disabled]:focus,input[type='submit'].button-clear[disabled]:hover{color:#0069d9}code{background:#f4f5f6;border-radius:.4rem;font-size:86%;margin:0 .2rem;padding:.2rem .5rem;white-space:nowrap}pre{background:#f4f5f6;border-left:0.3rem solid #0069d9;overflow-y:hidden}pre>code{border-radius:0;display:block;padding:1rem 1.5rem;white-space:pre}hr{border:0;border-top:0.1rem solid #f4f5f6;margin:3.0rem 0}input[type='color'],input[type='date'],input[type='datetime'],input[type='datetime-local'],input[type='email'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='url'],input[type='week'],input:not([type]),textarea,select{-webkit-appearance:none;background-color:transparent;border:0.1rem solid #d1d1d1;border-radius:.4rem;box-shadow:none;box-sizing:inherit;height:3.8rem;padding:.6rem 1.0rem .7rem;width:100%}input[type='color']:focus,input[type='date']:focus,input[type='datetime']:focus,input[type='datetime-local']:focus,input[type='email']:focus,input[type='month']:focus,input[type='number']:focus,input[type='password']:focus,input[type='search']:focus,input[type='tel']:focus,input[type='text']:focus,input[type='url']:focus,input[type='week']:focus,input:not([type]):focus,textarea:focus,select:focus{border-color:#0069d9;outline:0}select{background:url('data:image/svg+xml;utf8,') center right no-repeat;padding-right:3.0rem}select:focus{background-image:url('data:image/svg+xml;utf8,')}select[multiple]{background:none;height:auto}textarea{min-height:6.5rem}label,legend{display:block;font-size:1.6rem;font-weight:700;margin-bottom:.5rem}fieldset{border-width:0;padding:0}input[type='checkbox'],input[type='radio']{display:inline}.label-inline{display:inline-block;font-weight:normal;margin-left:.5rem}.container{margin:0 auto;max-width:112.0rem;padding:0 2.0rem;position:relative;width:100%}.row{display:flex;flex-direction:column;padding:0;width:100%}.row.row-no-padding{padding:0}.row.row-no-padding>.column{padding:0}.row.row-wrap{flex-wrap:wrap}.row.row-top{align-items:flex-start}.row.row-bottom{align-items:flex-end}.row.row-center{align-items:center}.row.row-stretch{align-items:stretch}.row.row-baseline{align-items:baseline}.row .column{display:block;flex:1 1 auto;margin-left:0;max-width:100%;width:100%}.row .column.column-offset-10{margin-left:10%}.row .column.column-offset-20{margin-left:20%}.row .column.column-offset-25{margin-left:25%}.row .column.column-offset-33,.row .column.column-offset-34{margin-left:33.3333%}.row .column.column-offset-40{margin-left:40%}.row .column.column-offset-50{margin-left:50%}.row .column.column-offset-60{margin-left:60%}.row .column.column-offset-66,.row .column.column-offset-67{margin-left:66.6666%}.row .column.column-offset-75{margin-left:75%}.row .column.column-offset-80{margin-left:80%}.row .column.column-offset-90{margin-left:90%}.row .column.column-10{flex:0 0 10%;max-width:10%}.row .column.column-20{flex:0 0 20%;max-width:20%}.row .column.column-25{flex:0 0 25%;max-width:25%}.row .column.column-33,.row .column.column-34{flex:0 0 33.3333%;max-width:33.3333%}.row .column.column-40{flex:0 0 40%;max-width:40%}.row .column.column-50{flex:0 0 50%;max-width:50%}.row .column.column-60{flex:0 0 60%;max-width:60%}.row .column.column-66,.row .column.column-67{flex:0 0 66.6666%;max-width:66.6666%}.row .column.column-75{flex:0 0 75%;max-width:75%}.row .column.column-80{flex:0 0 80%;max-width:80%}.row .column.column-90{flex:0 0 90%;max-width:90%}.row .column .column-top{align-self:flex-start}.row .column .column-bottom{align-self:flex-end}.row .column .column-center{align-self:center}@media (min-width: 40rem){.row{flex-direction:row;margin-left:-1.0rem;width:calc(100% + 2.0rem)}.row .column{margin-bottom:inherit;padding:0 1.0rem}}a{color:#0069d9;text-decoration:none}a:focus,a:hover{color:#606c76}dl,ol,ul{list-style:none;margin-top:0;padding-left:0}dl dl,dl ol,dl ul,ol dl,ol ol,ol ul,ul dl,ul ol,ul ul{font-size:90%;margin:1.5rem 0 1.5rem 3.0rem}ol{list-style:decimal inside}ul{list-style:circle inside}.button,button,dd,dt,li{margin-bottom:1.0rem}fieldset,input,select,textarea{margin-bottom:1.5rem}blockquote,dl,figure,form,ol,p,pre,table,ul{margin-bottom:2.5rem}table{border-spacing:0;display:block;overflow-x:auto;text-align:left;width:100%}td,th{border-bottom:0.1rem solid #e1e1e1;padding:1.2rem 1.5rem}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}@media (min-width: 40rem){table{display:table;overflow-x:initial}}b,strong{font-weight:bold}p{margin-top:0}h1,h2,h3,h4,h5,h6{font-weight:300;letter-spacing:-.1rem;margin-bottom:2.0rem;margin-top:0}h1{font-size:4.6rem;line-height:1.2}h2{font-size:3.6rem;line-height:1.25}h3{font-size:2.8rem;line-height:1.3}h4{font-size:2.2rem;letter-spacing:-.08rem;line-height:1.35}h5{font-size:1.8rem;letter-spacing:-.05rem;line-height:1.5}h6{font-size:1.6rem;letter-spacing:0;line-height:1.4}img{max-width:100%}.clearfix:after{clear:both;content:' ';display:table}.float-left{float:left}.float-right{float:right} - -/* General style */ -h1{font-size: 3.6rem; line-height: 1.25} -h2{font-size: 2.8rem; line-height: 1.3} -h3{font-size: 2.2rem; letter-spacing: -.08rem; line-height: 1.35} -h4{font-size: 1.8rem; letter-spacing: -.05rem; line-height: 1.5} -h5{font-size: 1.6rem; letter-spacing: 0; line-height: 1.4} -h6{font-size: 1.4rem; letter-spacing: 0; line-height: 1.2} -pre{padding: 1em;} - -.container{ - margin: 0 auto; - max-width: 80.0rem; - padding: 0 2.0rem; - position: relative; - width: 100% -} -select { - width: auto; -} - -/* Phoenix promo and logo */ -.phx-hero { - text-align: center; - border-bottom: 1px solid #e3e3e3; - background: #eee; - border-radius: 6px; - padding: 3em 3em 1em; - margin-bottom: 3rem; - font-weight: 200; - font-size: 120%; -} -.phx-hero input { - background: #ffffff; -} -.phx-logo { - min-width: 300px; - margin: 1rem; - display: block; -} -.phx-logo img { - width: auto; - display: block; -} - -/* Headers */ -header { - width: 100%; - background: #fdfdfd; - border-bottom: 1px solid #eaeaea; - margin-bottom: 2rem; -} -header section { - align-items: center; - display: flex; - flex-direction: column; - justify-content: space-between; -} -header section :first-child { - order: 2; -} -header section :last-child { - order: 1; -} -header nav ul, -header nav li { - margin: 0; - padding: 0; - display: block; - text-align: right; - white-space: nowrap; -} -header nav ul { - margin: 1rem; - margin-top: 0; -} -header nav a { - display: block; -} - -@media (min-width: 40.0rem) { /* Small devices (landscape phones, 576px and up) */ - header section { - flex-direction: row; - } - header nav ul { - margin: 1rem; - } - .phx-logo { - flex-basis: 527px; - margin: 2rem 1rem; - } -} diff --git a/src/featureflagservice/assets/js/app.js b/src/featureflagservice/assets/js/app.js deleted file mode 100644 index ab36ce2028..0000000000 --- a/src/featureflagservice/assets/js/app.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// We import the CSS which is extracted to its own file by esbuild. -// Remove this line if you add a your own CSS build pipeline (e.g postcss). -import "../css/app.css" - -// If you want to use Phoenix channels, run `mix help phx.gen.channel` -// to get started and then uncomment the line below. -// import "./user_socket.js" - -// You can include dependencies in two ways. -// -// The simplest option is to put them in assets/vendor and -// import them using relative paths: -// -// import "../vendor/some-package.js" -// -// Alternatively, you can `npm install some-package --prefix assets` and import -// them using a path starting with the package name: -// -// import "some-package" -// - -// Include phoenix_html to handle method=PUT/DELETE in forms and buttons. -import "phoenix_html" -// Establish Phoenix Socket and LiveView configuration. -import {Socket} from "phoenix" -import {LiveSocket} from "phoenix_live_view" -import topbar from "../vendor/topbar" - -let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content") -let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}}) - -// Show progress bar on live navigation and form submits -topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"}) -window.addEventListener("phx:page-loading-start", info => topbar.show()) -window.addEventListener("phx:page-loading-stop", info => topbar.hide()) - -// connect if there are any LiveViews on the page -liveSocket.connect() - -// expose liveSocket on window for web console debug logs and latency simulation: -// >> liveSocket.enableDebug() -// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session -// >> liveSocket.disableLatencySim() -window.liveSocket = liveSocket - diff --git a/src/featureflagservice/config/config.exs b/src/featureflagservice/config/config.exs deleted file mode 100644 index 4c4bae47fe..0000000000 --- a/src/featureflagservice/config/config.exs +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -# This file is responsible for configuring your application -# and its dependencies with the aid of the Config module. -# -# This configuration file is loaded before any dependency and -# is restricted to this project. - -# General application configuration -import Config - -config :featureflagservice, - ecto_repos: [Featureflagservice.Repo] - -# Configures the endpoint -config :featureflagservice, FeatureflagserviceWeb.Endpoint, - url: [host: "localhost", path: "/feature"], - render_errors: [view: FeatureflagserviceWeb.ErrorView, accepts: ~w(html json), layout: false], - pubsub_server: Featureflagservice.PubSub, - live_view: [signing_salt: "T88WPl/Q"] - -# Configure esbuild (the version is required) -config :esbuild, - version: "0.14.29", - default: [ - args: - ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*), - cd: Path.expand("../assets", __DIR__), - env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)} - ] - -# Configures Elixir's Logger -config :logger, :console, - format: "$time $metadata[$level] $message\n", - metadata: [:request_id] - -config :logger, - level: :debug - -# Use Jason for JSON parsing in Phoenix -config :phoenix, :json_library, Jason - -# Import environment specific config. This must remain at the bottom -# of this file so it overrides the configuration defined above. -import_config "#{config_env()}.exs" diff --git a/src/featureflagservice/config/dev.exs b/src/featureflagservice/config/dev.exs deleted file mode 100644 index 8f5e1f1059..0000000000 --- a/src/featureflagservice/config/dev.exs +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -import Config - -# Configure your database -config :featureflagservice, Featureflagservice.Repo, - username: "postgres", - password: "postgres", - hostname: "localhost", - database: "featureflagservice_dev", - stacktrace: true, - show_sensitive_data_on_connection_error: true, - pool_size: 10 - -# For development, we disable any cache and enable -# debugging and code reloading. -# -# The watchers configuration can be used to run external -# watchers to your application. For example, we use it -# with esbuild to bundle .js and .css sources. -config :featureflagservice, FeatureflagserviceWeb.Endpoint, - # Binding to loopback ipv4 address prevents access from other machines. - # Change to `ip: {0, 0, 0, 0}` to allow access from other machines. - http: [ip: {127, 0, 0, 1}, port: 4000], - check_origin: false, - code_reloader: true, - debug_errors: true, - secret_key_base: "GH1AJrEOJEVmzyUE+5kgz2cfBEOg5qPBlTYVive++6s/QS0BE3xjNoRCd7xI3zSv", - watchers: [ - # Start the esbuild watcher by calling Esbuild.install_and_run(:default, args) - esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]} - ] - -# ## SSL Support -# -# In order to use HTTPS in development, a self-signed -# certificate can be generated by running the following -# Mix task: -# -# mix phx.gen.cert -# -# Note that this task requires Erlang/OTP 20 or later. -# Run `mix help phx.gen.cert` for more information. -# -# The `http:` config above can be replaced with: -# -# https: [ -# port: 4001, -# cipher_suite: :strong, -# keyfile: "priv/cert/selfsigned_key.pem", -# certfile: "priv/cert/selfsigned.pem" -# ], -# -# If desired, both `http:` and `https:` keys can be -# configured to run both http and https servers on -# different ports. - -# Watch static and templates for browser reloading. -config :featureflagservice, FeatureflagserviceWeb.Endpoint, - live_reload: [ - patterns: [ - ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$", - ~r"priv/gettext/.*(po)$", - ~r"lib/featureflagservice_web/(live|views)/.*(ex)$", - ~r"lib/featureflagservice_web/templates/.*(eex)$" - ] - ] - -# Do not include metadata nor timestamps in development logs -config :logger, :console, format: "[$level] $message\n" -config :logger, level: :debug - -# Set a higher stacktrace during development. Avoid configuring such -# in production as building large stacktraces may be expensive. -config :phoenix, :stacktrace_depth, 20 - -# Initialize plugs at runtime for faster development compilation -config :phoenix, :plug_init_mode, :runtime diff --git a/src/featureflagservice/config/prod.exs b/src/featureflagservice/config/prod.exs deleted file mode 100644 index b4fb5e0ff2..0000000000 --- a/src/featureflagservice/config/prod.exs +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -import Config - -# For production, don't forget to configure the url host -# to something meaningful, Phoenix uses this information -# when generating URLs. -# -# Note we also include the path to a cache manifest -# containing the digested version of static files. This -# manifest is generated by the `mix phx.digest` task, -# which you should run after static files are built and -# before starting your production server. -config :featureflagservice, FeatureflagserviceWeb.Endpoint, - cache_static_manifest: "priv/static/cache_manifest.json" - -# Do not print debug messages in production -config :logger, level: :info - -# ## SSL Support -# -# To get SSL working, you will need to add the `https` key -# to the previous section and set your `:url` port to 443: -# -# config :featureflagservice, FeatureflagserviceWeb.Endpoint, -# ..., -# url: [host: "example.com", port: 443], -# https: [ -# ..., -# port: 443, -# cipher_suite: :strong, -# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"), -# certfile: System.get_env("SOME_APP_SSL_CERT_PATH") -# ] -# -# The `cipher_suite` is set to `:strong` to support only the -# latest and more secure SSL ciphers. This means old browsers -# and clients may not be supported. You can set it to -# `:compatible` for wider support. -# -# `:keyfile` and `:certfile` expect an absolute path to the key -# and cert in disk or a relative path inside priv, for example -# "priv/ssl/server.key". For all supported SSL configuration -# options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1 -# -# We also recommend setting `force_ssl` in your endpoint, ensuring -# no data is ever sent via http, always redirecting to https: -# -# config :featureflagservice, FeatureflagserviceWeb.Endpoint, -# force_ssl: [hsts: true] -# -# Check `Plug.SSL` for all available options in `force_ssl`. diff --git a/src/featureflagservice/config/runtime.exs b/src/featureflagservice/config/runtime.exs deleted file mode 100644 index c16d214d35..0000000000 --- a/src/featureflagservice/config/runtime.exs +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -import Config - -if System.get_env("PHX_SERVER") do - config :featureflagservice, FeatureflagserviceWeb.Endpoint, server: true -end - -grpc_port = String.to_integer(System.get_env("FEATURE_FLAG_GRPC_SERVICE_PORT")) - -config :grpcbox, - servers: [ - %{ - :grpc_opts => %{ - :service_protos => [:ffs_demo_pb], - :unary_interceptor => {:otel_grpcbox_interceptor, :unary}, - :services => %{:"oteldemo.FeatureFlagService" => :ffs_service} - }, - :listen_opts => %{:port => grpc_port} - } - ] - -if config_env() == :prod do - database_url = - System.get_env("DATABASE_URL") || - raise """ - environment variable DATABASE_URL is missing. - For example: ecto://USER:PASS@HOST/DATABASE - """ - - maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: [] - - config :featureflagservice, Featureflagservice.Repo, - # ssl: true, - url: database_url, - pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), - socket_options: maybe_ipv6 - - # The secret key base is used to sign/encrypt cookies and other secrets. - # A default value is used in config/dev.exs and config/test.exs but you - # want to use a different value for prod and you most likely don't want - # to check this value into version control, so we use an environment - # variable instead. - secret_key_base = - System.get_env("SECRET_KEY_BASE") || - raise """ - environment variable SECRET_KEY_BASE is missing. - You can generate one by calling: mix phx.gen.secret - """ - - host = System.get_env("PHX_HOST") || "localhost" - port = String.to_integer(System.get_env("FEATURE_FLAG_SERVICE_PORT")) - - config :featureflagservice, FeatureflagserviceWeb.Endpoint, - url: [host: host, port: 443, scheme: "https"], - http: [ - ip: {0, 0, 0, 0}, - port: port - ], - secret_key_base: secret_key_base -end diff --git a/src/featureflagservice/config/test.exs b/src/featureflagservice/config/test.exs deleted file mode 100644 index 8da154d22c..0000000000 --- a/src/featureflagservice/config/test.exs +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -import Config - -# Configure your database -# -# The MIX_TEST_PARTITION environment variable can be used -# to provide built-in test partitioning in CI environment. -# Run `mix help test` for more information. -config :featureflagservice, Featureflagservice.Repo, - username: "postgres", - password: "postgres", - hostname: "localhost", - database: "featureflagservice_test#{System.get_env("MIX_TEST_PARTITION")}", - pool: Ecto.Adapters.SQL.Sandbox, - pool_size: 10 - -# We don't run a server during test. If one is required, -# you can enable the server option below. -config :featureflagservice, FeatureflagserviceWeb.Endpoint, - http: [ip: {127, 0, 0, 1}, port: 4002], - secret_key_base: "HcCBiW6WwFO9llsQig9V6rxpIwlHoKC722YEs/ANSl+w6uJG1aAbeSZOcR/3sA57", - server: false - -# Print only warnings and errors during test -config :logger, level: :warn - -# Initialize plugs at runtime for faster test compilation -config :phoenix, :plug_init_mode, :runtime diff --git a/src/featureflagservice/lib/featureflagservice.ex b/src/featureflagservice/lib/featureflagservice.ex deleted file mode 100644 index fca24ccdc5..0000000000 --- a/src/featureflagservice/lib/featureflagservice.ex +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice do - @moduledoc """ - Featureflagservice keeps the contexts that define your domain - and business logic. - - Contexts are also responsible for managing your data, regardless - if it comes from the database, an external API or others. - """ -end diff --git a/src/featureflagservice/lib/featureflagservice/application.ex b/src/featureflagservice/lib/featureflagservice/application.ex deleted file mode 100644 index 8f2d3332a1..0000000000 --- a/src/featureflagservice/lib/featureflagservice/application.ex +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.Application do - # See https://hexdocs.pm/elixir/Application.html - # for more information on OTP Applications - @moduledoc false - - use Application - - @impl true - def start(_type, _args) do - OpentelemetryEcto.setup([:featureflagservice, :repo]) - OpentelemetryPhoenix.setup() - - children = [ - # Start the Ecto repository - Featureflagservice.Repo, - # Start the PubSub system - {Phoenix.PubSub, name: Featureflagservice.PubSub}, - # Start the Endpoint (http/https) - FeatureflagserviceWeb.Endpoint - # Start a worker by calling: Featureflagservice.Worker.start_link(arg) - # {Featureflagservice.Worker, arg} - ] - - # See https://hexdocs.pm/elixir/Supervisor.html - # for other strategies and supported options - opts = [strategy: :one_for_one, name: Featureflagservice.Supervisor] - Supervisor.start_link(children, opts) - end - - # Tell Phoenix to update the endpoint configuration - # whenever the application is updated. - @impl true - def config_change(changed, _new, removed) do - FeatureflagserviceWeb.Endpoint.config_change(changed, removed) - :ok - end -end diff --git a/src/featureflagservice/lib/featureflagservice/feature_flags.ex b/src/featureflagservice/lib/featureflagservice/feature_flags.ex deleted file mode 100644 index 7897c49989..0000000000 --- a/src/featureflagservice/lib/featureflagservice/feature_flags.ex +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.FeatureFlags do - @moduledoc """ - The FeatureFlags context. - """ - - import Ecto.Query, warn: false - - require OpenTelemetry.Tracer - - alias Featureflagservice.Repo - - alias Featureflagservice.FeatureFlags.FeatureFlag - - @doc """ - Returns the list of featureflags. - - ## Examples - - iex> list_feature_flags() - [%FeatureFlag{}, ...] - - """ - def list_feature_flags do - Repo.all(FeatureFlag) - end - - @doc """ - Gets a single feature_flag. - - Raises `Ecto.NoResultsError` if the Feature flag does not exist. - - ## Examples - - iex> get_feature_flag!(123) - %FeatureFlag{} - - iex> get_feature_flag!(456) - ** (Ecto.NoResultsError) - - """ - def get_feature_flag!(id), do: Repo.get!(FeatureFlag, id) - - @doc """ - Gets a single feature_flag by name. - - ## Examples - - iex> get_feature_flag_by_name("feature-1") - %FeatureFlag{} - - iex> get_feature_flag_by_name("not-a-feature-flag") - nil - - """ - def get_feature_flag_by_name(name), do: Repo.get_by(FeatureFlag, name: name) - - @doc """ - Creates a feature_flag. - - ## Examples - - iex> create_feature_flag(%{field: value}) - {:ok, %FeatureFlag{}} - - iex> create_feature_flag(%{field: bad_value}) - {:error, %Ecto.Changeset{}} - - """ - def create_feature_flag(attrs \\ %{}) do - {function_name, arity} = __ENV__.function - OpenTelemetry.Tracer.with_span "featureflagservice.featureflags.#{function_name}/#{arity}" do - OpenTelemetry.Tracer.set_attributes(%{ - "app.featureflag.name" => attrs["name"], - "app.featureflag.description" => attrs["description"], - "app.featureflag.enabled" => attrs["enabled"] - }) - %FeatureFlag{} - |> FeatureFlag.changeset(attrs) - |> Repo.insert() - end - end - - @doc """ - Updates a feature_flag. - - ## Examples - - iex> update_feature_flag(feature_flag, %{field: new_value}) - {:ok, %FeatureFlag{}} - - iex> update_feature_flag(feature_flag, %{field: bad_value}) - {:error, %Ecto.Changeset{}} - - """ - def update_feature_flag(%FeatureFlag{} = feature_flag, attrs) do - feature_flag - |> FeatureFlag.changeset(attrs) - |> Repo.update() - end - - @doc """ - Deletes a feature_flag. - - ## Examples - - iex> delete_feature_flag(feature_flag) - {:ok, %FeatureFlag{}} - - iex> delete_feature_flag(feature_flag) - {:error, %Ecto.Changeset{}} - - """ - def delete_feature_flag(%FeatureFlag{} = feature_flag) do - Repo.delete(feature_flag) - end - - @doc """ - Returns an `%Ecto.Changeset{}` for tracking feature_flag changes. - - ## Examples - - iex> change_feature_flag(feature_flag) - %Ecto.Changeset{data: %FeatureFlag{}} - - """ - def change_feature_flag(%FeatureFlag{} = feature_flag, attrs \\ %{}) do - FeatureFlag.changeset(feature_flag, attrs) - end -end diff --git a/src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex b/src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex deleted file mode 100644 index ed68a5841a..0000000000 --- a/src/featureflagservice/lib/featureflagservice/feature_flags/feature_flag.ex +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -defmodule Featureflagservice.FeatureFlags.FeatureFlag do - use Ecto.Schema - import Ecto.Changeset - - schema "featureflags" do - field :description, :string - field :enabled, :float, default: 0.0 - field :name, :string - - timestamps() - end - - @doc false - def changeset(feature_flag, attrs) do - feature_flag - |> cast(attrs, [:name, :description, :enabled]) - |> validate_required([:name, :description, :enabled]) - |> validate_number(:enabled, greater_than_or_equal_to: 0.0, less_than_or_equal_to: 1.0) - |> unique_constraint(:name) - end -end diff --git a/src/featureflagservice/lib/featureflagservice/release.ex b/src/featureflagservice/lib/featureflagservice/release.ex deleted file mode 100644 index 0bcfdceb97..0000000000 --- a/src/featureflagservice/lib/featureflagservice/release.ex +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.Release do - @moduledoc """ - Used for executing DB release tasks when run in production without Mix - installed. - """ - @app :featureflagservice - - def migrate do - load_app() - - for repo <- repos() do - {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) - end - end - - def rollback(repo, version) do - load_app() - {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) - end - - defp repos do - Application.fetch_env!(@app, :ecto_repos) - end - - defp load_app do - Application.load(@app) - end -end diff --git a/src/featureflagservice/lib/featureflagservice/repo.ex b/src/featureflagservice/lib/featureflagservice/repo.ex deleted file mode 100644 index 0cf9c3807d..0000000000 --- a/src/featureflagservice/lib/featureflagservice/repo.ex +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.Repo do - use Ecto.Repo, - otp_app: :featureflagservice, - adapter: Ecto.Adapters.Postgres -end diff --git a/src/featureflagservice/lib/featureflagservice_web.ex b/src/featureflagservice/lib/featureflagservice_web.ex deleted file mode 100644 index 711f36e56d..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web.ex +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb do - @moduledoc """ - The entrypoint for defining your web interface, such - as controllers, views, channels and so on. - - This can be used in your application as: - - use FeatureflagserviceWeb, :controller - use FeatureflagserviceWeb, :view - - The definitions below will be executed for every view, - controller, etc, so keep them short and clean, focused - on imports, uses and aliases. - - Do NOT define functions inside the quoted expressions - below. Instead, define any helper function in modules - and import those modules here. - """ - - def controller do - quote do - use Phoenix.Controller, namespace: FeatureflagserviceWeb - - import Plug.Conn - import FeatureflagserviceWeb.Gettext - alias FeatureflagserviceWeb.Router.Helpers, as: Routes - end - end - - def view do - quote do - use Phoenix.View, - root: "lib/featureflagservice_web/templates", - namespace: FeatureflagserviceWeb - - # Import moved helpers - use Phoenix.Component - # Import convenience functions from controllers - import Phoenix.Controller, - only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1] - - # Include shared imports and aliases for views - unquote(view_helpers()) - end - end - - def live_view do - quote do - use Phoenix.LiveView, - layout: {FeatureflagserviceWeb.LayoutView, "live.html"} - - unquote(view_helpers()) - end - end - - def live_component do - quote do - use Phoenix.LiveComponent - - unquote(view_helpers()) - end - end - - def component do - quote do - use Phoenix.Component - - unquote(view_helpers()) - end - end - - def router do - quote do - use Phoenix.Router - - import Plug.Conn - import Phoenix.Controller - import Phoenix.LiveView.Router - end - end - - def channel do - quote do - use Phoenix.Channel - import FeatureflagserviceWeb.Gettext - end - end - - defp view_helpers do - quote do - # Use all HTML functionality (forms, tags, etc) - use Phoenix.HTML - - # Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc) - import Phoenix.LiveView.Helpers - - # Import basic rendering functionality (render, render_layout, etc) - import Phoenix.View - - import FeatureflagserviceWeb.ErrorHelpers - import FeatureflagserviceWeb.Gettext - alias FeatureflagserviceWeb.Router.Helpers, as: Routes - end - end - - @doc """ - When used, dispatch to the appropriate controller/view/etc. - """ - defmacro __using__(which) when is_atom(which) do - apply(__MODULE__, which, []) - end -end diff --git a/src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex b/src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex deleted file mode 100644 index 00639df0c9..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/controllers/feature_flag_controller.ex +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.FeatureFlagController do - use FeatureflagserviceWeb, :controller - - alias Featureflagservice.FeatureFlags - alias Featureflagservice.FeatureFlags.FeatureFlag - - def index(conn, _params) do - featureflags = FeatureFlags.list_feature_flags() - render(conn, "index.html", featureflags: featureflags) - end - - def new(conn, _params) do - changeset = FeatureFlags.change_feature_flag(%FeatureFlag{}) - render(conn, "new.html", changeset: changeset) - end - - def create(conn, %{"feature_flag" => feature_flag_params}) do - case FeatureFlags.create_feature_flag(feature_flag_params) do - {:ok, feature_flag} -> - conn - |> put_flash(:info, "Feature flag created successfully.") - |> redirect(to: Routes.feature_flag_path(conn, :show, feature_flag)) - - {:error, %Ecto.Changeset{} = changeset} -> - render(conn, "new.html", changeset: changeset) - end - end - - def show(conn, %{"id" => id}) do - feature_flag = FeatureFlags.get_feature_flag!(id) - render(conn, "show.html", feature_flag: feature_flag) - end - - def edit(conn, %{"id" => id}) do - feature_flag = FeatureFlags.get_feature_flag!(id) - changeset = FeatureFlags.change_feature_flag(feature_flag) - render(conn, "edit.html", feature_flag: feature_flag, changeset: changeset) - end - - def update(conn, %{"id" => id, "feature_flag" => feature_flag_params}) do - feature_flag = FeatureFlags.get_feature_flag!(id) - - case FeatureFlags.update_feature_flag(feature_flag, feature_flag_params) do - {:ok, feature_flag} -> - conn - |> put_flash(:info, "Feature flag updated successfully.") - |> redirect(to: Routes.feature_flag_path(conn, :show, feature_flag)) - - {:error, %Ecto.Changeset{} = changeset} -> - render(conn, "edit.html", feature_flag: feature_flag, changeset: changeset) - end - end - - def delete(conn, %{"id" => id}) do - feature_flag = FeatureFlags.get_feature_flag!(id) - {:ok, _feature_flag} = FeatureFlags.delete_feature_flag(feature_flag) - - conn - |> put_flash(:info, "Feature flag deleted successfully.") - |> redirect(to: Routes.feature_flag_path(conn, :index)) - end -end diff --git a/src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex b/src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex deleted file mode 100644 index fbaf4f4e95..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/controllers/page_controller.ex +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.PageController do - use FeatureflagserviceWeb, :controller - - alias Featureflagservice.FeatureFlags - - def index(conn, _params) do - featureflags = FeatureFlags.list_feature_flags() - render(conn, "index.html", featureflags: featureflags) - end -end diff --git a/src/featureflagservice/lib/featureflagservice_web/endpoint.ex b/src/featureflagservice/lib/featureflagservice_web/endpoint.ex deleted file mode 100644 index e42fce4d69..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/endpoint.ex +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.Endpoint do - use Phoenix.Endpoint, otp_app: :featureflagservice - - # The session will be stored in the cookie and signed, - # this means its contents can be read but not tampered with. - # Set :encryption_salt if you would also like to encrypt it. - @session_options [ - store: :cookie, - key: "_featureflagservice_key", - signing_salt: "B7PAq71f" - ] - - socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]] - - # Serve at "/" the static files from "priv/static" directory. - # - # You should set gzip to true if you are running phx.digest - # when deploying your static files in production. - plug Plug.Static, - at: "/", - from: :featureflagservice, - gzip: false, - only: ~w(assets fonts images favicon.ico robots.txt) - - # Code reloading can be explicitly enabled under the - # :code_reloader configuration of your endpoint. - if code_reloading? do - socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket - plug Phoenix.LiveReloader - plug Phoenix.CodeReloader - plug Phoenix.Ecto.CheckRepoStatus, otp_app: :featureflagservice - end - - plug Plug.RequestId - plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint] - - plug Plug.Parsers, - parsers: [:urlencoded, :multipart, :json], - pass: ["*/*"], - json_decoder: Phoenix.json_library() - - plug Plug.MethodOverride - plug Plug.Head - plug Plug.Session, @session_options - plug FeatureflagserviceWeb.Router -end diff --git a/src/featureflagservice/lib/featureflagservice_web/gettext.ex b/src/featureflagservice/lib/featureflagservice_web/gettext.ex deleted file mode 100644 index a28990a986..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/gettext.ex +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.Gettext do - @moduledoc """ - A module providing Internationalization with a gettext-based API. - - By using [Gettext](https://hexdocs.pm/gettext), - your module gains a set of macros for translations, for example: - - import FeatureflagserviceWeb.Gettext - - # Simple translation - gettext("Here is the string to translate") - - # Plural translation - ngettext("Here is the string to translate", - "Here are the strings to translate", - 3) - - # Domain-based translation - dgettext("errors", "Here is the error message to translate") - - See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. - """ - use Gettext, otp_app: :featureflagservice -end diff --git a/src/featureflagservice/lib/featureflagservice_web/router.ex b/src/featureflagservice/lib/featureflagservice_web/router.ex deleted file mode 100644 index 0dd814fe4e..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/router.ex +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.Router do - use FeatureflagserviceWeb, :router - - pipeline :browser do - plug :accepts, ["html"] - plug :fetch_session - plug :fetch_live_flash - plug :put_root_layout, {FeatureflagserviceWeb.LayoutView, :root} - plug :protect_from_forgery - plug :put_secure_browser_headers - end - - pipeline :api do - plug :accepts, ["json"] - end - - scope "/", FeatureflagserviceWeb do - pipe_through :browser - - get "/", PageController, :index - resources "/featureflags", FeatureFlagController - end -end diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex deleted file mode 100644 index c66d59cb2d..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/edit.html.heex +++ /dev/null @@ -1,21 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -

Edit feature flag

- -<%= render "form.html", Map.put(assigns, :action, Routes.feature_flag_path(@conn, :update, @feature_flag)) %> - -<%= link "Back", class: "button button-outline", to: Routes.feature_flag_path(@conn, :index) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex deleted file mode 100644 index 442fa4942b..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/form.html.heex +++ /dev/null @@ -1,44 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -<.form :let={f} for={@changeset} action={@action}> - <%= if @changeset.action do %> -
-

Oops, something went wrong! Please check the errors below.

-
- <% end %> - - <%= label f, :name %> - <%= text_input f, :name %> - <%= error_tag f, :name %> - - <%= label f, :description %> - <%= text_input f, :description %> - <%= error_tag f, :description %> - - <%= label f, :enabled %> - <%= number_input f, :enabled, min: 0, max: 1, step: 0.01, "aria-describedby": "enabled_help_text" %> -

- A decimal value between 0 and 1 (inclusive)
- 0.0 is always disabled
- 1.0 is always enabled
- All values between set a percentage chance on each request
- example: 0.55 is enabled 55% of the time
-

- <%= error_tag f, :enabled %> - - <%= submit "Save" %> - diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex deleted file mode 100644 index 26fa34f5e4..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/index.html.heex +++ /dev/null @@ -1,46 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -

Listing feature flags

- - - - - - - - - - - - -<%= for feature_flag <- @featureflags do %> - - - - - - - -<% end %> - -
NameDescriptionEnabled
<%= feature_flag.name %><%= feature_flag.description %><%= feature_flag.enabled %> - <%= link "Show", to: Routes.feature_flag_path(@conn, :show, feature_flag) %> - <%= link "Edit", to: Routes.feature_flag_path(@conn, :edit, feature_flag) %> - <%= link "Delete", to: Routes.feature_flag_path(@conn, :delete, feature_flag), method: :delete, data: [confirm: "Are you sure?"] %> -
- -<%= link "New Feature flag", to: Routes.feature_flag_path(@conn, :new) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex deleted file mode 100644 index df15a10836..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/new.html.heex +++ /dev/null @@ -1,21 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -

New Feature flag

- -<%= render "form.html", Map.put(assigns, :action, Routes.feature_flag_path(@conn, :create)) %> - -<%= link "Back", class: "button button-outline", to: Routes.feature_flag_path(@conn, :index) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex deleted file mode 100644 index 994436b0ae..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/feature_flag/show.html.heex +++ /dev/null @@ -1,39 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -

Show feature flag

- -
    - -
  • - Name: - <%= @feature_flag.name %> -
  • - -
  • - Description: - <%= @feature_flag.description %> -
  • - -
  • - Enabled: - <%= @feature_flag.enabled %> -
  • - -
- -<%= link "Edit", to: Routes.feature_flag_path(@conn, :edit, @feature_flag) %> | -<%= link "Back", to: Routes.feature_flag_path(@conn, :index) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex deleted file mode 100644 index 8dbaf9bfed..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/layout/app.html.heex +++ /dev/null @@ -1,21 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -
- - - <%= @inner_content %> -
diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex deleted file mode 100644 index 54e49194d8..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/layout/live.html.heex +++ /dev/null @@ -1,27 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -
- - - - - <%= @inner_content %> -
diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex deleted file mode 100644 index abbbc741ce..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/layout/root.html.heex +++ /dev/null @@ -1,46 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - - - - - - - - - <.live_title> - <%= assigns[:page_title] || "Feature flag service" %> - - - - - -
-
- - - Feature Flags - -
-
- <%= @inner_content %> - - diff --git a/src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex b/src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex deleted file mode 100644 index 6900a26c3a..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/templates/page/index.html.heex +++ /dev/null @@ -1,46 +0,0 @@ -<%!-- - Copyright The OpenTelemetry Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -

Listing Feature flags

- - - - - - - - - - - - -<%= for feature_flag <- @featureflags do %> - - - - - - - -<% end %> - -
NameDescriptionEnabled
<%= feature_flag.name %><%= feature_flag.description %><%= feature_flag.enabled %> - <%= link "Show", to: Routes.feature_flag_path(@conn, :show, feature_flag) %> - <%= link "Edit", to: Routes.feature_flag_path(@conn, :edit, feature_flag) %> - <%= link "Delete", to: Routes.feature_flag_path(@conn, :delete, feature_flag), method: :delete, data: [confirm: "Are you sure?"] %> -
- -<%= link "New Feature flag", to: Routes.feature_flag_path(@conn, :new) %> diff --git a/src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex b/src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex deleted file mode 100644 index 98aa8f3736..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/views/error_helpers.ex +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.ErrorHelpers do - @moduledoc """ - Conveniences for translating and building error messages. - """ - - use Phoenix.HTML - - @doc """ - Generates tag for inlined form input errors. - """ - def error_tag(form, field) do - Enum.map(Keyword.get_values(form.errors, field), fn error -> - content_tag(:span, translate_error(error), - class: "invalid-feedback", - phx_feedback_for: input_name(form, field) - ) - end) - end - - @doc """ - Translates an error message using gettext. - """ - def translate_error({msg, opts}) do - # When using gettext, we typically pass the strings we want - # to translate as a static argument: - # - # # Translate "is invalid" in the "errors" domain - # dgettext("errors", "is invalid") - # - # # Translate the number of files with plural rules - # dngettext("errors", "1 file", "%{count} files", count) - # - # Because the error messages we show in our forms and APIs - # are defined inside Ecto, we need to translate them dynamically. - # This requires us to call the Gettext module passing our gettext - # backend as first argument. - # - # Note we use the "errors" domain, which means translations - # should be written to the errors.po file. The :count option is - # set by Ecto and indicates we should also apply plural rules. - if count = opts[:count] do - Gettext.dngettext(FeatureflagserviceWeb.Gettext, "errors", msg, msg, count, opts) - else - Gettext.dgettext(FeatureflagserviceWeb.Gettext, "errors", msg, opts) - end - end -end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/error_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/error_view.ex deleted file mode 100644 index e49031556f..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/views/error_view.ex +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.ErrorView do - use FeatureflagserviceWeb, :view - - # If you want to customize a particular status code - # for a certain format, you may uncomment below. - # def render("500.html", _assigns) do - # "Internal Server Error" - # end - - # By default, Phoenix returns the status message from - # the template name. For example, "404.html" becomes - # "Not Found". - def template_not_found(template, _assigns) do - Phoenix.Controller.status_message_from_template(template) - end -end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex deleted file mode 100644 index ad4bb48e7e..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/views/feature_flag_view.ex +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.FeatureFlagView do - use FeatureflagserviceWeb, :view -end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex deleted file mode 100644 index 1a8a694372..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/views/layout_view.ex +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.LayoutView do - use FeatureflagserviceWeb, :view -end diff --git a/src/featureflagservice/lib/featureflagservice_web/views/page_view.ex b/src/featureflagservice/lib/featureflagservice_web/views/page_view.ex deleted file mode 100644 index d76f8c036d..0000000000 --- a/src/featureflagservice/lib/featureflagservice_web/views/page_view.ex +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.PageView do - use FeatureflagserviceWeb, :view -end diff --git a/src/featureflagservice/mix.exs b/src/featureflagservice/mix.exs deleted file mode 100644 index 83f35e6fff..0000000000 --- a/src/featureflagservice/mix.exs +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.MixProject do - use Mix.Project - - def project do - [ - app: :featureflagservice, - version: "1.4.0", - elixir: "~> 1.14", - elixirc_paths: elixirc_paths(Mix.env()), - compilers: [] ++ Mix.compilers(), - start_permanent: Mix.env() == :prod, - aliases: aliases(), - deps: deps(), - releases: [ - featureflagservice: [ - applications: [opentelemetry_exporter: :permanent, opentelemetry: :temporary] - ] - ] - ] - end - - # Configuration for the OTP application. - # - # Type `mix help compile.app` for more information. - def application do - [ - mod: {Featureflagservice.Application, []}, - extra_applications: [:logger, :runtime_tools] - ] - end - - # Specifies which paths to compile per environment. - defp elixirc_paths(:test), do: ["lib", "test/support"] - defp elixirc_paths(_), do: ["lib"] - - # Specifies your project dependencies. - # - # Type `mix help deps` for examples and options. - defp deps do - [ - {:phoenix, "~> 1.7.0"}, - {:phoenix_ecto, "~> 4.4"}, - {:ecto_sql, "~> 3.10"}, - {:postgrex, "~> 0.17.2"}, - {:phoenix_html, "~> 3.0"}, - {:phoenix_live_reload, "~> 1.2", only: :dev}, - {:phoenix_live_view, "~> 0.20.0"}, - {:phoenix_view, "~> 2.0"}, - {:floki, "~> 0.35.0", only: :test}, - {:esbuild, "~> 0.8", runtime: Mix.env() == :dev}, - {:telemetry_metrics, "~> 0.6"}, - {:telemetry_poller, "~> 1.0"}, - {:gettext, "~> 0.23"}, - {:jason, "~> 1.4"}, - {:plug_cowboy, "~> 2.6"}, - - {:grpcbox, "~> 0.16.0", override: true}, - {:opentelemetry_exporter, "~> 1.6.0"}, - {:opentelemetry_grpcbox, "~> 0.2"}, - {:opentelemetry_api, "~> 1.2.1"}, - {:opentelemetry, "~> 1.3.0"}, - {:opentelemetry_phoenix, "~> 1.1.1"}, - {:opentelemetry_ecto, "~> 1.1.1"} - ] - end - - # Aliases are shortcuts or tasks specific to the current project. - # For example, to install project dependencies and perform other setup tasks, run: - # - # $ mix setup - # - # See the documentation for `Mix` for more info on aliases. - defp aliases do - [ - setup: ["deps.get", "ecto.setup"], - "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], - "ecto.reset": ["ecto.drop", "ecto.setup"], - test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], - "assets.deploy": ["esbuild default --minify", "phx.digest"] - ] - end -end diff --git a/src/featureflagservice/mix.lock b/src/featureflagservice/mix.lock deleted file mode 100644 index 4b50f90d81..0000000000 --- a/src/featureflagservice/mix.lock +++ /dev/null @@ -1,56 +0,0 @@ -%{ - "acceptor_pool": {:hex, :acceptor_pool, "1.0.0", "43c20d2acae35f0c2bcd64f9d2bde267e459f0f3fd23dab26485bf518c281b21", [:rebar3], [], "hexpm", "0cbcd83fdc8b9ad2eee2067ef8b91a14858a5883cb7cd800e6fcd5803e158788"}, - "castore": {:hex, :castore, "1.0.4", "ff4d0fb2e6411c0479b1d965a814ea6d00e51eb2f58697446e9c41a97d940b28", [:mix], [], "hexpm", "9418c1b8144e11656f0be99943db4caf04612e3eaecefb5dae9a2a87565584f8"}, - "chatterbox": {:hex, :ts_chatterbox, "0.13.0", "6f059d97bcaa758b8ea6fffe2b3b81362bd06b639d3ea2bb088335511d691ebf", [:rebar3], [{:hpack, "~> 0.2.3", [hex: :hpack_erl, repo: "hexpm", optional: false]}], "hexpm", "b93d19104d86af0b3f2566c4cba2a57d2e06d103728246ba1ac6c3c0ff010aa7"}, - "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, - "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, - "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, - "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, - "ctx": {:hex, :ctx, "0.6.0", "8ff88b70e6400c4df90142e7f130625b82086077a45364a78d208ed3ed53c7fe", [:rebar3], [], "hexpm", "a14ed2d1b67723dbebbe423b28d7615eb0bdcba6ff28f2d1f1b0a7e1d4aa5fc2"}, - "db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"}, - "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, - "ecto": {:hex, :ecto, "3.10.1", "c6757101880e90acc6125b095853176a02da8f1afe056f91f1f90b80c9389822", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2ac4255f1601bdf7ac74c0ed971102c6829dc158719b94bd30041bbad77f87a"}, - "ecto_sql": {:hex, :ecto_sql, "3.10.1", "6ea6b3036a0b0ca94c2a02613fd9f742614b5cfe494c41af2e6571bb034dd94c", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f6a25bdbbd695f12c8171eaff0851fa4c8e72eec1e98c7364402dda9ce11c56b"}, - "esbuild": {:hex, :esbuild, "0.8.1", "0cbf919f0eccb136d2eeef0df49c4acf55336de864e63594adcea3814f3edf41", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "25fc876a67c13cb0a776e7b5d7974851556baeda2085296c14ab48555ea7560f"}, - "expo": {:hex, :expo, "0.4.1", "1c61d18a5df197dfda38861673d392e642649a9cef7694d2f97a587b2cfb319b", [:mix], [], "hexpm", "2ff7ba7a798c8c543c12550fa0e2cbc81b95d4974c65855d8d15ba7b37a1ce47"}, - "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "floki": {:hex, :floki, "0.35.2", "87f8c75ed8654b9635b311774308b2760b47e9a579dabf2e4d5f1e1d42c39e0b", [:mix], [], "hexpm", "6b05289a8e9eac475f644f09c2e4ba7e19201fd002b89c28c1293e7bd16773d9"}, - "gettext": {:hex, :gettext, "0.23.1", "821e619a240e6000db2fc16a574ef68b3bd7fe0167ccc264a81563cc93e67a31", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "19d744a36b809d810d610b57c27b934425859d158ebd56561bc41f7eeb8795db"}, - "gproc": {:hex, :gproc, "0.8.0", "cea02c578589c61e5341fce149ea36ccef236cc2ecac8691fba408e7ea77ec2f", [:rebar3], [], "hexpm", "580adafa56463b75263ef5a5df4c86af321f68694e7786cb057fd805d1e2a7de"}, - "grpcbox": {:hex, :grpcbox, "0.16.0", "b83f37c62d6eeca347b77f9b1ec7e9f62231690cdfeb3a31be07cd4002ba9c82", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.13.0", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.8.0", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "294df743ae20a7e030889f00644001370a4f7ce0121f3bbdaf13cf3169c62913"}, - "hpack": {:hex, :hpack_erl, "0.2.3", "17670f83ff984ae6cd74b1c456edde906d27ff013740ee4d9efaa4f1bf999633", [:rebar3], [], "hexpm", "06f580167c4b8b8a6429040df36cc93bba6d571faeaec1b28816523379cbb23a"}, - "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, - "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, - "nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"}, - "opentelemetry": {:hex, :opentelemetry, "1.3.0", "988ac3c26acac9720a1d4fb8d9dc52e95b45ecfec2d5b5583276a09e8936bc5e", [:rebar3], [{:opentelemetry_api, "~> 1.2.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "8e09edc26aad11161509d7ecad854a3285d88580f93b63b0b1cf0bac332bfcc0"}, - "opentelemetry_api": {:hex, :opentelemetry_api, "1.2.1", "7b69ed4f40025c005de0b74fce8c0549625d59cb4df12d15c32fe6dc5076ff42", [:mix, :rebar3], [{:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "6d7a27b7cad2ad69a09cabf6670514cafcec717c8441beb5c96322bac3d05350"}, - "opentelemetry_ecto": {:hex, :opentelemetry_ecto, "1.1.1", "218b791d2883becaf28d3fe25627b48f862ad63d4982dd0d10d307861eafa847", [:mix], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_process_propagator, "~> 0.2", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e5f4c76aa9385cefa099a88e19eba90a7a19ef82deec43e0c03c987528bdd826"}, - "opentelemetry_exporter": {:hex, :opentelemetry_exporter, "1.6.0", "f4fbf69aa9f1541b253813221b82b48a9863bc1570d8ecc517bc510c0d1d3d8c", [:rebar3], [{:grpcbox, ">= 0.0.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry, "~> 1.3", [hex: :opentelemetry, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.2", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:tls_certificate_check, "~> 1.18", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "1802d1dca297e46f21e5832ecf843c451121e875f73f04db87355a6cb2ba1710"}, - "opentelemetry_grpcbox": {:hex, :opentelemetry_grpcbox, "0.2.0", "85e546dd632274ce8552a05f433d07fecde67aada7a83f1a1e1a78a62c744608", [:rebar3], [{:grpcbox, "~> 0.14.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2.0", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "7fa6fd5fa65eed3aa88c3799aaec257c0a7754774dcf67c31dea4e20ffc5723d"}, - "opentelemetry_phoenix": {:hex, :opentelemetry_phoenix, "1.1.1", "b6ab632d39138c2cc9b6e52b65d560545904f659c42647856d669e593110521f", [:mix], [{:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_process_propagator, "~> 0.2", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}, {:opentelemetry_telemetry, "~> 1.0", [hex: :opentelemetry_telemetry, repo: "hexpm", optional: false]}, {:plug, ">= 1.11.0", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "942850ce28fe21f98d98a743b94163820ce5ba6488333a806dbd1e8161a653d8"}, - "opentelemetry_process_propagator": {:hex, :opentelemetry_process_propagator, "0.2.2", "85244a49f0c32ae1e2f3d58c477c265bd6125ee3480ade82b0fa9324b85ed3f0", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}], "hexpm", "04db13302a34bea8350a13ed9d49c22dfd32c4bc590d8aa88b6b4b7e4f346c61"}, - "opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "0.2.0", "b67fe459c2938fcab341cb0951c44860c62347c005ace1b50f8402576f241435", [:mix, :rebar3], [], "hexpm", "d61fa1f5639ee8668d74b527e6806e0503efc55a42db7b5f39939d84c07d6895"}, - "opentelemetry_telemetry": {:hex, :opentelemetry_telemetry, "1.0.0", "d5982a319e725fcd2305b306b65c18a86afdcf7d96821473cf0649ff88877615", [:mix, :rebar3], [{:opentelemetry_api, "~> 1.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_registry, "~> 0.3.0", [hex: :telemetry_registry, repo: "hexpm", optional: false]}], "hexpm", "3401d13a1d4b7aa941a77e6b3ec074f0ae77f83b5b2206766ce630123a9291a9"}, - "phoenix": {:hex, :phoenix, "1.7.10", "02189140a61b2ce85bb633a9b6fd02dff705a5f1596869547aeb2b2b95edd729", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "cf784932e010fd736d656d7fead6a584a4498efefe5b8227e9f383bf15bb79d0"}, - "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"}, - "phoenix_html": {:hex, :phoenix_html, "3.3.3", "380b8fb45912b5638d2f1d925a3771b4516b9a78587249cabe394e0a5d579dc9", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "923ebe6fec6e2e3b3e569dfbdc6560de932cd54b000ada0208b5f45024bdd76c"}, - "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"}, - "phoenix_live_view": {:hex, :phoenix_live_view, "0.20.1", "92a37acf07afca67ac98bd326532ba8f44ad7d4bdf3e4361b03f7f02594e5ae9", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "be494fd1215052729298b0e97d5c2ce8e719c00854b82cd8cf15c1cd7fcf6294"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, - "phoenix_template": {:hex, :phoenix_template, "1.0.3", "32de561eefcefa951aead30a1f94f1b5f0379bc9e340bb5c667f65f1edfa4326", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "16f4b6588a4152f3cc057b9d0c0ba7e82ee23afa65543da535313ad8d25d8e2c"}, - "phoenix_view": {:hex, :phoenix_view, "2.0.2", "6bd4d2fd595ef80d33b439ede6a19326b78f0f1d8d62b9a318e3d9c1af351098", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "a929e7230ea5c7ee0e149ffcf44ce7cf7f4b6d2bfe1752dd7c084cdff152d36f"}, - "plug": {:hex, :plug, "1.15.1", "b7efd81c1a1286f13efb3f769de343236bd8b7d23b4a9f40d3002fc39ad8f74c", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "459497bd94d041d98d948054ec6c0b76feacd28eec38b219ca04c0de13c79d30"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"}, - "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, - "postgrex": {:hex, :postgrex, "0.17.2", "a3ec9e3239d9b33f1e5841565c4eb200055c52cc0757a22b63ca2d529bbe764c", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "80a918a9e9531d39f7bd70621422f3ebc93c01618c645f2d91306f50041ed90c"}, - "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, - "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, - "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, - "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, - "telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"}, - "telemetry_registry": {:hex, :telemetry_registry, "0.3.1", "14a3319a7d9027bdbff7ebcacf1a438f5f5c903057b93aee484cca26f05bdcba", [:mix, :rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6d0ca77b691cf854ed074b459a93b87f4c7f5512f8f7743c635ca83da81f939e"}, - "tls_certificate_check": {:hex, :tls_certificate_check, "1.19.0", "c76c4c5d79ee79a2b11c84f910c825d6f024a78427c854f515748e9bd025e987", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "4083b4a298add534c96125337cb01161c358bb32dd870d5a893aae685fd91d70"}, - "websock": {:hex, :websock, "0.5.2", "b3c08511d8d79ed2c2f589ff430bd1fe799bb389686dafce86d28801783d8351", [:mix], [], "hexpm", "925f5de22fca6813dfa980fb62fd542ec43a2d1a1f83d2caec907483fe66ff05"}, - "websock_adapter": {:hex, :websock_adapter, "0.5.3", "4908718e42e4a548fc20e00e70848620a92f11f7a6add8cf0886c4232267498d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "cbe5b814c1f86b6ea002b52dd99f345aeecf1a1a6964e209d208fb404d930d3d"}, -} diff --git a/src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po b/src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po deleted file mode 100644 index 844c4f5cea..0000000000 --- a/src/featureflagservice/priv/gettext/en/LC_MESSAGES/errors.po +++ /dev/null @@ -1,112 +0,0 @@ -## `msgid`s in this file come from POT (.pot) files. -## -## Do not add, change, or remove `msgid`s manually here as -## they're tied to the ones in the corresponding POT file -## (with the same domain). -## -## Use `mix gettext.extract --merge` or `mix gettext.merge` -## to merge POT files into PO files. -msgid "" -msgstr "" -"Language: en\n" - -## From Ecto.Changeset.cast/4 -msgid "can't be blank" -msgstr "" - -## From Ecto.Changeset.unique_constraint/3 -msgid "has already been taken" -msgstr "" - -## From Ecto.Changeset.put_change/3 -msgid "is invalid" -msgstr "" - -## From Ecto.Changeset.validate_acceptance/3 -msgid "must be accepted" -msgstr "" - -## From Ecto.Changeset.validate_format/3 -msgid "has invalid format" -msgstr "" - -## From Ecto.Changeset.validate_subset/3 -msgid "has an invalid entry" -msgstr "" - -## From Ecto.Changeset.validate_exclusion/3 -msgid "is reserved" -msgstr "" - -## From Ecto.Changeset.validate_confirmation/3 -msgid "does not match confirmation" -msgstr "" - -## From Ecto.Changeset.no_assoc_constraint/3 -msgid "is still associated with this entry" -msgstr "" - -msgid "are still associated with this entry" -msgstr "" - -## From Ecto.Changeset.validate_length/3 -msgid "should have %{count} item(s)" -msgid_plural "should have %{count} item(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be %{count} character(s)" -msgid_plural "should be %{count} character(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be %{count} byte(s)" -msgid_plural "should be %{count} byte(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should have at least %{count} item(s)" -msgid_plural "should have at least %{count} item(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be at least %{count} character(s)" -msgid_plural "should be at least %{count} character(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be at least %{count} byte(s)" -msgid_plural "should be at least %{count} byte(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should have at most %{count} item(s)" -msgid_plural "should have at most %{count} item(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be at most %{count} character(s)" -msgid_plural "should be at most %{count} character(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be at most %{count} byte(s)" -msgid_plural "should be at most %{count} byte(s)" -msgstr[0] "" -msgstr[1] "" - -## From Ecto.Changeset.validate_number/3 -msgid "must be less than %{number}" -msgstr "" - -msgid "must be greater than %{number}" -msgstr "" - -msgid "must be less than or equal to %{number}" -msgstr "" - -msgid "must be greater than or equal to %{number}" -msgstr "" - -msgid "must be equal to %{number}" -msgstr "" diff --git a/src/featureflagservice/priv/gettext/errors.pot b/src/featureflagservice/priv/gettext/errors.pot deleted file mode 100644 index 39a220be35..0000000000 --- a/src/featureflagservice/priv/gettext/errors.pot +++ /dev/null @@ -1,95 +0,0 @@ -## This is a PO Template file. -## -## `msgid`s here are often extracted from source code. -## Add new translations manually only if they're dynamic -## translations that can't be statically extracted. -## -## Run `mix gettext.extract` to bring this file up to -## date. Leave `msgstr`s empty as changing them here has no -## effect: edit them in PO (`.po`) files instead. - -## From Ecto.Changeset.cast/4 -msgid "can't be blank" -msgstr "" - -## From Ecto.Changeset.unique_constraint/3 -msgid "has already been taken" -msgstr "" - -## From Ecto.Changeset.put_change/3 -msgid "is invalid" -msgstr "" - -## From Ecto.Changeset.validate_acceptance/3 -msgid "must be accepted" -msgstr "" - -## From Ecto.Changeset.validate_format/3 -msgid "has invalid format" -msgstr "" - -## From Ecto.Changeset.validate_subset/3 -msgid "has an invalid entry" -msgstr "" - -## From Ecto.Changeset.validate_exclusion/3 -msgid "is reserved" -msgstr "" - -## From Ecto.Changeset.validate_confirmation/3 -msgid "does not match confirmation" -msgstr "" - -## From Ecto.Changeset.no_assoc_constraint/3 -msgid "is still associated with this entry" -msgstr "" - -msgid "are still associated with this entry" -msgstr "" - -## From Ecto.Changeset.validate_length/3 -msgid "should be %{count} character(s)" -msgid_plural "should be %{count} character(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should have %{count} item(s)" -msgid_plural "should have %{count} item(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be at least %{count} character(s)" -msgid_plural "should be at least %{count} character(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should have at least %{count} item(s)" -msgid_plural "should have at least %{count} item(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should be at most %{count} character(s)" -msgid_plural "should be at most %{count} character(s)" -msgstr[0] "" -msgstr[1] "" - -msgid "should have at most %{count} item(s)" -msgid_plural "should have at most %{count} item(s)" -msgstr[0] "" -msgstr[1] "" - -## From Ecto.Changeset.validate_number/3 -msgid "must be less than %{number}" -msgstr "" - -msgid "must be greater than %{number}" -msgstr "" - -msgid "must be less than or equal to %{number}" -msgstr "" - -msgid "must be greater than or equal to %{number}" -msgstr "" - -msgid "must be equal to %{number}" -msgstr "" diff --git a/src/featureflagservice/priv/repo/migrations/.formatter.exs b/src/featureflagservice/priv/repo/migrations/.formatter.exs deleted file mode 100644 index 49f9151ed2..0000000000 --- a/src/featureflagservice/priv/repo/migrations/.formatter.exs +++ /dev/null @@ -1,4 +0,0 @@ -[ - import_deps: [:ecto_sql], - inputs: ["*.exs"] -] diff --git a/src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs b/src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs deleted file mode 100644 index 1fd816fbfe..0000000000 --- a/src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs +++ /dev/null @@ -1,50 +0,0 @@ -defmodule Featureflagservice.Repo.Migrations.CreateFeatureflags do - use Ecto.Migration - - def change do - create table(:featureflags) do - add :name, :string - add :description, :string - add :enabled, :float, default: 0.0, null: false - - timestamps() - end - - create unique_index(:featureflags, [:name]) - - execute(&execute_up/0, &execute_down/0) - end - - defp execute_up do - repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ - name: "productCatalogFailure", - description: "Fail product catalog service on a specific product", - enabled: 0.0 - }) - - repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ - name: "recommendationCache", - description: "Cache recommendations", - enabled: 0.0 - }) - - repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ - name: "adServiceFailure", - description: "Fail ad service requests sporadically", - enabled: 0.0 - }) - - repo().insert(%Featureflagservice.FeatureFlags.FeatureFlag{ - name: "cartServiceFailure", - description: "Fail cart service requests sporadically", - enabled: 0.0 - }) - end - - defp execute_down do - repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "productCatalogFailure"}) - repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "recommendationCache"}) - repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "adServiceFailure"}) - repo().delete(%Featureflagservice.FeatureFlags.FeatureFlag{name: "cartServiceFailure"}) - end -end diff --git a/src/featureflagservice/priv/repo/seeds.exs b/src/featureflagservice/priv/repo/seeds.exs deleted file mode 100644 index b3d1b65287..0000000000 --- a/src/featureflagservice/priv/repo/seeds.exs +++ /dev/null @@ -1,13 +0,0 @@ - - -# Script for populating the database. You can run it as: -# -# mix run priv/repo/seeds.exs -# -# Inside the script, you can read and write to any of your -# repositories directly: -# -# Featureflagservice.Repo.insert!(%Featureflagservice.SomeSchema{}) -# -# We recommend using the bang functions (`insert!`, `update!` -# and so on) as they will fail if something goes wrong. diff --git a/src/featureflagservice/priv/static/favicon.ico b/src/featureflagservice/priv/static/favicon.ico deleted file mode 100644 index 73de524aaadcf60fbe9d32881db0aa86b58b5cb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1258 zcmbtUO>fgM7{=qN=;Mz_82;lvPEdVaxv-<-&=sZLwab?3I zBP>U*&(Hv<5n@9ZQ$vhg#|u$Zmtq8BV;+W*7(?jOx-{r?#TE&$Sdq77MbdJjD5`-q zMm_z(jLv3t>5NhzK{%aG(Yudfpjd3AFdKe2U7&zdepTe>^s(@!&0X8TJ`h+-I?84Ml# diff --git a/src/featureflagservice/priv/static/images/phoenix.png b/src/featureflagservice/priv/static/images/phoenix.png deleted file mode 100644 index 9c81075f63d2151e6f40e9aa66f665749a87cc6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13900 zcmaL8WmsF?7A@RTTCBLc6?b=ccXxso4H~R1?gT4RtT+@6?yiLril%4@T7niU{_*z6 z{eIkY^CMY%XUs9jnrrU0pClu(+L}t3=w#^6o;|}(O%cy#x4LjZZH1q*$X;nePbVE4Ruj~ha0EO zKNwDso99#XvuEN`AWs{Bi@gtxt-YhOy9C{FXD=O%vz-K;k$?ubhNqmple2Q5m%Uz~ zramCh1t4NaCnZTE4ibGLaI^QZp#izMx_gU)Bn$}9dm*VB;%os*A`r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Tuzj zhE_CzlafJ^=I2x-PY=Nl5R<=t%`qL1pvH4;}21B9;( zkl_bYZ2+YII)|5v`(DLhC^8SK&@Rg;W2>Er#Wa&~W~5#GeHRr{N`OC4&x8mdeH^(Z zSo~{uE-6NJ{V*qLT*hB@@O-Qm!r>wH*J1pN8Ht>Ri`CHLtL;2>NxDqFb41bk*1z+J zhV>B-vfA2MMCt)_#) z3G~quaUUm>*(ov1gX?+|@8-u$!zgCPz9kxLJH$2OO{(l${;)=ie$@*MH+Dtp83U5!%o~k zPQ8KRJ141&WM*HM=`hd+PDS93YX&}Sllg@j-BHpM?!v8!WeV^^4DX@GQ`sea*>H?=b|NHgB}D2V9jt) zJ=prm-}$6M+ZsPel4vwOBmuhqij3Ujz<~(=Z+%`0#*Vm+M8&7Up%ajiBU{{m!_%D9 z1zJjlE#0`HNju{ds8|+m7h{Hj5#iNXfrHNd}8lmEE zQSW{7z*8sq+W$*S6LniEU?Z!#B?GdWkjUeg4$&N$;$N7gqx*-E<^6-zhv(0nSsJz2 UWxWXg`G1#+f~I_}taaG`2PLnS&Hw-a diff --git a/src/featureflagservice/priv/static/robots.txt b/src/featureflagservice/priv/static/robots.txt deleted file mode 100644 index 26e06b5f19..0000000000 --- a/src/featureflagservice/priv/static/robots.txt +++ /dev/null @@ -1,5 +0,0 @@ -# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file -# -# To ban all spiders from the entire site uncomment the next two lines: -# User-agent: * -# Disallow: / diff --git a/src/featureflagservice/rebar.config b/src/featureflagservice/rebar.config deleted file mode 100644 index 46ea726a93..0000000000 --- a/src/featureflagservice/rebar.config +++ /dev/null @@ -1,30 +0,0 @@ -% Copyright The OpenTelemetry Authors -% -% Licensed under the Apache License, Version 2.0 (the "License"); -% you may not use this file except in compliance with the License. -% You may obtain a copy of the License at -% -% http://www.apache.org/licenses/LICENSE-2.0 -% -% Unless required by applicable law or agreed to in writing, software -% distributed under the License is distributed on an "AS IS" BASIS, -% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -% See the License for the specific language governing permissions and -% limitations under the License. - -{alias, [ - {grpc_regen, [compile, {grpc, gen}, compile]} -]}. - -{erl_opts, [debug_info]}. -{deps, []}. - -{grpc, [{protos, ["proto"]}, - {service_modules, [{'oteldemo.FeatureFlagService', "ffs_service"}, - {'grpc.health.v1.Health', "grpcbox_health"}, - {'grpc.reflection.v1alpha.ServerReflection', "grpcbox_reflection"}]}, - {gpb_opts, [{descriptor, true}, - {module_name_prefix, "ffs_"}, - {module_name_suffix, "_pb"}]}]}. - -{project_plugins, [grpcbox_plugin]}. diff --git a/src/featureflagservice/rebar.lock b/src/featureflagservice/rebar.lock deleted file mode 100644 index da04d5ee31..0000000000 --- a/src/featureflagservice/rebar.lock +++ /dev/null @@ -1,31 +0,0 @@ -{"1.2.0", -[{<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0">>},1}, - {<<"chatterbox">>,{pkg,<<"ts_chatterbox">>,<<"0.12.0">>},1}, - {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},1}, - {<<"gproc">>,{pkg,<<"gproc">>,<<"0.8.0">>},1}, - {<<"grpcbox">>,{pkg,<<"grpcbox">>,<<"0.15.0">>},0}, - {<<"hpack">>,{pkg,<<"hpack_erl">>,<<"0.2.3">>},2}, - {<<"opentelemetry_api">>,{pkg,<<"opentelemetry_api">>,<<"1.0.3">>},0}, - {<<"opentelemetry_grpcbox">>, - {pkg,<<"opentelemetry_grpcbox">>,<<"0.1.0">>}, - 0}]}. -[ -{pkg_hash,[ - {<<"acceptor_pool">>, <<"43C20D2ACAE35F0C2BCD64F9D2BDE267E459F0F3FD23DAB26485BF518C281B21">>}, - {<<"chatterbox">>, <<"4E54F199E15C0320B85372A24E35554A2CCFC4342E0B7CD8DAED9A04F9B8EF4A">>}, - {<<"ctx">>, <<"8FF88B70E6400C4DF90142E7F130625B82086077A45364A78D208ED3ED53C7FE">>}, - {<<"gproc">>, <<"CEA02C578589C61E5341FCE149EA36CCEF236CC2ECAC8691FBA408E7EA77EC2F">>}, - {<<"grpcbox">>, <<"97C7126296A091602D372EBF5860A04F7BC795B45B33A984CAD2B8E362774FD8">>}, - {<<"hpack">>, <<"17670F83FF984AE6CD74B1C456EDDE906D27FF013740EE4D9EFAA4F1BF999633">>}, - {<<"opentelemetry_api">>, <<"77F9644C42340CD8B18C728CDE4822ED55AE136F0D07761B78E8C54DA46AF93A">>}, - {<<"opentelemetry_grpcbox">>, <<"2106E5C1DBCE433537529DF809D773BB6CC243E55ADD8BF6F596F218A63E26DB">>}]}, -{pkg_hash_ext,[ - {<<"acceptor_pool">>, <<"0CBCD83FDC8B9AD2EEE2067EF8B91A14858A5883CB7CD800E6FCD5803E158788">>}, - {<<"chatterbox">>, <<"6478C161BC60244F41CD5847CC3ACCD26D997883E9F7FACD36FF24533B2FA579">>}, - {<<"ctx">>, <<"A14ED2D1B67723DBEBBE423B28D7615EB0BDCBA6FF28F2D1F1B0A7E1D4AA5FC2">>}, - {<<"gproc">>, <<"580ADAFA56463B75263EF5A5DF4C86AF321F68694E7786CB057FD805D1E2A7DE">>}, - {<<"grpcbox">>, <<"161ABE9E17E7D1982EFA6488ADEAA13C3E847A07984A6E6B224E553368918647">>}, - {<<"hpack">>, <<"06F580167C4B8B8A6429040DF36CC93BBA6D571FAEAEC1B28816523379CBB23A">>}, - {<<"opentelemetry_api">>, <<"4293E06BD369BC004E6FAD5EDBB56456D891F14BD3F9F1772B18F1923E0678EA">>}, - {<<"opentelemetry_grpcbox">>, <<"4D54C9376A8EC79ED71A654633E25470C545A1789AB46A589B6562699C677B54">>}]} -]. diff --git a/src/featureflagservice/src/featureflagservice.app.src b/src/featureflagservice/src/featureflagservice.app.src deleted file mode 100644 index 4cda7ee446..0000000000 --- a/src/featureflagservice/src/featureflagservice.app.src +++ /dev/null @@ -1,28 +0,0 @@ -% Copyright The OpenTelemetry Authors -% -% Licensed under the Apache License, Version 2.0 (the "License"); -% you may not use this file except in compliance with the License. -% You may obtain a copy of the License at -% -% http://www.apache.org/licenses/LICENSE-2.0 -% -% Unless required by applicable law or agreed to in writing, software -% distributed under the License is distributed on an "AS IS" BASIS, -% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -% See the License for the specific language governing permissions and -% limitations under the License. - -{application, featureflagservice, - [{description, "this is here just so rebar3 will build the necessary grpc code"}, - {vsn, "notused"}, - {registered, []}, - {applications, - [kernel, - stdlib - ]}, - {env,[]}, - {modules, []}, - - {licenses, ["Apache 2.0"]}, - {links, []} - ]}. diff --git a/src/featureflagservice/src/ffs_service.erl b/src/featureflagservice/src/ffs_service.erl deleted file mode 100644 index bab2e38d2b..0000000000 --- a/src/featureflagservice/src/ffs_service.erl +++ /dev/null @@ -1,80 +0,0 @@ -% Copyright The OpenTelemetry Authors -% -% Licensed under the Apache License, Version 2.0 (the "License"); -% you may not use this file except in compliance with the License. -% You may obtain a copy of the License at -% -% http://www.apache.org/licenses/LICENSE-2.0 -% -% Unless required by applicable law or agreed to in writing, software -% distributed under the License is distributed on an "AS IS" BASIS, -% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -% See the License for the specific language governing permissions and -% limitations under the License. - --module(ffs_service). - --behaviour(ffs_service_bhvr). - --export([get_flag/2, - create_flag/2, - update_flag/2, - list_flags/2, - delete_flag/2]). - --include_lib("grpcbox/include/grpcbox.hrl"). - --include_lib("opentelemetry_api/include/otel_tracer.hrl"). - --spec get_flag(ctx:t(), ffs_demo_pb:get_flag_request()) -> - {ok, ffs_demo_pb:get_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). -get_flag(Ctx, #{name := Name}) -> - case 'Elixir.Featureflagservice.FeatureFlags':get_feature_flag_by_name(Name) of - nil -> - {grpc_error, {?GRPC_STATUS_NOT_FOUND, <<"the requested feature flag does not exist">>}}; - #{'__struct__' := 'Elixir.Featureflagservice.FeatureFlags.FeatureFlag', - description := Description, - enabled := Enabled, - inserted_at := CreatedAt, - updated_at := UpdatedAt - } -> - RandomNumber = rand:uniform(100), % Generate a random number between 0 and 100 - Probability = trunc(Enabled * 100), % Convert the Enabled value to a percentage - FlagEnabledValue = RandomNumber =< Probability, % Determine if the random number falls within the probability range - - ?set_attribute('app.featureflag.name', Name), - ?set_attribute('app.featureflag.raw_value', Enabled), - ?set_attribute('app.featureflag.enabled', FlagEnabledValue), - - {ok, Epoch} = 'Elixir.NaiveDateTime':from_erl({{1970, 1, 1}, {0, 0, 0}}), - CreatedAtSeconds = 'Elixir.NaiveDateTime':diff(CreatedAt, Epoch), - UpdatedAtSeconds = 'Elixir.NaiveDateTime':diff(UpdatedAt, Epoch), - - Flag = #{name => Name, - description => Description, - enabled => FlagEnabledValue, - created_at => #{seconds => CreatedAtSeconds, nanos => 0}, - updated_at => #{seconds => UpdatedAtSeconds, nanos => 0}}, - - {ok, #{flag => Flag}, Ctx} - end. - --spec create_flag(ctx:t(), ffs_demo_pb:create_flag_request()) -> - {ok, ffs_demo_pb:create_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). -create_flag(_Ctx, _) -> - {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to create flags.">>}}. - --spec update_flag(ctx:t(), ffs_demo_pb:update_flag_request()) -> - {ok, ffs_demo_pb:update_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). -update_flag(_Ctx, _) -> - {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to update flags.">>}}. - --spec list_flags(ctx:t(), ffs_demo_pb:list_flags_request()) -> - {ok, ffs_demo_pb:list_flags_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). -list_flags(_Ctx, _) -> - {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to view all flags.">>}}. - --spec delete_flag(ctx:t(), ffs_demo_pb:delete_flag_request()) -> - {ok, ffs_demo_pb:delete_flag_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). -delete_flag(_Ctx, _) -> - {grpc_error, {?GRPC_STATUS_UNIMPLEMENTED, <<"use the web interface to delete flags.">>}}. diff --git a/src/featureflagservice/test/featureflagservice/feature_flags_test.exs b/src/featureflagservice/test/featureflagservice/feature_flags_test.exs deleted file mode 100644 index c3020f3d5c..0000000000 --- a/src/featureflagservice/test/featureflagservice/feature_flags_test.exs +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.FeatureFlagsTest do - use Featureflagservice.DataCase - - alias Featureflagservice.FeatureFlags - - describe "featureflags" do - alias Featureflagservice.FeatureFlags.FeatureFlag - - import Featureflagservice.FeatureFlagsFixtures - - @invalid_attrs %{description: nil, enabled: nil, name: nil} - - test "list_feature_flags/0 returns all featureflags" do - feature_flag = feature_flag_fixture() - assert FeatureFlags.list_feature_flags() == [feature_flag] - end - - test "get_feature_flag!/1 returns the feature_flag with given id" do - feature_flag = feature_flag_fixture() - assert FeatureFlags.get_feature_flag!(feature_flag.id) == feature_flag - end - - test "create_feature_flag/1 with valid data creates a feature_flag" do - valid_attrs = %{description: "some description", enabled: true, name: "some name"} - - assert {:ok, %FeatureFlag{} = feature_flag} = FeatureFlags.create_feature_flag(valid_attrs) - assert feature_flag.description == "some description" - assert feature_flag.enabled == true - assert feature_flag.name == "some name" - end - - test "create_feature_flag/1 with invalid data returns error changeset" do - assert {:error, %Ecto.Changeset{}} = FeatureFlags.create_feature_flag(@invalid_attrs) - end - - test "update_feature_flag/2 with valid data updates the feature_flag" do - feature_flag = feature_flag_fixture() - - update_attrs = %{ - description: "some updated description", - enabled: false, - name: "some updated name" - } - - assert {:ok, %FeatureFlag{} = feature_flag} = - FeatureFlags.update_feature_flag(feature_flag, update_attrs) - - assert feature_flag.description == "some updated description" - assert feature_flag.enabled == false - assert feature_flag.name == "some updated name" - end - - test "update_feature_flag/2 with invalid data returns error changeset" do - feature_flag = feature_flag_fixture() - - assert {:error, %Ecto.Changeset{}} = - FeatureFlags.update_feature_flag(feature_flag, @invalid_attrs) - - assert feature_flag == FeatureFlags.get_feature_flag!(feature_flag.id) - end - - test "delete_feature_flag/1 deletes the feature_flag" do - feature_flag = feature_flag_fixture() - assert {:ok, %FeatureFlag{}} = FeatureFlags.delete_feature_flag(feature_flag) - assert_raise Ecto.NoResultsError, fn -> FeatureFlags.get_feature_flag!(feature_flag.id) end - end - - test "change_feature_flag/1 returns a feature_flag changeset" do - feature_flag = feature_flag_fixture() - assert %Ecto.Changeset{} = FeatureFlags.change_feature_flag(feature_flag) - end - end -end diff --git a/src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs b/src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs deleted file mode 100644 index 1836bf5bac..0000000000 --- a/src/featureflagservice/test/featureflagservice_web/controllers/feature_flag_controller_test.exs +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.FeatureFlagControllerTest do - use FeatureflagserviceWeb.ConnCase - - import Featureflagservice.FeatureFlagsFixtures - - @create_attrs %{description: "some description", enabled: true, name: "some name"} - @update_attrs %{ - description: "some updated description", - enabled: false, - name: "some updated name" - } - @invalid_attrs %{description: nil, enabled: nil, name: nil} - - describe "index" do - test "lists all featureflags", %{conn: conn} do - conn = get(conn, Routes.feature_flag_path(conn, :index)) - assert html_response(conn, 200) =~ "Listing feature flags" - end - end - - describe "new feature_flag" do - test "renders form", %{conn: conn} do - conn = get(conn, Routes.feature_flag_path(conn, :new)) - assert html_response(conn, 200) =~ "New Feature flag" - end - end - - describe "create feature_flag" do - test "redirects to show when data is valid", %{conn: conn} do - conn = post(conn, Routes.feature_flag_path(conn, :create), feature_flag: @create_attrs) - - assert %{id: id} = redirected_params(conn) - assert redirected_to(conn) == Routes.feature_flag_path(conn, :show, id) - - conn = get(conn, Routes.feature_flag_path(conn, :show, id)) - assert html_response(conn, 200) =~ "Show feature flag" - end - - test "renders errors when data is invalid", %{conn: conn} do - conn = post(conn, Routes.feature_flag_path(conn, :create), feature_flag: @invalid_attrs) - assert html_response(conn, 200) =~ "New feature flag" - end - end - - describe "edit feature_flag" do - setup [:create_feature_flag] - - test "renders form for editing chosen feature_flag", %{conn: conn, feature_flag: feature_flag} do - conn = get(conn, Routes.feature_flag_path(conn, :edit, feature_flag)) - assert html_response(conn, 200) =~ "Edit feature flag" - end - end - - describe "update feature_flag" do - setup [:create_feature_flag] - - test "redirects when data is valid", %{conn: conn, feature_flag: feature_flag} do - conn = - put(conn, Routes.feature_flag_path(conn, :update, feature_flag), - feature_flag: @update_attrs - ) - - assert redirected_to(conn) == Routes.feature_flag_path(conn, :show, feature_flag) - - conn = get(conn, Routes.feature_flag_path(conn, :show, feature_flag)) - assert html_response(conn, 200) =~ "some updated description" - end - - test "renders errors when data is invalid", %{conn: conn, feature_flag: feature_flag} do - conn = - put(conn, Routes.feature_flag_path(conn, :update, feature_flag), - feature_flag: @invalid_attrs - ) - - assert html_response(conn, 200) =~ "Edit feature flag" - end - end - - describe "delete feature_flag" do - setup [:create_feature_flag] - - test "deletes chosen feature_flag", %{conn: conn, feature_flag: feature_flag} do - conn = delete(conn, Routes.feature_flag_path(conn, :delete, feature_flag)) - assert redirected_to(conn) == Routes.feature_flag_path(conn, :index) - - assert_error_sent 404, fn -> - get(conn, Routes.feature_flag_path(conn, :show, feature_flag)) - end - end - end - - defp create_feature_flag(_) do - feature_flag = feature_flag_fixture() - %{feature_flag: feature_flag} - end -end diff --git a/src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs b/src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs deleted file mode 100644 index bc05307d02..0000000000 --- a/src/featureflagservice/test/featureflagservice_web/controllers/page_controller_test.exs +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.PageControllerTest do - use FeatureflagserviceWeb.ConnCase - - test "GET /", %{conn: conn} do - _conn = get(conn, "/") - assert true - end -end diff --git a/src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs b/src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs deleted file mode 100644 index 9711b9ac32..0000000000 --- a/src/featureflagservice/test/featureflagservice_web/views/error_view_test.exs +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.ErrorViewTest do - use FeatureflagserviceWeb.ConnCase, async: true - - # Bring render/3 and render_to_string/3 for testing custom views - import Phoenix.View - - test "renders 404.html" do - assert render_to_string(FeatureflagserviceWeb.ErrorView, "404.html", []) == "Not Found" - end - - test "renders 500.html" do - assert render_to_string(FeatureflagserviceWeb.ErrorView, "500.html", []) == - "Internal Server Error" - end -end diff --git a/src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs b/src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs deleted file mode 100644 index 641f4ac86b..0000000000 --- a/src/featureflagservice/test/featureflagservice_web/views/layout_view_test.exs +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.LayoutViewTest do - use FeatureflagserviceWeb.ConnCase, async: true - - # When testing helpers, you may want to import Phoenix.HTML and - # use functions such as safe_to_string() to convert the helper - # result into an HTML string. - # import Phoenix.HTML -end diff --git a/src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs b/src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs deleted file mode 100644 index 48707ef49a..0000000000 --- a/src/featureflagservice/test/featureflagservice_web/views/page_view_test.exs +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.PageViewTest do - use FeatureflagserviceWeb.ConnCase, async: true -end diff --git a/src/featureflagservice/test/support/conn_case.ex b/src/featureflagservice/test/support/conn_case.ex deleted file mode 100644 index ffc8384fdf..0000000000 --- a/src/featureflagservice/test/support/conn_case.ex +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule FeatureflagserviceWeb.ConnCase do - @moduledoc """ - This module defines the test case to be used by - tests that require setting up a connection. - - Such tests rely on `Phoenix.ConnTest` and also - import other functionality to make it easier - to build common data structures and query the data layer. - - Finally, if the test case interacts with the database, - we enable the SQL sandbox, so changes done to the database - are reverted at the end of every test. If you are using - PostgreSQL, you can even run database tests asynchronously - by setting `use FeatureflagserviceWeb.ConnCase, async: true`, although - this option is not recommended for other databases. - """ - - use ExUnit.CaseTemplate - - using do - quote do - # Import conveniences for testing with connections - import Plug.Conn - import Phoenix.ConnTest - import FeatureflagserviceWeb.ConnCase - - alias FeatureflagserviceWeb.Router.Helpers, as: Routes - - # The default endpoint for testing - @endpoint FeatureflagserviceWeb.Endpoint - end - end - - setup tags do - Featureflagservice.DataCase.setup_sandbox(tags) - {:ok, conn: Phoenix.ConnTest.build_conn()} - end -end diff --git a/src/featureflagservice/test/support/data_case.ex b/src/featureflagservice/test/support/data_case.ex deleted file mode 100644 index f908052f06..0000000000 --- a/src/featureflagservice/test/support/data_case.ex +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.DataCase do - @moduledoc """ - This module defines the setup for tests requiring - access to the application's data layer. - - You may define functions here to be used as helpers in - your tests. - - Finally, if the test case interacts with the database, - we enable the SQL sandbox, so changes done to the database - are reverted at the end of every test. If you are using - PostgreSQL, you can even run database tests asynchronously - by setting `use Featureflagservice.DataCase, async: true`, although - this option is not recommended for other databases. - """ - - use ExUnit.CaseTemplate - - using do - quote do - alias Featureflagservice.Repo - - import Ecto - import Ecto.Changeset - import Ecto.Query - import Featureflagservice.DataCase - end - end - - setup tags do - Featureflagservice.DataCase.setup_sandbox(tags) - :ok - end - - @doc """ - Sets up the sandbox based on the test tags. - """ - def setup_sandbox(tags) do - pid = - Ecto.Adapters.SQL.Sandbox.start_owner!(Featureflagservice.Repo, shared: not tags[:async]) - - on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end) - end - - @doc """ - A helper that transforms changeset errors into a map of messages. - - assert {:error, changeset} = Accounts.create_user(%{password: "short"}) - assert "password is too short" in errors_on(changeset).password - assert %{password: ["password is too short"]} = errors_on(changeset) - - """ - def errors_on(changeset) do - Ecto.Changeset.traverse_errors(changeset, fn {message, opts} -> - Regex.replace(~r"%{(\w+)}", message, fn _, key -> - opts |> Keyword.get(String.to_existing_atom(key), key) |> to_string() - end) - end) - end -end diff --git a/src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex b/src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex deleted file mode 100644 index 58b77becb3..0000000000 --- a/src/featureflagservice/test/support/fixtures/feature_flags_fixtures.ex +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -defmodule Featureflagservice.FeatureFlagsFixtures do - @moduledoc """ - This module defines test helpers for creating - entities via the `Featureflagservice.FeatureFlags` context. - """ - - @doc """ - Generate a unique feature_flag name. - """ - def unique_feature_flag_name, do: "some name#{System.unique_integer([:positive])}" - - @doc """ - Generate a feature_flag. - """ - def feature_flag_fixture(attrs \\ %{}) do - {:ok, feature_flag} = - attrs - |> Enum.into(%{ - description: "some description", - enabled: true, - name: unique_feature_flag_name() - }) - |> Featureflagservice.FeatureFlags.create_feature_flag() - - feature_flag - end -end diff --git a/src/featureflagservice/test/test_helper.exs b/src/featureflagservice/test/test_helper.exs deleted file mode 100644 index 83251b0055..0000000000 --- a/src/featureflagservice/test/test_helper.exs +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - - -ExUnit.start() -Ecto.Adapters.SQL.Sandbox.mode(Featureflagservice.Repo, :manual)