Skip to content

Commit

Permalink
Glt 4288.release status signoffs (#164)
Browse files Browse the repository at this point in the history
* add a boolean release field to the signoff table
  • Loading branch information
grapigeau authored Nov 4, 2024
1 parent 76e71a7 commit 9433a3e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project attempts to adhere to Semantic Versioning.

## UNRELEASED

### Changed

* Add optional release status (boolean) to sign-off records

## 3.9.0: [2024-09-16]

### Changed
Expand Down
1 change: 1 addition & 0 deletions components/signoffs/signoffController.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ function validateObjectsFromUser (unvalidated) {
signoffStepName: stepname,
deliverable: validateDeliverable(unvalidated.deliverable, stepname),
comment: validateComment(unvalidated.comment),
release: nullifyIfBlank(unvalidated.release),
};
for (const [, value] of Object.entries(fromUser)) {
if (value instanceof ValidationError) {
Expand Down
3 changes: 3 additions & 0 deletions components/signoffs/signoffDao.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const signoffStepName = 'signoff_step_name';
const deliverableType = 'deliverable_type';
const deliverable = 'deliverable';
const comment = 'comment';
const release = 'release';

const signoffColsCreate = new pgp.helpers.ColumnSet(
[
Expand All @@ -22,6 +23,7 @@ const signoffColsCreate = new pgp.helpers.ColumnSet(
deliverableType,
deliverable,
comment,
release,
],
{ table: 'signoff' }
);
Expand All @@ -36,6 +38,7 @@ const addSignoff = (caseId, signed, oldSignoffId = null) => {
deliverable_type: signed.deliverableType,
deliverable: signed.deliverable,
comment: signed.comment,
release: signed.release,
};

const signoffInsert = pgp.helpers.insert(
Expand Down
1 change: 1 addition & 0 deletions sql/V013__add_release_to_signoff.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE signoff ADD COLUMN release boolean NULL;
12 changes: 12 additions & 0 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,10 @@
"comment": {
"description": "Optional URL-escaped reason why sign-off is PASS or FAIL",
"type": "string"
},
"release": {
"description": "Optional boolean for release status",
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -1206,6 +1210,10 @@
"comment": {
"description": "Optional URL-escaped reason why sign-off is PASS or FAIL",
"type": "string"
},
"release": {
"description": "Optional boolean for release status",
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -1248,6 +1256,10 @@
"comment": {
"description": "URL-escaped reason why sign-off is PASS or FAIL (only returned if a sign-off record is found and a comment was provided)",
"type": "string"
},
"release": {
"description": "Optional boolean for release status",
"type": "boolean"
}
},
"required": [
Expand Down
12 changes: 6 additions & 6 deletions test/migrations/V9000__test_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ INSERT INTO archive (case_id, workflow_run_ids_for_offsite_archive, unload_file_
((SELECT id FROM cardea_case WHERE case_identifier = 'R12_TEST_1212_Ab_C'), '{"vidarr:research/run/ac7fa728822f4b801f17cb6aa5d597e32642e6e36a2089fb3c947e4d7d679203", "vidarr:research/run/93d25e166f7ea82c6eb17e48e62e4134939fcaf75c9b9f953819797f4878d961", "vidarr:research/run/8b7fb588926f5efcdfe9824e867b91c93829c383f4177f87b92288b2f2554f8f", "vidarr:research/run/88065a62eeb0ad351f48ff9a3a32cdbdbe4bedf1e386603c1d4d8cfd46d5acd0", "vidarr:research/run/86b9da7b2b84174daef0f29beecf84453d8f987c46805121bf3109e0de48dc14"}', NULL, NULL, NULL, '{"vidarr:research/run/d8cc36839b0dd246af6940f175f089bf2007f5dcb01a00bc53a55526060250f9"}', NULL, NULL, NULL);

DELETE FROM signoff;
INSERT INTO signoff (case_identifier, qc_passed, username, signoff_step_name, deliverable_type, deliverable, comment) VALUES
('R11_TEST_1000_Xy_Z', TRUE, 'me', 'RELEASE', 'CLINICAL_REPORT', 'X', ''),
('R12_TEST_1212_Ab_C', FALSE, 'me', 'ANALYSIS_REVIEW', 'DATA_RELEASE', '', ''),
('R12_TEST_9999_De_F', null, 'me', 'RELEASE', 'DATA_RELEASE', 'X', ''),
('R12_TEST_9999_De_F', TRUE, 'me', 'ANALYSIS_REVIEW', 'DATA_RELEASE', '', ''),
('R12_TEST_9999_De_F', FALSE, 'me', 'RELEASE_APPROVAL', 'DATA_RELEASE', '', '');
INSERT INTO signoff (case_identifier, qc_passed, username, signoff_step_name, deliverable_type, deliverable, comment, release) VALUES
('R11_TEST_1000_Xy_Z', TRUE, 'me', 'RELEASE', 'CLINICAL_REPORT', 'X', '', NULL),
('R12_TEST_1212_Ab_C', FALSE, 'me', 'ANALYSIS_REVIEW', 'DATA_RELEASE', '', '', NULL),
('R12_TEST_9999_De_F', null, 'me', 'RELEASE', 'DATA_RELEASE', 'X', '', NULL),
('R12_TEST_9999_De_F', TRUE, 'me', 'ANALYSIS_REVIEW', 'DATA_RELEASE', '', '', NULL),
('R12_TEST_9999_De_F', FALSE, 'me', 'RELEASE_APPROVAL', 'DATA_RELEASE', '', '', NULL);

INSERT INTO token (auth_token, auth_id, username) VALUES ('7e9668724e31742d:164f53c7057e2667de55ae8ad9c1df7fbf85f261f4d89e8f696a81b1ed9972652ed33269eaaa61f738f04cfb8310372e99faad26b1dee5dd1488d3d2dcfcf835', 'wdew0h5hoxvraj1xhrzix4j6nbswhh','inital');
1 change: 1 addition & 0 deletions test/signoffTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const signoffProperties = [
'deliverableType',
'deliverable',
'comment',
'release',
];

const testingToken =
Expand Down

0 comments on commit 9433a3e

Please sign in to comment.