Skip to content

Commit

Permalink
Removes feature flags (#790)
Browse files Browse the repository at this point in the history
## Ticket

Relates to #781

Closes #791

## Changes

- removes evidently from the infrastructure layer
- removes evidently from the application layer

## Testing

navapbc/platform-test#142
  • Loading branch information
coilysiren authored Nov 27, 2024
1 parent b11d951 commit 94b4dd0
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 164 deletions.
8 changes: 3 additions & 5 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Pin to Alpine 3.19 since aws-cli was removed in Alpine 3.20
# see https://github.com/alpinelinux/docker-alpine/issues/396
# https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.20.0#aws-cli
FROM python:3-alpine3.19 as release
FROM python:3-alpine as release

RUN adduser --system --disabled-password --no-create-home app

WORKDIR /app

RUN apk --no-cache add \
RUN apk update && \
apk --no-cache add \
aws-cli~=2 \
postgresql14-client~=14

Expand Down
9 changes: 0 additions & 9 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import storage
from db import get_db_connection
from feature_flags import is_feature_enabled

logging.basicConfig()
logger = logging.getLogger()
Expand Down Expand Up @@ -50,14 +49,6 @@ def migrations():
return f"Last migration on {last_migration_date}"


@app.route("/feature-flags")
def feature_flags():
foo_status = "enabled" if is_feature_enabled("foo") else "disabled"
bar_status = "enabled" if is_feature_enabled("bar") else "disabled"

return f"<p>Feature foo is {foo_status}</p><p>Feature bar is {bar_status}</p>"


@app.route("/document-upload")
def document_upload():
path = f"uploads/{datetime.now().date()}/${{filename}}"
Expand Down
20 changes: 0 additions & 20 deletions app/feature_flags.py

This file was deleted.

3 changes: 0 additions & 3 deletions infra/app/app-config/feature_flags.tf

This file was deleted.

4 changes: 0 additions & 4 deletions infra/app/app-config/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ output "environments" {
value = local.environments
}

output "feature_flags" {
value = local.feature_flags
}

output "has_database" {
value = local.has_database
}
Expand Down
12 changes: 2 additions & 10 deletions infra/app/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ module "service" {

extra_environment_variables = merge(
{
FEATURE_FLAGS_PROJECT = module.feature_flags.evidently_project_name
BUCKET_NAME = local.storage_config.bucket_name
BUCKET_NAME = local.storage_config.bucket_name
},
local.identity_provider_environment_variables,
local.service_config.extra_environment_variables
Expand All @@ -199,8 +198,7 @@ module "service" {

extra_policies = merge(
{
feature_flags_access = module.feature_flags.access_policy_arn,
storage_access = module.storage.access_policy_arn
storage_access = module.storage.access_policy_arn
},
module.app_config.enable_identity_provider ? {
identity_provider_access = module.identity_provider_client[0].access_policy_arn,
Expand All @@ -221,12 +219,6 @@ module "monitoring" {
incident_management_service_integration_url = module.app_config.has_incident_management_service && !local.is_temporary ? data.aws_ssm_parameter.incident_management_service_integration_url[0].value : null
}

module "feature_flags" {
source = "../../modules/feature-flags"
service_name = local.service_config.service_name
feature_flags = module.app_config.feature_flags
}

module "storage" {
source = "../../modules/storage"
name = local.storage_config.bucket_name
Expand Down
21 changes: 0 additions & 21 deletions infra/modules/feature-flags/access_policy.tf

This file was deleted.

21 changes: 0 additions & 21 deletions infra/modules/feature-flags/logs.tf

This file was deleted.

46 changes: 0 additions & 46 deletions infra/modules/feature-flags/main.tf

This file was deleted.

9 changes: 0 additions & 9 deletions infra/modules/feature-flags/outputs.tf

This file was deleted.

9 changes: 0 additions & 9 deletions infra/modules/feature-flags/variables.tf

This file was deleted.

1 change: 0 additions & 1 deletion infra/project-config/aws_services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ locals {
"elasticbeanstalk",
"elasticloadbalancing",
"events",
"evidently",
"iam",
"kms",
"lambda",
Expand Down
6 changes: 0 additions & 6 deletions template-only-test/template_infra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,6 @@ func ValidateDevEnvironment(t *testing.T) {
return responseStatus == 200
})

// Hit feature flags endpoint to make sure Evidently integration is working
featureFlagsEndpoint := fmt.Sprintf("%s/feature-flags", serviceEndpoint)
http_helper.HttpGetWithRetryWithCustomValidation(t, featureFlagsEndpoint, nil, 10, 3*time.Second, func(responseStatus int, responseBody string) bool {
return responseStatus == 200
})

fmt.Println("::endgroup::")
}

Expand Down

0 comments on commit 94b4dd0

Please sign in to comment.