async _createTestGroupAfterVerifyingCommitSetList()

in resources/perf.webkit.org/public/v3/pages/analysis-task-page.js [890:922]


    async _createTestGroupAfterVerifyingCommitSetList(testGroupName, repetitionCount, repetitionType, commitSetMap, notifyOnCompletion)
    {
        if (this._hasDuplicateTestGroupName(testGroupName)) {
            alert(`There is already a test group named "${testGroupName}"`);
            return;
        }

        const firstLabel = Object.keys(commitSetMap)[0];
        const firstCommitSet = commitSetMap[firstLabel];

        for (let currentLabel in commitSetMap) {
            const commitSet = commitSetMap[currentLabel];
            for (let repository of commitSet.repositories()) {
                if (!firstCommitSet.revisionForRepository(repository))
                    return alert(`Set ${currentLabel} specifies ${repository.label()} but set ${firstLabel} does not.`);
            }
            for (let repository of firstCommitSet.repositories()) {
                if (!commitSet.revisionForRepository(repository))
                    return alert(`Set ${firstLabel} specifies ${repository.label()} but set ${currentLabel} does not.`);
            }
        }

        const commitSets = [];
        for (let label in commitSetMap)
            commitSets.push(commitSetMap[label]);

        try {
            const testGroups = await TestGroup.createAndRefetchTestGroups(this._task, testGroupName, repetitionCount, repetitionType, commitSets, notifyOnCompletion);
            return this._didFetchTestGroups(testGroups);
        } catch (error) {
            alert('Failed to create a new test group: ' + error);
        }
    }