Skip to content
Snippets Groups Projects

fix: prevent reviewer from pushing code or updating time spent

Merged Guillaume WEBER requested to merge fix-restrict_reviwer_push_code into master
All threads resolved!
1 file
+ 11
8
Compare changes
  • Side-by-side
  • Inline
@@ -9,6 +9,7 @@ import { queue } from 'async';
import { extensionWarn, recorderError as error, recorderLog as log } from './log';
import { clearFilesExceptGit, copyGitUserFiles } from './workdir';
import { copyFile } from 'fs/promises';
import UserMission from '../../core/mission/model/userMission';
const { readFile } = promises;
@@ -17,14 +18,16 @@ const gitQueue = queue(async (task: CallableFunction) => {
}, 1);
export async function commitAndPushOnQueue(gitMission: GitMission, from: 'Run' | 'Auto' | 'HttpServer') {
if (from === 'Run') {
gitQueue.push(async () => {
await mergeMaster(gitMission);
});
} else if (gitQueue.length() == 0) {
gitQueue.push(async () => {
await commitAndPushCode(gitMission);
});
if (!UserMission.getInstance().isReviewing()) {
if (from === 'Run') {
gitQueue.push(async () => {
await mergeMaster(gitMission);
});
} else if (gitQueue.length() == 0) {
gitQueue.push(async () => {
await commitAndPushCode(gitMission);
});
}
}
}
Loading