public async getSuitableConfigurations()

in src/dal/remotebuildserver.ts [90:114]


    public async getSuitableConfigurations(filesFromPatch: string[]): Promise<string[]> {
        const client: any = await this.createAndInitClient();
        const changedFiles: string[] = [];
        //Sometimes filePaths contain incorrect backslash symbols.
        filesFromPatch.forEach((row) => {
            changedFiles.push(row.replace(/\\/g, "/"));
        });
        Logger.logDebug(`RemoteBuildServer#requestConfigIds: changedFiles: ${changedFiles.join(";")}`);
        return new Promise<string[]>((resolve, reject) => {
            client.methodCall("VersionControlServer.getSuitableConfigurations", [changedFiles], (err, configurationId) => {
                if (err) {
                    err = err.code === ("ENOENT" || "ENOTFOUND") ? MessageConstants.URL_NOT_REACHABLE : err;
                    Logger.logError("VersionControlServer.getSuitableConfigurations failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!configurationId) {
                    Logger.logError("VersionControlServer.getSuitableConfigurations: configurationId is unexpectedly empty " + new Error().stack);
                    return reject("Configuration ids is unexpectedly empty");
                }

                Logger.logDebug(`[RemoteBuildServer#requestConfigIds: changedFiles] was found ${configurationId.length}\n` +
                    `Suitable configuration loaded ID's: ${configurationId.join(";")}`);
                resolve(configurationId);
            });
        });
    }