Changeset 240104 in webkit
- Timestamp:
- Jan 16, 2019, 9:56:18 PM (8 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 1 added
- 6 edited
-
ChangeLog (modified) (1 diff)
-
browser-tests/custom-analysis-task-configurator-tests.js (added)
-
browser-tests/index.html (modified) (1 diff)
-
init-database.sql (modified) (1 diff)
-
public/v3/components/custom-analysis-task-configurator.js (modified) (15 diffs)
-
public/v3/components/customizable-test-group-form.js (modified) (4 diffs)
-
public/v3/models/commit-set.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r239485 r240104 1 2018-12-21 Dewei Zhu <dewei_zhu@apple.com> 2 3 Add UI in analysis task page to show commit testability information. 4 https://bugs.webkit.org/show_bug.cgi?id=192972 5 6 Reviewed by Ryosuke Niwa. 7 8 Add UI in custom analysis task configuration and customizable test group form to show testability information. 9 Fix a bug in 'CustomAnalysisTaskConfigurator._updateCommitSetMap' that 'currentComparison' is incorrectly set. 10 SQL to update existing database: 11 ALTER TABLE commits ADD COLUMN IF NOT EXISTS commit_testability varchar(128) DEFAULT NULL; 12 13 * browser-tests/custom-analysis-task-configurator-tests.js: Added a unit test for the bug in 14 'CustomAnalysisTaskConfigurator._updateCommitSetMap'. 15 Added a unit test to make sure 'CustomAnalysisTaskConfigurator' still works when commit fetching never returns. 16 * browser-tests/index.html: Imported ''custom-analysis-task-configurator-tests.js'. 17 * init-database.sql: Increase 'commit_testability' field length from 64 characters to 128. 18 * public/v3/components/custom-analysis-task-configurator.js: Added UI to show testability information. 19 (CustomAnalysisTaskConfigurator): 20 (CustomAnalysisTaskConfigurator.prototype._didUpdateSelectedPlatforms): Should reset related field for corresponding 21 repositories that user does not specify revision. 22 (CustomAnalysisTaskConfigurator.prototype._updateMapFromSpecifiedRevisionsForConfiguration): A helper function 23 to update '_specifiedCommits' and '_invalidRevisionsByConfiguration' per '_specifiedRevisions'. 24 (CustomAnalysisTaskConfigurator.prototype.render): 25 (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Fixed a bug that 'currentComparison' is incorrectly set. 26 (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): 27 (CustomAnalysisTaskConfigurator.prototype.async._fetchCommitsForConfiguration): 28 (CustomAnalysisTaskConfigurator.prototype.async._resolveRevision): 29 (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): 30 (CustomAnalysisTaskConfigurator.prototype._buildTestabilityList): 31 (CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup): 32 (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): 33 (CustomAnalysisTaskConfigurator.cssTemplate): 34 * public/v3/components/customizable-test-group-form.js: Added UI to show testability information. 35 (CustomizableTestGroupForm.prototype._renderCustomRevisionTable): 36 (CustomizableTestGroupForm.prototype._constructTestabilityRows.): 37 (CustomizableTestGroupForm.prototype._constructTestabilityRows): 38 (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): 39 Changing either revision editor or radio button should trigger a re-render as testability 40 information for updated revision may change. 41 (CustomizableTestGroupForm.cssTemplate): 42 * public/v3/models/commit-set.js: 43 (IntermediateCommitSet.prototype.commitsWithTestability): Renamed from 'commitsWithTestabilityWarnings'. 44 (IntermediateCommitSet.prototype.commitsWithTestabilityWarnings): Deleted. 45 1 46 2018-12-14 Dewei Zhu <dewei_zhu@apple.com> 2 47 -
trunk/Websites/perf.webkit.org/browser-tests/index.html
r237915 r240104 28 28 <script src="commit-log-viewer-tests.js"></script> 29 29 <script src="test-group-form-tests.js"></script> 30 <script src="custom-analysis-task-configurator-tests.js"></script> 30 31 <script src="customizable-test-group-form-tests.js"></script> 31 32 <script src="markup-page-tests.js"></script> -
trunk/Websites/perf.webkit.org/init-database.sql
r239485 r240104 102 102 commit_message text, 103 103 commit_reported boolean NOT NULL DEFAULT FALSE, 104 commit_testability varchar( 64) DEFAULT NULL,104 commit_testability varchar(128) DEFAULT NULL, 105 105 CONSTRAINT commit_in_repository_must_be_unique UNIQUE(commit_repository, commit_revision)); 106 106 CREATE INDEX commit_time_index ON commits(commit_time); -
trunk/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js
r230666 r240104 8 8 this._triggerablePlatforms = []; 9 9 this._selectedPlatform = null; 10 this._configurationNames = ['Baseline', 'Comparison'];11 10 this._showComparison = false; 12 11 this._commitSetMap = {}; … … 14 13 this._patchUploaders = {'Baseline': new Map, 'Comparison': new Map}; 15 14 this._customRootUploaders = {'Baseline': null, 'Comparison': null}; 16 this._fetched Revisions = {'Baseline': new Map, 'Comparison': new Map};15 this._fetchedCommits = {'Baseline': new Map, 'Comparison': new Map}; 17 16 this._repositoryGroupByConfiguration = {'Baseline': null, 'Comparison': null}; 17 this._invalidRevisionsByConfiguration = {'Baseline': new Map, 'Comparison': new Map}; 18 18 19 this._updateTriggerableLazily = new LazilyEvaluatedFunction(this._updateTriggerable.bind(this)); 19 20 20 this._renderTriggerableTestsLazily = new LazilyEvaluatedFunction(this._renderTriggerableTests.bind(this)); 21 21 this._renderTriggerablePlatformsLazily = new LazilyEvaluatedFunction(this._renderTriggerablePlatforms.bind(this)); … … 56 56 _didUpdateSelectedPlatforms() 57 57 { 58 for (const configuration of ['Baseline', 'Comparison']) { 59 this._updateMapFromSpecifiedRevisionsForConfiguration(this._fetchedCommits, configuration); 60 this._updateMapFromSpecifiedRevisionsForConfiguration(this._invalidRevisionsByConfiguration, configuration); 61 } 58 62 this._updateCommitSetMap(); 59 60 63 this.enqueueToRender(); 64 } 65 66 _updateMapFromSpecifiedRevisionsForConfiguration(map, configuration) 67 { 68 const referenceMap = this._specifiedRevisions[configuration]; 69 const newValue = new Map; 70 for (const [key, value] of map[configuration].entries()) { 71 if (!referenceMap.has(key)) 72 continue; 73 newValue.set(key, value); 74 } 75 if (newValue.size !== map[configuration].size) 76 map[configuration] = newValue; 61 77 } 62 78 … … 191 207 192 208 this._renderRepositoryPanesLazily.evaluate(triggerable, error, this._selectedPlatform, this._repositoryGroupByConfiguration, this._showComparison); 209 210 this.renderReplace(this.content('baseline-testability'), this._buildTestabilityList(this._commitSetMap['Baseline'], 211 'Baseline', this._invalidRevisionsByConfiguration['Baseline'])); 212 213 this.renderReplace(this.content('comparison-testability'), !this._showComparison ? null : 214 this._buildTestabilityList(this._commitSetMap['Comparison'], 'Comparison', this._invalidRevisionsByConfiguration['Comparison'])); 193 215 } 194 216 … … 305 327 306 328 const currentBaseline = this._commitSetMap['Baseline']; 307 const currentComparison = this._commitSetMap[' Baseline'];308 if (newBaseline == currentBaseline && newComparison == currentComparison)309 return; // Both of them are null.310 311 if (newBaseline && currentBaseline && newBaseline.equals(currentBaseline) 312 && newComparison && currentComparison && newComparison.equals(currentComparison))329 const currentComparison = this._commitSetMap['Comparison']; 330 const areCommitSetsEqual = (commitSetA, commitSetB) => commitSetA == commitSetB || (commitSetA && commitSetB && commitSetA.equals(commitSetB)); 331 const sameBaselineConfig = areCommitSetsEqual(currentBaseline, newBaseline); 332 const sameComparisionConfig = areCommitSetsEqual(currentComparison, newComparison); 333 334 if (sameBaselineConfig && sameComparisionConfig) 313 335 return; 314 336 … … 332 354 for (let repository of repositoryGroup.repositories()) { 333 355 let revision = this._specifiedRevisions[configurationName].get(repository); 334 if (!revision) 335 revision = this._fetchedRevisions[configurationName].get(repository); 356 if (!revision) { 357 const commit = this._fetchedCommits[configurationName].get(repository); 358 if (commit) 359 revision = commit.revision(); 360 } 336 361 if (!revision) 337 362 return null; … … 356 381 } 357 382 383 async _fetchCommitsForConfiguration(configurationName) 384 { 385 const commitSet = this._commitSetMap[configurationName]; 386 if (!commitSet) 387 return; 388 389 const specifiedRevisions = this._specifiedRevisions[configurationName]; 390 const fetchedCommits = this._fetchedCommits[configurationName]; 391 const invalidRevisionForRepository = this._invalidRevisionsByConfiguration[configurationName]; 392 393 await Promise.all(Array.from(commitSet.repositories()).map((repository) => { 394 const revision = commitSet.revisionForRepository(repository); 395 return this._resolveRevision(repository, revision, specifiedRevisions, invalidRevisionForRepository, fetchedCommits); 396 })); 397 398 const latestCommitSet = this._commitSetMap[configurationName]; 399 if (commitSet != latestCommitSet) 400 return; 401 this.enqueueToRender(); 402 } 403 404 async _resolveRevision(repository, revision, specifiedRevisions, invalidRevisionForRepository, fetchedCommits) 405 { 406 const fetchedCommit = fetchedCommits.get(repository); 407 if (fetchedCommit && fetchedCommit.revision() == revision) 408 return; 409 410 fetchedCommits.delete(repository); 411 let commits = []; 412 try { 413 commits = await CommitLog.fetchForSingleRevision(repository, revision); 414 } catch (error) { 415 console.assert(error == 'UnknownCommit'); 416 if (revision != specifiedRevisions.get(repository)) 417 return; 418 invalidRevisionForRepository.set(repository, revision); 419 return; 420 } 421 console.assert(commits.length, 1); 422 if (revision != specifiedRevisions.get(repository)) 423 return; 424 invalidRevisionForRepository.delete(repository); 425 fetchedCommits.set(repository, commits[0]); 426 } 427 358 428 _renderRepositoryPanes(triggerable, error, platform, repositoryGroupByConfiguration, showComparison) 359 429 { … … 415 485 { 416 486 const element = ComponentBase.createElement; 417 const link = ComponentBase.createLink;418 487 419 488 const customRootsTBody = element('tbody', [ … … 454 523 } 455 524 525 _buildTestabilityList(commitSet, configurationName, invalidRevisionForRepository) 526 { 527 const element = ComponentBase.createElement; 528 const entries = []; 529 530 if (!commitSet || !commitSet.repositories().length) 531 return []; 532 533 for (const repository of commitSet.repositories()) { 534 const commit = this._fetchedCommits[configurationName].get(repository); 535 if (commit && commit.testability() && !invalidRevisionForRepository.has(repository)) 536 entries.push(element('li', `${commit.repository().name()} - "${commit.label()}": ${commit.testability()}`)); 537 if (invalidRevisionForRepository.has(repository)) 538 entries.push(element('li', `${repository.name()} - "${invalidRevisionForRepository.get(repository)}": Invalid revision`)); 539 } 540 541 return entries; 542 } 543 456 544 _buildRepositoryGroupList(repositoryGroups, currentGroup, configurationName) 457 545 { … … 477 565 this._repositoryGroupByConfiguration = clone; 478 566 this._updateCommitSetMap(); 567 this._fetchCommitsForConfiguration(configurationName); 479 568 this.enqueueToRender(); 480 569 } … … 484 573 const revision = this._specifiedRevisions[configurationName].get(repository) || ''; 485 574 const element = ComponentBase.createElement; 575 let scheduledUpdate = null; 486 576 const input = element('input', {value: revision, oninput: () => { 487 577 unmodifiedInput = null; 488 this._specifiedRevisions[configurationName].set(repository, input.value); 578 const revisionToFetch = input.value; 579 this._specifiedRevisions[configurationName].set(repository, revisionToFetch); 489 580 this._updateCommitSetMap(); 581 if (scheduledUpdate) 582 clearTimeout(scheduledUpdate); 583 scheduledUpdate = setTimeout(() => { 584 if (revisionToFetch == input.value) 585 this._fetchCommitsForConfiguration(configurationName); 586 scheduledUpdate = null; 587 }, CustomAnalysisTaskConfigurator.commitFetchInterval); 490 588 }}); 491 589 let unmodifiedInput = input; … … 495 593 if (commit && unmodifiedInput) { 496 594 unmodifiedInput.value = commit.revision(); 497 this._fetched Revisions[configurationName].set(repository, commit.revision());595 this._fetchedCommits[configurationName].set(repository, commit); 498 596 this._updateCommitSetMap(); 499 597 } … … 522 620 <h2>3. Configure Baseline</h2> 523 621 <table id="baseline-revision-table" class="revision-table"></table> 622 <ul id="baseline-testability"></ul> 524 623 </section> 525 624 <section id="specify-comparison-pane" class="pane"> … … 529 628 <h2>4. Configure Comparison</h2> 530 629 <table id="comparison-revision-table" class="revision-table"></table> 630 <ul id="comparison-testability"></ul> 531 631 </section>`; 532 632 } … … 675 775 font-weight: inherit; 676 776 } 777 778 #baseline-testability li, 779 #comparison-testability li { 780 color: #c33; 781 width: 20rem; 782 } 677 783 `; 678 784 } 679 785 } 680 786 787 CustomAnalysisTaskConfigurator.commitFetchInterval = 100; 788 681 789 ComponentBase.defineElement('custom-analysis-task-configurator', CustomAnalysisTaskConfigurator); -
trunk/Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js
r237950 r240104 136 136 element('tr', 137 137 [element('td', {colspan: 2}, 'Repository'), commitSetLabels.map((label) => element('td', {colspan: commitSetLabels.length + 1}, label)), element('td')])), 138 this._constructTableBodyList(repositoryList, commitSetMap, ownedRepositoriesByRepository, this._hasIncompleteOwnedRepository, uncustomizedCommitSetMap)]); 138 this._constructTableBodyList(repositoryList, commitSetMap, ownedRepositoriesByRepository, this._hasIncompleteOwnedRepository, uncustomizedCommitSetMap), 139 this._constructTestabilityRows(commitSetMap)]); 140 } 141 142 _constructTestabilityRows(commitSetMap) 143 { 144 const element = ComponentBase.createElement; 145 146 const commitSets = Array.from(commitSetMap.values()); 147 const hasCommitWithTestability = commitSets.some((commitSet) => !!commitSet.commitsWithTestability().length); 148 for (const c of commitSets) { 149 if (c.commitsWithTestability().length) 150 console.log(c); 151 } 152 console.log({hasCommitWithTestability}); 153 console.log('aaaa'); 154 if (!hasCommitWithTestability) 155 return []; 156 157 const testabilityCells = []; 158 for (const commitSet of commitSetMap.values()) { 159 const entries = commitSet.commitsWithTestability().map((commit) => 160 element('li', `${commit.title()}: ${commit.testability()}`)); 161 testabilityCells.push(element('td', {colspan: commitSetMap.size + 1, class: 'testability'}, element('ul', entries))); 162 } 163 164 return element('tbody', element('tr', [element('td', {colspan: 2}), testabilityCells, element('td')])); 139 165 } 140 166 … … 256 282 if (ownerRepository) 257 283 return; 258 259 commitSetMap.get(columnLabel).updateRevisionForOwnerRepository(repository, revisionEditor.value).catch(284 commitSetMap.get(columnLabel).updateRevisionForOwnerRepository(repository, revisionEditor.value).then( 285 () => this.enqueueToRender(), 260 286 () => { 261 287 alert(`"${revisionEditor.value}" does not exist in "${repository.name()}".`); … … 279 305 if (uncustomizedCommit && uncustomizedCommit.ownerCommit()) 280 306 this._ownerRevisionMap.get(columnLabel).set(repository, uncustomizedCommit.ownerCommit().revision()); 307 this.enqueueToRender(); 281 308 }}); 282 309 nodes.push(element('td', element('label', [radioButton, labelToChoose]))); … … 337 364 margin-left: 0.4rem; 338 365 } 366 367 #custom-table td.testability { 368 vertical-align: top; 369 } 370 371 #custom-table td.testability ul { 372 text-align: left; 373 color: #c33; 374 max-width: 13rem; 375 margin: 0 0 0 1rem; 376 padding: 0; 377 } 339 378 `; 340 379 } -
trunk/Websites/perf.webkit.org/public/v3/models/commit-set.js
r239485 r240104 390 390 } 391 391 392 commitsWithTestability Warnings() { return this.commits().filter((commit) => !!commit.testabilityWarning()); }392 commitsWithTestability() { return this.commits().filter((commit) => !!commit.testability()); } 393 393 commits() { return Array.from(this._commitByRepository.values()); } 394 394
Note:
See TracChangeset
for help on using the changeset viewer.