Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dfe-analytics configuration files #232

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ AZURE_CLIENT_SECRET=
AZURE_TENANT_ID=
REDIS_URL=redis://localhost:6379
LOCAL_USER_EMAIL=
BIGQUERY_TABLE_NAME=events
BIGQUERY_PROJECT_ID=your-bigquery-project-name
BIGQUERY_DATASET=your-bigquery-dataset-name
BIGQUERY_API_JSON_KEY=<contents of the JSON, make sure to strip or escape newlines>
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apk add --update --no-cache tzdata && \
COPY .tool-versions Gemfile Gemfile.lock ./

RUN apk add --update --no-cache --virtual build-dependances \
postgresql-dev build-base && \
postgresql-dev build-base git && \
apk add --update --no-cache libpq yarn && \
bundle install --jobs=4 && \
rm -rf /usr/local/bundle/cache && \
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ gem "concurrent-ruby", require: "concurrent"
gem "concurrent-ruby-ext"
gem "config", "~> 5.0"
gem "devise", "~> 4.9"
gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.10.1"
gem "flipper"
gem "flipper-active_record"
gem "flipper-ui"
Expand Down
57 changes: 57 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
GIT
remote: https://github.com/DFE-Digital/dfe-analytics.git
revision: 11d75a3c92cc15439c00ea7f2f8686acffefc103
tag: v1.10.1
specs:
dfe-analytics (1.10.1)
google-cloud-bigquery (~> 1.38)
request_store_rails (~> 2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -115,6 +124,7 @@ GEM
irb (>= 1.5.0)
reline (>= 0.3.1)
debug_inspector (1.1.0)
declarative (0.0.20)
deep_merge (1.2.2)
devise (4.9.3)
bcrypt (~> 3.0)
Expand Down Expand Up @@ -193,6 +203,35 @@ GEM
raabro (~> 1.4)
globalid (1.2.1)
activesupport (>= 6.1)
google-apis-bigquery_v2 (0.59.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
webrick
google-cloud-bigquery (1.44.2)
concurrent-ruby (~> 1.0)
google-apis-bigquery_v2 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.1)
googleauth (1.8.0)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
google-protobuf (3.24.4)
govuk-components (4.1.1)
html-attributes-utils (~> 1.0.0, >= 1.0.0)
Expand All @@ -209,6 +248,7 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
importmap-rails (1.2.1)
Expand Down Expand Up @@ -249,6 +289,7 @@ GEM
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.7.1)
multi_json (1.15.0)
multi_xml (0.6.0)
net-imap (0.4.2)
date
Expand Down Expand Up @@ -283,6 +324,7 @@ GEM
oauth2 (>= 1.4, < 3)
omniauth (~> 2.0)
orm_adapter (0.5.0)
os (1.1.4)
pagy (6.1.0)
parallel (1.23.0)
parser (3.2.2.3)
Expand Down Expand Up @@ -345,11 +387,18 @@ GEM
regexp_parser (2.8.1)
reline (0.3.4)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
request_store (1.5.1)
rack (>= 1.4)
request_store_rails (2.0.0)
concurrent-ruby (~> 1.0)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
retriable (3.1.2)
rexml (3.2.6)
rolify (6.0.1)
rspec-core (3.12.2)
Expand Down Expand Up @@ -431,6 +480,11 @@ GEM
fugit (~> 1.8)
globalid (>= 1.0.1)
sidekiq (>= 6)
signet (0.18.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand All @@ -442,8 +496,10 @@ GEM
version_gem (~> 1.1, >= 1.1.1)
thor (1.3.0)
timeout (0.4.0)
trailblazer-option (0.1.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
uk_postcode (2.1.8)
unicode-display_width (2.4.2)
version_gem (1.1.3)
Expand Down Expand Up @@ -482,6 +538,7 @@ DEPENDENCIES
dartsass-rails (~> 0.5.0)
debug
devise (~> 4.9)
dfe-analytics!
dotenv-rails
factory_bot_rails
faker
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
include DfE::Analytics::Requests

default_form_builder GOVUKDesignSystemFormBuilder::FormBuilder

before_action :check_service_open!
Expand Down
98 changes: 98 additions & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
shared:
schools:
- id
- name
- headteacher_name
- created_at
application_progresses:
- id
- initial_checks_completed_at
- visa_investigation_required
- home_office_checks_completed_at
- school_investigation_required
- school_checks_completed_at
- application_id
- payment_confirmation_completed_at
- rejection_completed_at
- banking_approval_completed_at
- rejection_details
- status
- rejection_reason
applications:
- id
- application_date
- urn
- applicant_id
- created_at
- subject
- visa_type
- date_of_entry
- start_date
- application_route
- home_office_csv_downloaded_at
- standing_data_csv_downloaded_at
- payroll_csv_downloaded_at
applicants:
- id
- given_name
- family_name
- email_address
- phone_number
- passport_number
- updated_at
- middle_name
- date_of_birth
- nationality
- sex
- created_at
- school_id
- student_loan
- ip_address
addresses:
- id
- addressable_type
- addressable_id
- address_line_1
- address_line_2
- city
- postcode
users:
- email
qa_statuses:
- id
- application_id
- status
- date
- created_at
- updated_at
forms:
- id
- given_name
- middle_name
- family_name
- email_address
- phone_number
- date_of_birth
- nationality
- sex
- passport_number
- subject
- visa_type
- date_of_entry
- start_date
- address_line_1
- address_line_2
- city
- postcode
- application_route
- state_funded_secondary_school
- one_year
- school_name
- school_headteacher_name
- school_address_line_1
- school_address_line_2
- school_city
- school_postcode
- created_at
- updated_at
- student_loan
68 changes: 68 additions & 0 deletions config/analytics_blocklist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
:shared:
:schools:
- updated_at
:duplicate_applications:
- id
- application_date
- urn
- applicant_id
- created_at
- updated_at
- subject
- visa_type
- date_of_entry
- start_date
- application_route
- home_office_csv_downloaded_at
- standing_data_csv_downloaded_at
- payroll_csv_downloaded_at
- duplicate_email
- duplicate_phone
- duplicate_passport
:application_progresses:
- created_at
- updated_at
:applications:
- updated_at
:app_settings:
- id
- service_start_date
- service_end_date
- created_at
- updated_at
:addresses:
- created_at
- updated_at
:users:
- id
- created_at
- updated_at
:audits:
- id
- auditable_id
- auditable_type
- associated_id
- associated_type
- user_id
- user_type
- username
- action
- audited_changes
- version
- comment
- remote_address
- request_uuid
- created_at
:flipper_gates:
- id
- feature_key
- key
- value
- created_at
- updated_at
:flipper_features:
- id
- key
- created_at
- updated_at
25 changes: 25 additions & 0 deletions config/analytics_pii.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
shared:
schools:
- headteacher_name
applicants:
- given_name
- middle_name
- family_name
- email_address
- phone_number
- passport_number
forms:
- given_name
- middle_name
- family_name
- email_address
- phone_number
- nationality
- sex
- passport_number
- visa_type
- address_line_1
- address_line_2
- city
- postcode
- school_headteacher_name
Loading
Loading