-
Notifications
You must be signed in to change notification settings - Fork 27
Psp 11434 #5291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
devinleighsmith
wants to merge
8
commits into
bcgov:dev
Choose a base branch
from
devinleighsmith:psp-11434
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Psp 11434 #5291
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c08095e
for testing only.
devinleighsmith 5a8237f
temp override to fork.
devinleighsmith 7e7624c
correct syntax error on git reset
devinleighsmith 53d4f91
cleanup based on testing.
devinleighsmith 3876f2f
add back the missing test execution sections of the actions.
devinleighsmith 1fde315
reduce duplicated code.
devinleighsmith 9274118
add logic to skip execution in production.
devinleighsmith 6866ef4
re-add smoke tests.
devinleighsmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,77 @@ | ||
| kind: Template | ||
| apiVersion: template.openshift.io/v1 | ||
| metadata: | ||
| name: db-deploy | ||
| annotations: | ||
| description: "This template deploys a job to remove all rows created by a target GUID." | ||
| tags: "database,clean" | ||
| objects: | ||
| - kind: Job | ||
| apiVersion: batch/v1 | ||
| metadata: | ||
| generateName: db-clean-guid- | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| parallelism: 1 | ||
| backoffLimit: 6 | ||
| selector: | ||
| template: | ||
| metadata: | ||
| name: db-clean-guid | ||
| spec: | ||
| containers: | ||
| - name: sqlcmd | ||
| image: >- | ||
| image-registry.apps.silver.devops.gov.bc.ca/3cd915-tools/sqlcmd-mssql:latest | ||
| command: | ||
| - /bin/bash | ||
| - "-c" | ||
| - >- | ||
| PATH="/opt/mssql-tools/bin:$PATH"; | ||
| cd /usr/config/psp; | ||
| git fetch origin ${GIT_BRANCH}; | ||
| git reset --hard origin/${GIT_BRANCH}; | ||
| cd /usr/config/psp/source/database/mssql/scripts/dbscripts; | ||
| chmod 777 delete-by-create-user-guid.sh; | ||
| ./delete-by-create-user-guid.sh; | ||
| env: | ||
| - name: TEST_USER_GUID | ||
| value: ${TEST_USER_GUID} | ||
| - name: SERVER_NAME | ||
| value: ${SERVER_NAME} | ||
| - name: DB_NAME | ||
| value: ${DB_NAME} | ||
| - name: DB_USER | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: ${DB_SECRET_NAME} | ||
| key: DB_USER | ||
| - name: DB_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: ${DB_SECRET_NAME} | ||
| key: DB_PASSWORD | ||
| resources: {} | ||
| terminationMessagePath: /dev/termination-log | ||
| terminationMessagePolicy: File | ||
| imagePullPolicy: Always | ||
| restartPolicy: Never | ||
| parameters: | ||
| - name: TEST_USER_GUID | ||
| description: the guid of the user to delete content from the database. | ||
| required: true | ||
| - name: SERVER_NAME | ||
| description: The name of the database server | ||
| required: true | ||
| - name: DB_NAME | ||
| description: The name of the database | ||
| required: true | ||
| - name: NAMESPACE | ||
| description: the openshift namespace to run this job in. | ||
| required: true | ||
| - name: GIT_BRANCH | ||
| description: the git branch to pull the database scripts from. | ||
| required: true | ||
| - name: DB_SECRET_NAME | ||
| description: the git branch to pull the database scripts from. | ||
| required: true |
3 changes: 3 additions & 0 deletions
3
...abase/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/001_PIMS_DELETE_BY_USER_GUID.sql
This file contains hidden or 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,3 @@ | ||
| /****** Object: StoredProcedure [dbo].[SafeDeleteByCreateUserGuidStrict] Script Date: 4/20/2026 3:29:59 PM ******/ | ||
| DROP PROCEDURE [dbo].[SafeDeleteByCreateUserGuidStrict] | ||
| GO |
67 changes: 18 additions & 49 deletions
67
source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/master.sql
This file contains hidden or 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 |
|---|---|---|
| @@ -1,59 +1,28 @@ | ||
| -- File generated on 04/07/2026 03:36:12 PM. | ||
| -- Autogenerated file. Do not manually modify. | ||
|
|
||
| :On Error Exit | ||
| SET XACT_ABORT ON | ||
| SET | ||
| XACT_ABORT ON | ||
| GO | ||
|
|
||
| PRINT ' == DB SCRIPT START ========' | ||
| PRINT ' == DB SCRIPT START ========' | ||
| GO | ||
| BEGIN TRANSACTION PRINT ' == DB TRANSACTION START ========' | ||
| GO | ||
| --Script section | ||
| PRINT '- Executing PSP_PIMS_S121_00/001_PIMS_DELETE_BY_USER_GUID.sql ' | ||
| :setvar filepath "PSP_PIMS_S121_00/Alter Down/001_PIMS_DELETE_BY_USER_GUID.sql" | ||
| :r $(filepath) --End script section | ||
| PRINT ' == DB TRANSACTION FINISH ========' | ||
| GO | ||
| If XACT_STATE() = 1 BEGIN PRINT '- Success: Committing Transaction...' COMMIT TRANSACTION; | ||
|
|
||
| BEGIN TRANSACTION | ||
| PRINT ' == DB TRANSACTION START ========' | ||
| GO | ||
|
|
||
| --Script section | ||
| END | ||
| ELSE IF XACT_STATE() = -1 BEGIN PRINT '- Error: Rolling Back Transaction...' ROLLBACK TRANSACTION; | ||
|
|
||
| PRINT '- Executing PSP_PIMS_S120_00/Alter Down/010_PSP_PIMS_Alter_Down.sql ' | ||
| :setvar filepath "PSP_PIMS_S120_00/Alter Down/010_PSP_PIMS_Alter_Down.sql" | ||
| :r $(filepath) | ||
| PRINT '- Executing PSP_PIMS_S120_00/Alter Down/020_PIMS_STATIC_VARIABLE_VERSION_Alter_Down.sql ' | ||
| :setvar filepath "PSP_PIMS_S120_00/Alter Down/020_PIMS_STATIC_VARIABLE_VERSION_Alter_Down.sql" | ||
| :r $(filepath) | ||
| PRINT '- Executing PSP_PIMS_S120_00/Alter Down/057_DML_PIMS_LEASE_PROGRAM_TYPE_Alter_Down.sql ' | ||
| :setvar filepath "PSP_PIMS_S120_00/Alter Down/057_DML_PIMS_LEASE_PROGRAM_TYPE_Alter_Down.sql" | ||
| :r $(filepath) | ||
| PRINT '- Executing PSP_PIMS_S120_00/Alter Down/093_DML_PIMS_ACQ_FL_TEAM_PROFILE_TYPE_Alter_Down.sql ' | ||
| :setvar filepath "PSP_PIMS_S120_00/Alter Down/093_DML_PIMS_ACQ_FL_TEAM_PROFILE_TYPE_Alter_Down.sql" | ||
| :r $(filepath) | ||
| PRINT '- Executing PSP_PIMS_S120_00/Alter Down/144_DML_PIMS_DSP_FL_TEAM_PROFILE_TYPE_Alter_Down.sql ' | ||
| :setvar filepath "PSP_PIMS_S120_00/Alter Down/144_DML_PIMS_DSP_FL_TEAM_PROFILE_TYPE_Alter_Down.sql" | ||
| :r $(filepath) | ||
| PRINT '- Executing PSP_PIMS_S120_00/Alter Down/164_DML_PIMS_LL_TEAM_PROFILE_TYPE_Alter_Down.sql ' | ||
| :setvar filepath "PSP_PIMS_S120_00/Alter Down/164_DML_PIMS_LL_TEAM_PROFILE_TYPE_Alter_Down.sql" | ||
| :r $(filepath) | ||
| PRINT '- Executing PSP_PIMS_S120_00/Alter Down/167_DML_PIMS_MANAGEMENT_FILE_PROFILE_TYPE_Alter_Down.sql ' | ||
| :setvar filepath "PSP_PIMS_S120_00/Alter Down/167_DML_PIMS_MANAGEMENT_FILE_PROFILE_TYPE_Alter_Down.sql" | ||
| :r $(filepath) | ||
| END; | ||
|
|
||
| --End script section | ||
| ELSE IF XACT_STATE() = 0 BEGIN PRINT '- Error: No pending transactions...' ROLLBACK TRANSACTION; | ||
|
|
||
| PRINT ' == DB TRANSACTION FINISH ========' | ||
| GO | ||
| END; | ||
|
|
||
| If XACT_STATE()=1 | ||
| BEGIN | ||
| PRINT '- Success: Committing Transaction...' | ||
| COMMIT TRANSACTION; | ||
| END | ||
| ELSE IF XACT_STATE()=-1 | ||
| BEGIN | ||
| PRINT '- Error: Rolling Back Transaction...' | ||
| ROLLBACK TRANSACTION; | ||
| END; | ||
| ELSE IF XACT_STATE()=0 | ||
| BEGIN | ||
| PRINT '- Error: No pending transactions...' | ||
| ROLLBACK TRANSACTION; | ||
| END; | ||
| GO | ||
| GO |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do the playwright tests were removed? Do they not work currently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just removed for test purposes, since these aren't running cleanly atm.