Skip to content

Commit

Permalink
Migrate gcp wif
Browse files Browse the repository at this point in the history
  • Loading branch information
Neill Turner committed Dec 20, 2024
1 parent 3cd8ddf commit e6ea204
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/actions/deploy-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
- uses: google-github-actions/auth@v2
with:
project_id: claim-additional-payments
workload_identity_provider: projects/638192024625/locations/global/workloadIdentityPools/claim-additional-payments/providers/claim-additional-payments
workload_identity_provider: projects/638192024625/locations/global/workloadIdentityPools/claim-additional-payments-for-te/providers/claim-additional-payments-for-te

- name: Terraform Apply
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete_review_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: google-github-actions/auth@v2
with:
project_id: claim-additional-payments
workload_identity_provider: projects/638192024625/locations/global/workloadIdentityPools/claim-additional-payments/providers/claim-additional-payments
workload_identity_provider: projects/638192024625/locations/global/workloadIdentityPools/claim-additional-payments-for-te/providers/claim-additional-payments-for-te

- name: Terraform destroy
run: |
Expand Down
57 changes: 7 additions & 50 deletions config/initializers/dfe_analytics.rb
Original file line number Diff line number Diff line change
@@ -1,55 +1,12 @@
DfE::Analytics.configure do |config|
# Whether to log events instead of sending them to BigQuery.
#
# config.log_only = true
config.log_only = (%w[development test].include?(ENV["RAILS_ENV"]) || ENV["ENVIRONMENT_NAME"].start_with?("review"))

# Whether to use ActiveJob or dispatch events immediately.
#
# config.async = true

# Which ActiveJob queue to put events on
#
# config.queue = :default

# The name of the BigQuery table we’re writing to.
#
# config.bigquery_table_name = ENV['BIGQUERY_TABLE_NAME']

# The name of the BigQuery project we’re writing to.
#
# config.bigquery_project_id = ENV['BIGQUERY_PROJECT_ID']

# The name of the BigQuery dataset we're writing to.
#
# config.bigquery_dataset = ENV['BIGQUERY_DATASET']

# Service account JSON key for the BigQuery API. See
# https://cloud.google.com/bigquery/docs/authentication/service-account-file
#
# config.bigquery_api_json_key = ENV['BIGQUERY_API_JSON_KEY']

# Passed directly to the retries: option on the BigQuery client
#
# config.bigquery_retries = 3

# Passed directly to the timeout: option on the BigQuery client
#
# config.bigquery_timeout = 120

# A proc which returns true or false depending on whether you want to
# enable analytics. You might want to hook this up to a feature flag or
# environment variable.
#
config.enable_analytics = proc { Rails.env.production? }

# Enable entity table check job
#
config.queue = :analytics
config.environment = HostingEnvironment.environment_name
config.entity_table_checks_enabled = true

# The environment we’re running in. This value will be attached
# to all events we send to BigQuery.
#
# config.environment = ENV.fetch('RAILS_ENV', 'development')
config.enable_analytics =
proc do
disabled_by_default = Rails.env.development?
ENV.fetch("BIGQUERY_DISABLE", disabled_by_default.to_s) != "true"
end
config.azure_federated_auth = ENV.include? "GOOGLE_CLOUD_CREDENTIALS"
end
2 changes: 1 addition & 1 deletion terraform/application/config/review.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"startup_command": ["/bin/sh", "-c", "bin/rails server -b 0.0.0.0"],
"worker_command": ["/bin/sh", "-c", "bin/bundle exec bin/delayed_job run -n 1"],
"enable_logit": true,
"dataset_name": "claim_events_dev",
"dataset_name": "claim_events_test",
"enable_dfe_analytics_federated_auth": true
}

0 comments on commit e6ea204

Please sign in to comment.