Skip to content

Commit

Permalink
Merge pull request #6626 from DFE-Digital/enable-analytics-entity-tab…
Browse files Browse the repository at this point in the history
…le-check-job

Enable DFE::Analytics Entity Table Check job
  • Loading branch information
ddippolito committed Feb 15, 2024
2 parents 61839e7 + 25e16f6 commit 58b1f0c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gem "array_enum"
gem "aws-sdk-s3", require: false
gem "breasal"
gem "devise"
gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.11.6"
gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.11.7"
gem "factory_bot_rails"
gem "faker"
gem "friendly_id"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/DFE-Digital/dfe-analytics.git
revision: 33251ca61e4806fc7eb86538c24de578bfea0007
tag: v1.11.6
revision: 6c992b64df6909a4e5e82dc27e2237c8db915865
tag: v1.11.7
specs:
dfe-analytics (1.11.6)
dfe-analytics (1.11.7)
google-cloud-bigquery (~> 1.38)
request_store_rails (~> 2)

Expand Down
5 changes: 5 additions & 0 deletions config/initializers/dfe_analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
#
# config.enable_analytics = proc { true }

# Ensures the latest version of an entity table in BigQuery is in sync with the database.
# It is advisable to schedule this job to run on a nightly basis for consistent data verification.
#
config.entity_table_checks_enabled = true

# The environment we’re running in. This value will be attached
# to all events we send to BigQuery.
#
Expand Down
5 changes: 5 additions & 0 deletions config/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,8 @@ delete_old_feedback:
cron: '0 3 * * *'
class: 'DeleteOldFeedbackJob'
queue: default

send_entity_table_checks_to_bigquery:
cron: "30 1 * * *"
class: "DfE::Analytics::EntityTableCheckJob"
queue: low
6 changes: 3 additions & 3 deletions spec/configuration/sidekiq_scheduled_jobs_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require "rails_helper"

RSpec.describe "Sidekiq configuration" do
let(:all_jobs) do
let(:all_app_jobs) do
# Require all jobs in case autoloading didn't get there
Rails.root.join("app/jobs").glob("**/*.rb").map { |file| require file }

ApplicationJob.descendants.map(&:name)
end

let(:gem_jobs) { %w[DfE::Analytics::EntityTableCheckJob] }
let(:scheduled_jobs) { YAML.load_file("./config/schedule.yml").map { |_, v| v["class"] } }
let(:unscheduled_jobs) do
%w[
Expand All @@ -31,6 +31,6 @@
end

it "includes all scheduled jobs in the schedule" do
expect(scheduled_jobs).to match_array(all_jobs - unscheduled_jobs)
expect(scheduled_jobs).to match_array(all_app_jobs + gem_jobs - unscheduled_jobs)
end
end

0 comments on commit 58b1f0c

Please sign in to comment.