From 1dae75ef36f2cb34f1357875eddc8432de1b917e Mon Sep 17 00:00:00 2001 From: Kenneth Lee Date: Wed, 14 Sep 2022 12:57:22 +0100 Subject: [PATCH] dfe-analytics v1.4, suppress dfe-analytics in CI, testing and review apps update blocklist --- .env.test | 2 + Dockerfile | 1 + Gemfile | 2 +- Gemfile.lock | 6 +-- azure/terraform/main.tf | 2 + .../terraform/modules/app_service/variable.tf | 6 +++ .../modules/container/container_group.tf | 2 + azure/terraform/modules/container/variable.tf | 5 +++ azure/terraform/variable.tf | 6 +++ .../workspace_variables/review.tfvars.json | 3 +- config/analytics.yml | 38 +------------------ config/analytics_blocklist.yml | 38 ++++++++++++++++++- 12 files changed, 68 insertions(+), 43 deletions(-) diff --git a/.env.test b/.env.test index 98c6db50ce..ddc278c3f0 100644 --- a/.env.test +++ b/.env.test @@ -22,3 +22,5 @@ RAILS_ENV=test ORDNANCE_SURVEY_API_BASE_URL=https://api.os.uk ORDNANCE_SURVEY_CLIENT_PARAMS={"key": "api-key-value"} STORAGE_BUCKET=test-bucket-name + +SUPPRESS_DFE_ANALYTICS_INIT=true diff --git a/Dockerfile b/Dockerfile index dd552b6ea7..2276306d66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -153,6 +153,7 @@ RUN if [ ${RAILS_ENV} = "production" ]; then \ DQT_CLIENT_PARAMS= \ ADMIN_ALLOWED_IPS= \ ENVIRONMENT_NAME= \ + SUPPRESS_DFE_ANALYTICS_INIT= \ bundle exec rake assets:precompile; \ fi EXPOSE 3000 diff --git a/Gemfile b/Gemfile index 46be7ba6bd..db1d644b33 100644 --- a/Gemfile +++ b/Gemfile @@ -127,4 +127,4 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] -gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.3.2" +gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.4.0" diff --git a/Gemfile.lock b/Gemfile.lock index e46233f9dd..5821caf5fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,9 @@ GIT remote: https://github.com/DFE-Digital/dfe-analytics.git - revision: 6dc16420e0b5c6b2b722887589b0bc2212798802 - tag: v1.3.2 + revision: 6e355be3bd65890887e2cdbc0588ff2a00a892e5 + tag: v1.4.0 specs: - dfe-analytics (1.3.2) + dfe-analytics (1.4.0) google-cloud-bigquery (~> 1.38) request_store_rails (~> 2) diff --git a/azure/terraform/main.tf b/azure/terraform/main.tf index 5033948da1..7476d8786c 100644 --- a/azure/terraform/main.tf +++ b/azure/terraform/main.tf @@ -17,6 +17,7 @@ module "container" { environment = var.environment canonical_hostname = var.canonical_hostname bypass_dfe_sign_in = var.bypass_dfe_sign_in + suppress_dfe_analytics_init = var.suppress_dfe_analytics_init } module "app_service" { @@ -39,4 +40,5 @@ module "app_service" { canonical_hostname = var.canonical_hostname bypass_dfe_sign_in = var.bypass_dfe_sign_in pr_number = var.pr_number + suppress_dfe_analytics_init = var.suppress_dfe_analytics_init } diff --git a/azure/terraform/modules/app_service/variable.tf b/azure/terraform/modules/app_service/variable.tf index 5861b379d6..a69963497a 100644 --- a/azure/terraform/modules/app_service/variable.tf +++ b/azure/terraform/modules/app_service/variable.tf @@ -54,6 +54,12 @@ variable "pr_number" { description = "Pull Request Number for Review App" } +variable "suppress_dfe_analytics_init" { + type = string + description = "Stop DfE-analytics from booting" + default = null +} + locals { stash_port = var.rg_prefix == "s118p01" ? "23888" : "17000" diff --git a/azure/terraform/modules/container/container_group.tf b/azure/terraform/modules/container/container_group.tf index bfb7998c8b..2ea0b9364f 100644 --- a/azure/terraform/modules/container/container_group.tf +++ b/azure/terraform/modules/container/container_group.tf @@ -62,6 +62,7 @@ resource "azurerm_container_group" "cont_grp_01" { "STORAGE_CREDENTIALS" = data.azurerm_key_vault_secret.StorageCredentials.value "WORKER_COUNT" = "4" "BYPASS_DFE_SIGN_IN" = var.bypass_dfe_sign_in + "SUPPRESS_DFE_ANALYTICS_INIT" = var.suppress_dfe_analytics_init } ports { @@ -140,6 +141,7 @@ resource "azurerm_container_group" "cont_grp_02" { "STORAGE_CREDENTIALS" = data.azurerm_key_vault_secret.StorageCredentials.value "WORKER_COUNT" = "4" "BYPASS_DFE_SIGN_IN" = var.bypass_dfe_sign_in + "SUPPRESS_DFE_ANALYTICS_INIT" = var.suppress_dfe_analytics_init } name = local.cont_02_name diff --git a/azure/terraform/modules/container/variable.tf b/azure/terraform/modules/container/variable.tf index bc4749b494..22fa4ab72c 100644 --- a/azure/terraform/modules/container/variable.tf +++ b/azure/terraform/modules/container/variable.tf @@ -48,6 +48,11 @@ variable "bypass_dfe_sign_in" { type = bool description = "Bypass DFE Sign-In authentication and use a default role" } +variable "suppress_dfe_analytics_init" { + type = string + description = "Stop DfE-analytics from booting" + default = null +} locals { stash_port = var.rg_prefix == "s118p01" ? "23888" : "17000" diff --git a/azure/terraform/variable.tf b/azure/terraform/variable.tf index ec4e4b75ac..2f0ba25d94 100644 --- a/azure/terraform/variable.tf +++ b/azure/terraform/variable.tf @@ -43,6 +43,12 @@ variable "pr_number" { default = null } +variable "suppress_dfe_analytics_init" { + type = string + description = "Stop DfE-analytics from booting" + default = null +} + locals { app_name = var.pr_number == null ? null : "pr-${var.pr_number}" db_name = local.app_name == null ? var.environment : "${var.environment}-${local.app_name}" diff --git a/azure/terraform/workspace_variables/review.tfvars.json b/azure/terraform/workspace_variables/review.tfvars.json index 4937b4452b..e3b7d97efd 100644 --- a/azure/terraform/workspace_variables/review.tfvars.json +++ b/azure/terraform/workspace_variables/review.tfvars.json @@ -3,5 +3,6 @@ "environment": "review", "env_tag": "Dev", "create_database": true, - "bypass_dfe_sign_in": true + "bypass_dfe_sign_in": true, + "suppress_dfe_analytics_init": true } diff --git a/config/analytics.yml b/config/analytics.yml index e748924cd6..ea8f1ebda0 100644 --- a/config/analytics.yml +++ b/config/analytics.yml @@ -1,19 +1,5 @@ --- shared: - :delayed_jobs: - - id - - priority - - attempts - - handler - - last_error - - run_at - - locked_at - - failed_at - - locked_by - - queue - - created_at - - updated_at - - cron :policy_configurations: - id - open_for_submissions @@ -105,28 +91,6 @@ shared: - date_of_birth_day - date_of_birth_month - date_of_birth_year - :claim_decisions: - - application_id - - decision_date - - trn - - application_decision - - application_policy - - subject - - school_name - - local_authorities_name - - local_authority_district_name - - claimant_age - - claimant_gender - - claimant_year_qualified - :claim_stats: - - claim_id - - policy - - claim_started_at - - claim_submitted_at - - decision_made_at - - result - - submission_length - - decision_length :decisions: - id - result @@ -283,7 +247,7 @@ shared: - created_by_id - created_at - updated_at - :tps_data: + :teachers_pensions_service: - id - teacher_reference_number - start_date diff --git a/config/analytics_blocklist.yml b/config/analytics_blocklist.yml index 3a42532a18..d4bebab563 100644 --- a/config/analytics_blocklist.yml +++ b/config/analytics_blocklist.yml @@ -1,2 +1,38 @@ --- -shared: {} +shared: + :delayed_jobs: + - id + - priority + - attempts + - handler + - last_error + - run_at + - locked_at + - failed_at + - locked_by + - queue + - created_at + - updated_at + - cron + :claim_decisions: + - application_id + - decision_date + - trn + - application_decision + - application_policy + - subject + - school_name + - local_authorities_name + - local_authority_district_name + - claimant_age + - claimant_gender + - claimant_year_qualified + :claim_stats: + - claim_id + - policy + - claim_started_at + - claim_submitted_at + - decision_made_at + - result + - submission_length + - decision_length