This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a job to repopulate the data that has been collected by the [content data api etl job](https://deploy.blue.production.govuk.digital/job/content_data_api_import_etl_master_process/). The data collected by this initial etl job was giving inaccurate results we traced this down to a [delay in results showing up in Google analytics](https://support.google.com/analytics/answer/1070983?hl=en#:~:text=Data%20processing%20latency,for%20up%20to%20two%20days), results can take between 24-48 hours to appear in GA, the initial etl is run at 7am leaving only 7 hours for the data to appear in GA. The newly added job will collect the data after 2 days leaving time for for the data to appear correctly in GA. We have added this new job instead of moving the current job back since there are many references in the code of content-data to data collected yesterday. The date ranges are also done from data received yesterday. Changing this would be a big job, so initially we use the potentially inaccurate data and then correct it after 2 days. Trello card: https://trello.com/c/ODGWWnXt/2005-5-content-data-incorrect-users-who-found-this-useful-data-for-march
- Loading branch information
1 parent
fac4b51
commit f0539d9
Showing
8 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
modules/govuk_jenkins/manifests/jobs/content_data_api_re_run.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# == Class: govuk_jenkins::jobs::content_data_api_re_run | ||
# | ||
# Create a jenkins job to periodically run rake for the following tasks: | ||
# - rake etl:rerun_master | ||
# | ||
# === Parameters: | ||
# | ||
# [*re_run_rake_etl_master_process_cron_schedule *] | ||
# The cron timings for the etl:master process | ||
# Default: undef | ||
# | ||
class govuk_jenkins::jobs::content_data_api_re_run ( | ||
$re_run_rake_etl_master_process_cron_schedule, | ||
$app_domain = hiera('app_domain'), | ||
) { | ||
|
||
file { '/etc/jenkins_jobs/jobs/content_data_api_re_run.yaml': | ||
ensure => present, | ||
content => template('govuk_jenkins/jobs/content_data_api_re_run.yaml.erb'), | ||
notify => Exec['jenkins_jobs_update'], | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
modules/govuk_jenkins/templates/jobs/content_data_api_re_run.yaml.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- job: | ||
name: content_data_api_re_run_re_run_rake_etl_master_process_cron_schedule | ||
display-name: Content Data API - rerun ETL master | ||
project-type: freestyle | ||
description: "<p>Rerun the etl:master rake task to populate missing data.</p>" | ||
builders: | ||
- trigger-builds: | ||
- project: run-rake-task | ||
block: true | ||
predefined-parameters: | | ||
TARGET_APPLICATION=content-data-api | ||
MACHINE_CLASS=backend | ||
RAKE_TASK=etl:rerun_master['<%= "#{(Time.now-2*24*60*60).strftime("%Y-%m-%d")}, #{(Time.now-2*24*60*60).strftime("%Y-%m-%d")}" %>'] | ||
wrappers: | ||
- ansicolor: | ||
colormap: xterm | ||
triggers: | ||
- timed: <%= @re_run_rake_etl_master_process_cron_schedule %> | ||
logrotate: | ||
daysToKeep: 365 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters