public async exec()

in src/bll/commands/remoterun.ts [31:68]


    public async exec(args?: any[]): Promise<void> {
        if (!args || args.length !== 1) {
            Logger.logError("RemoteRun#exec: incorrect arguments");
        }
        const isPreTestedCommit: boolean = !!args[0];

        Logger.logInfo("RemoteRun#exec: Personal Build started");
        const buildConfigs: BuildConfig[] = this.buildProvider.getSelectedContent();
        const checkInArray: CheckInInfo[] = this.resourceProvider.getSelectedContent();
        if (!buildConfigs || buildConfigs.length === 0) {
            return Promise.reject(MessageConstants.NO_CONFIGS_RUN_REMOTERUN);
        }

        const patchAbsPath: string = await this.patchManager.preparePatch(checkInArray);
        const message: string = await this.requestForCommitMessageIfRequired(checkInArray);
        this.fillCommitMessage(checkInArray, message);

        this.resourceProvider.resetTreeContent();
        this.buildProvider.resetTreeContent();
        this.providerManager.showChangesProvider();
        this.showMyChangesCommand.exec([true]).then(() => {
            this.providerManager.refreshAll();
            this.providerManager.showChangesProvider();
        });

        const queuedBuilds: QueuedBuild[] = await this.patchSender.sendPatch(buildConfigs, patchAbsPath, message);
        const changeListStatus: ChangeListStatus = await this.patchSender.waitForChangeFinish(queuedBuilds);

        if (changeListStatus === ChangeListStatus.CHECKED) {
            Logger.logInfo("RemoteRun#exec: Personal Build is successful");
            if (isPreTestedCommit) {
                return this.cvsProvider.requestForPostCommit(checkInArray);
            }
        } else {
            Logger.logWarning("RemoteRun#exec: Personal Build failed");
            return Promise.reject("Personal Build failed");
        }
    }