Skip to content

Commit

Permalink
Remove 'scrub access limited' SQL
Browse files Browse the repository at this point in the history
The original intention was to keep this as the main copy of the SQL
sanitisation script (the script that is applied to data when it
is copied from Production to Integration in the nightly env sync).
A code comment deleted here refers to https://github.com/alphagov/env-sync-and-backup/blob/master/sanitising-sql/sanitise_content_publisher_production.sql,
which is the 'copy' of this main copy, and should be kept in sync.

The env sync process has since moved from env-sync-and-backup to
govuk-helm-charts. The SQL script is referred to here:
https://github.com/alphagov/govuk-helm-charts/blob/61d36eeb6339c13600f1c5cecc725a71ff593053/charts/db-backup/values.yaml#L329

...and the SQL script it is referring to lives here:
https://github.com/alphagov/govuk-helm-charts/blob/main/charts/db-backup/scripts/content-publisher.sql

There is currently a TODO comment in that repo:

```
-- TODO: Fix the CI in alphagov/content-publisher to pull in this script
-- (perhaps via git submodule) instead of running tests against its own copy.
```

So let's do that.

This commit removes our local copy of the SQL sanitisation, and
pulls in the remote copy instead (the version that is actually
used in the env sync job, which is far more useful).
  • Loading branch information
ChrisBAshton committed Sep 16, 2024
1 parent 3f1dc41 commit bdb8642
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 96 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
ref: ${{ inputs.publishingApiRef }}
path: vendor/publishing-api

- name: Checkout govuk-helm-charts (for data sanitisation SQL)
uses: actions/checkout@v3
with:
repository: alphagov/govuk-helm-charts
path: vendor/govuk-helm-charts

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
95 changes: 0 additions & 95 deletions db/scrub_access_limited.sql

This file was deleted.

2 changes: 1 addition & 1 deletion spec/db/scrub_access_limited_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.describe "Scrub Access Limited SQL Script" do
def execute_sql
sql = File.read(Rails.root.join("db/scrub_access_limited.sql"))
sql = File.read(Rails.root.join("vendor/govuk-helm-charts/charts/db-backup/scripts/content-publisher.sql"))
ActiveRecord::Base.connection.execute(sql)
end

Expand Down

0 comments on commit bdb8642

Please sign in to comment.