From 9df80c54b2126445d1f257a6696e3df4cb610c45 Mon Sep 17 00:00:00 2001 From: jon-funk Date: Wed, 16 Oct 2024 18:40:50 -0700 Subject: [PATCH] fix: CE-1078 persist secret content changes between rollouts (#698) Co-authored-by: afwilcox --- .github/workflows/pr-close.yml | 9 +++++++++ .github/workflows/pr-open.yml | 1 - charts/app/Chart.lock | 7 +++++-- charts/app/templates/_helpers.tpl | 1 + migrations/migrations/R__Create-Test-Data.sql | 10 ++++++++++ .../test-only-migrations/R__Test-Data-Creation.sql | 2 ++ 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-close.yml b/.github/workflows/pr-close.yml index ebd159daf..06ba7d866 100644 --- a/.github/workflows/pr-close.yml +++ b/.github/workflows/pr-close.yml @@ -19,3 +19,12 @@ jobs: with: cleanup: helm packages: backend frontend migrations + + cleanup-labeled: + name: Cleanup Labeled Resources + uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-close.yml@v0.5.0 + secrets: + oc_namespace: ${{ secrets.OC_NAMESPACE }} + oc_token: ${{ secrets.OC_TOKEN }} + with: + cleanup: label \ No newline at end of file diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 697c49aa4..2a0676faf 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -37,7 +37,6 @@ jobs: oc_token: ${{ secrets.OC_TOKEN }} with: triggers: ('backend/' 'frontend/' 'webeoc/' 'migrations/') - params: --set global.secrets.persist=false tests: name: Tests diff --git a/charts/app/Chart.lock b/charts/app/Chart.lock index 6135759c8..70bf9a3c6 100644 --- a/charts/app/Chart.lock +++ b/charts/app/Chart.lock @@ -2,5 +2,8 @@ dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami version: 15.5.13 -digest: sha256:e29db8b50c7ad4e611c43b4590506d2172ac278b08f015fe0240ba123f2166ec -generated: "2024-07-03T12:48:59.269045601Z" +- name: nats + repository: https://nats-io.github.io/k8s/helm/charts/ + version: 1.1.12 +digest: sha256:daadb6fa80ea04bc755dfeae1b823ce70b60f7bc3326ab9c40b3768bb2d5d9aa +generated: "2024-10-08T14:08:20.367635823-07:00" diff --git a/charts/app/templates/_helpers.tpl b/charts/app/templates/_helpers.tpl index 9462c22c8..75ab465dc 100644 --- a/charts/app/templates/_helpers.tpl +++ b/charts/app/templates/_helpers.tpl @@ -43,5 +43,6 @@ Selector labels {{- define "selectorLabels" -}} app.kubernetes.io/name: {{ include "fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} +app: {{ .Release.Name }} {{- end }} diff --git a/migrations/migrations/R__Create-Test-Data.sql b/migrations/migrations/R__Create-Test-Data.sql index 6568b672b..b57a39b51 100644 --- a/migrations/migrations/R__Create-Test-Data.sql +++ b/migrations/migrations/R__Create-Test-Data.sql @@ -1953,6 +1953,16 @@ VALUES 'f896cbb2d5254e54a4ad581dc80681d1'::uuid ) ON CONFLICT DO NOTHING; +-- Fix keycloak name +UPDATE + public.officer +SET + user_id = 'JONFUNK' +WHERE + ( + officer_guid = 'b17ee2c1-a26b-4911-ac6f-810b8fdfaab3' + AND user_id = 'JFUNK' + ); INSERT INTO public.officer ( diff --git a/migrations/test-only-migrations/R__Test-Data-Creation.sql b/migrations/test-only-migrations/R__Test-Data-Creation.sql index 52d478ee7..2ee8b34c2 100644 --- a/migrations/test-only-migrations/R__Test-Data-Creation.sql +++ b/migrations/test-only-migrations/R__Test-Data-Creation.sql @@ -476,6 +476,8 @@ INSERT INTO public.officer (officer_guid, user_id, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp, person_guid, office_guid, auth_user_guid) VALUES('b17ee2c1-a26b-4911-ac6f-810b8fdfaab3'::uuid, 'JFUNK', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:20:48.186', '97f3cee5-6f4a-410f-810f-d431595fccee'::uuid, '4a5a94b1-bd47-4611-a577-861d97089903'::uuid, 'f896cbb2d5254e54a4ad581dc80681d1'::uuid) ON CONFLICT DO NOTHING; +-- Fix keycloak name +UPDATE public.officer SET user_id = 'JONFUNK' WHERE (officer_guid = 'b17ee2c1-a26b-4911-ac6f-810b8fdfaab3' AND user_id = 'JFUNK'); INSERT INTO public.officer (officer_guid, user_id, create_user_id, create_utc_timestamp, update_user_id, update_utc_timestamp, person_guid, office_guid, auth_user_guid) VALUES('06ff894b-3895-4d32-8a4a-1fcc0be23e47'::uuid, 'RRONDEAU', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:20:48.186', '0667495f-61a5-4d3b-b756-1ee58cb38e23'::uuid, '4a5a94b1-bd47-4611-a577-861d97089903'::uuid, '77c6040d69b74757903f1cba37404db4'::uuid)