mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:47:08 +00:00
Allow forcing QCs.
QCs may be re-run for specific sequences or for a whole project by defining an environment variable, as follows: For an entire project: * DOUGAL_FORCE_QC="project-id" For specific sequences: * DOUGAL_FORCE_QC="project-id sequence1 sequence2 … sequenceN"
This commit is contained in:
@@ -10,6 +10,34 @@ const { projectHash, sequenceHash } = require('./last-modified');
|
||||
const { runShotsQC, saveShotsQC } = require('./shots');
|
||||
const { runSequenceQCs, saveSequenceQCs } = require('./sequences');
|
||||
|
||||
/** Return true if the user has requested force running
|
||||
* a QC that would normally not be scheduled to be run.
|
||||
*
|
||||
* This is done via the DOUGAL_FORCE_QC environment
|
||||
* variable. The format is as follows:
|
||||
*
|
||||
* DOUGAL_FORCE_QC="project-id [sequence1 sequence2 … sequenceN]"
|
||||
*
|
||||
* A value of "project-id" re-runs QCs for all sequences of that
|
||||
* project, whereas specifying sequences to be run affects only
|
||||
* those sequences.
|
||||
*/
|
||||
function forceQC (projectId, sequenceNumber) {
|
||||
if (process.env.DOUGAL_FORCE_QC) {
|
||||
const [force_projectID, ...force_sequences ] = process.env.DOUGAL_FORCE_QC.split(/\s+/);
|
||||
if (projectId == force_projectID) {
|
||||
if (!sequenceNumber) {
|
||||
return true;
|
||||
} else if (!force_sequences.length) {
|
||||
return true;
|
||||
} else {
|
||||
return force_sequences.map(i => Number(i)).some(i => i == sequenceNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async function getProjectQCConfig (projectId) {
|
||||
console.log("getProjectQCConfig");
|
||||
const qcConfig = await configuration.get(projectId, "qc");
|
||||
@@ -41,7 +69,7 @@ async function main () {
|
||||
console.log("projectHash", projectHash);
|
||||
console.log("lastQCHash", lastQCHash);
|
||||
|
||||
if (currentQCHash != lastQCHash) {
|
||||
if (currentQCHash != lastQCHash || forceQC(projectId)) {
|
||||
console.log("currentQCHash != lastQCHash", projectId, currentQCHash, lastQCHash);
|
||||
|
||||
// Fetch definitions and parameters
|
||||
@@ -64,7 +92,7 @@ async function main () {
|
||||
console.log("sequenceCurrentHash", sequenceCurrentHash);
|
||||
console.log("sequenceLastQCHash", sequenceLastQCHash);
|
||||
|
||||
if (sequenceCurrentHash != sequenceLastQCHash) {
|
||||
if (sequenceCurrentHash != sequenceLastQCHash || forceQC(projectId, sequenceNumber)) {
|
||||
|
||||
const results = await runShotsQC(projectId, sequenceNumber, shotQCs, parameters);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user