WebKit Bugzilla
Attachment 357925 Details for
Bug 192972
: Add UI in analysis task page to show commit testability information.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192972-20181220211654.patch (text/plain), 17.69 KB, created by
dewei_zhu
on 2018-12-20 21:16:55 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
dewei_zhu
Created:
2018-12-20 21:16:55 PST
Size:
17.69 KB
patch
obsolete
>Subversion Revision: 239485 >diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog >index 0936909761a24f17dcf3aa9b7a42ee14d24be505..afd375bd680e05f34b309fbab8cb98b109f6a3dc 100644 >--- a/Websites/perf.webkit.org/ChangeLog >+++ b/Websites/perf.webkit.org/ChangeLog >@@ -1,3 +1,38 @@ >+2018-12-20 Dewei Zhu <dewei_zhu@apple.com> >+ >+ Add UI in analysis task page to show commit testability infomation. >+ https://bugs.webkit.org/show_bug.cgi?id=192972 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add UI in custom analysis task configuration and customizable test group form to >+ show testability information. >+ >+ * public/v3/components/custom-analysis-task-configurator.js: Added UI to show testabilty infomation. >+ (CustomAnalysisTaskConfigurator): >+ (CustomAnalysisTaskConfigurator.prototype.render): >+ (CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): >+ Fixed a bug that 'currentComparison' is incorrectly set. >+ Added logic to fetch commits inside a commit set. >+ (CustomAnalysisTaskConfigurator.prototype.async._fetchCommitsForCommitSet): >+ (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): >+ (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): >+ (CustomAnalysisTaskConfigurator.prototype._buildTestabilityTable): >+ (CustomAnalysisTaskConfigurator.prototype._buildRevisionInput): >+ (CustomAnalysisTaskConfigurator.cssTemplate): >+ (CustomAnalysisTaskConfigurator.prototype._buildRepositoryGroupList): Deleted. >+ * public/v3/components/customizable-test-group-form.js: Added UI to show testabilty infomation. >+ (CustomizableTestGroupForm.prototype._renderCustomRevisionTable): >+ (CustomizableTestGroupForm.prototype._constructTestabilityRows.): >+ (CustomizableTestGroupForm.prototype._constructTestabilityRows): >+ (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons): >+ Changing either revision editor or radio button should trigger a re-render as testability >+ information for updated revision may change. >+ (CustomizableTestGroupForm.cssTemplate): >+ * public/v3/models/commit-set.js: >+ (IntermediateCommitSet.prototype.commitsWithTestability): Renamed from 'commitsWithTestabilityWarnings'. >+ (IntermediateCommitSet.prototype.commitsWithTestabilityWarnings): Deleted. >+ > 2018-12-14 Dewei Zhu <dewei_zhu@apple.com> > > Extend commits table to contain testability information. >diff --git a/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js b/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js >index 43f35b7ca5261485c2f8fe4c23f4f47aa3241ef4..8a29c6c1ba59d422b4e8ff3ace6d5c861276d1e0 100644 >--- a/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js >+++ b/Websites/perf.webkit.org/public/v3/components/custom-analysis-task-configurator.js >@@ -7,14 +7,14 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > this._selectedTests = []; > this._triggerablePlatforms = []; > this._selectedPlatform = null; >- this._configurationNames = ['Baseline', 'Comparison']; > this._showComparison = false; > this._commitSetMap = {}; > this._specifiedRevisions = {'Baseline': new Map, 'Comparison': new Map}; > this._patchUploaders = {'Baseline': new Map, 'Comparison': new Map}; > this._customRootUploaders = {'Baseline': null, 'Comparison': null}; >- this._fetchedRevisions = {'Baseline': new Map, 'Comparison': new Map}; >+ this._fetchedCommits = {'Baseline': new Map, 'Comparison': new Map}; > this._repositoryGroupByConfiguration = {'Baseline': null, 'Comparison': null}; >+ this._invalidRevisionForRepositoryByConfiguration = {'Baseline': new Map, 'Comparison': new Map}; > this._updateTriggerableLazily = new LazilyEvaluatedFunction(this._updateTriggerable.bind(this)); > > this._renderTriggerableTestsLazily = new LazilyEvaluatedFunction(this._renderTriggerableTests.bind(this)); >@@ -190,6 +190,11 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > const [triggerable, error] = this._updateTriggerableLazily.evaluate(this._selectedTests, this._selectedPlatform); > > this._renderRepositoryPanesLazily.evaluate(triggerable, error, this._selectedPlatform, this._repositoryGroupByConfiguration, this._showComparison); >+ >+ this.renderReplace(this.content('baseline-testability'), >+ this._buildTestabilityTable(this._commitSetMap['Baseline'], 'Baseline', this._invalidRevisionForRepositoryByConfiguration['Baseline'])); >+ if (this._showComparison) >+ this.renderReplace(this.content('comparison-testability'), this._buildTestabilityTable(this._commitSetMap['Comparison'], 'Comparison', this._invalidRevisionForRepositoryByConfiguration['Comparison'])); > } > > _renderTriggerableTests() >@@ -304,18 +309,57 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > newComparison = null; > > const currentBaseline = this._commitSetMap['Baseline']; >- const currentComparison = this._commitSetMap['Baseline']; >- if (newBaseline == currentBaseline && newComparison == currentComparison) >- return; // Both of them are null. >+ const currentComparison = this._commitSetMap['Comparison']; >+ const areCommitSetsEqual = (commitSetA, commitSetB) => commitSetA == commitSetB || (commitSetA && commitSetB && commitSetA.equals(commitSetB)); >+ const sameBaselineConfig = areCommitSetsEqual(currentBaseline, newBaseline); >+ const sameComparisionConfig = areCommitSetsEqual(currentComparison, newComparison); > >- if (newBaseline && currentBaseline && newBaseline.equals(currentBaseline) >- && newComparison && currentComparison && newComparison.equals(currentComparison)) >+ if (sameBaselineConfig && sameComparisionConfig) > return; > > this._commitSetMap = {'Baseline': newBaseline, 'Comparison': newComparison}; > >- this.dispatchAction('commitSetChange'); >- this.enqueueToRender(); >+ const fetchingPromises = []; >+ if (!sameBaselineConfig) >+ fetchingPromises.push(this._fetchCommitsForCommitSet('Baseline', newBaseline, currentBaseline)); >+ >+ if (!sameComparisionConfig) >+ fetchingPromises.push(this._fetchCommitsForCommitSet('Comparison', newComparison, currentComparison)); >+ >+ return Promise.all(fetchingPromises).then(() => { >+ this.dispatchAction('commitSetChange'); >+ this.enqueueToRender(); >+ }); >+ } >+ >+ async _fetchCommitsForCommitSet(configurationName, commitSet, previousCommitSet) >+ { >+ if (!commitSet) >+ return; >+ >+ const specifiedRevisions = this._specifiedRevisions[configurationName]; >+ const fetchedCommits = this._fetchedCommits[configurationName]; >+ const invalidRevisionForRepository = this._invalidRevisionForRepositoryByConfiguration[configurationName]; >+ const fetchingPromises = []; >+ let hasFetchingFailure = false; >+ for (const repository of commitSet.repositories()) { >+ const revision = commitSet.revisionForRepository(repository); >+ fetchingPromises.push(CommitLog.fetchForSingleRevision(repository, revision).then( >+ (commits) => { >+ console.assert(commits.length, 1); >+ if (revision != specifiedRevisions.get(repository)) >+ return; >+ invalidRevisionForRepository.delete(repository); >+ fetchedCommits.set(repository, commits[0]); >+ }, () => { >+ if (revision != specifiedRevisions.get(repository)) >+ return; >+ invalidRevisionForRepository.set(repository, revision); >+ fetchedCommits.delete(repository); >+ })); >+ } >+ await Promise.all(fetchingPromises); >+ return hasFetchingFailure ? previousCommitSet : commitSet; > } > > _computeCommitSet(configurationName) >@@ -331,8 +375,11 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > const commitSet = new CustomCommitSet; > for (let repository of repositoryGroup.repositories()) { > let revision = this._specifiedRevisions[configurationName].get(repository); >- if (!revision) >- revision = this._fetchedRevisions[configurationName].get(repository); >+ if (!revision) { >+ const commit = this._fetchedCommits[configurationName].get(repository); >+ if (commit) >+ revision = commit.revision(); >+ } > if (!revision) > return null; > let patch = null; >@@ -414,7 +461,6 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > _buildRevisionTable(configurationName, repositoryGroups, currentGroup, platform, requiredRepositories, optionalRepositoryList, alwaysAcceptsCustomRoots) > { > const element = ComponentBase.createElement; >- const link = ComponentBase.createLink; > > const customRootsTBody = element('tbody', [ > element('tr', [ >@@ -453,6 +499,23 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > )]; > } > >+ _buildTestabilityTable(commitSet, configurationName, invalidRevisionForRepository) >+ { >+ const element = ComponentBase.createElement; >+ const rows = []; >+ for (const repository of commitSet ? commitSet.repositories() : []) { >+ const commit = this._fetchedCommits[configurationName].get(repository); >+ if (commit && commit.testability() && !invalidRevisionForRepository.has(repository)) >+ rows.push(element('tr', element('td', `${commit.repository().name()} - ${commit.label()}: ${commit.testability()}`))); >+ if (invalidRevisionForRepository.has(repository)) >+ rows.push(element('tr', element('td', `${repository.name()} - ${invalidRevisionForRepository.get(repository)}: Invalid revision`))); >+ } >+ if (!rows.length) >+ return []; >+ >+ return element('tbody', {class: 'testability-table'}, rows); >+ } >+ > _buildRepositoryGroupList(repositoryGroups, currentGroup, configurationName) > { > const element = ComponentBase.createElement; >@@ -483,10 +546,18 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > { > const revision = this._specifiedRevisions[configurationName].get(repository) || ''; > const element = ComponentBase.createElement; >+ let scheduledUpdate = null; > const input = element('input', {value: revision, oninput: () => { > unmodifiedInput = null; >- this._specifiedRevisions[configurationName].set(repository, input.value); >- this._updateCommitSetMap(); >+ const revisionToFetch = input.value; >+ this._specifiedRevisions[configurationName].set(repository, revisionToFetch); >+ if (scheduledUpdate) >+ clearTimeout(scheduledUpdate); >+ scheduledUpdate = setTimeout(() => { >+ if (revisionToFetch == input.value) >+ this._updateCommitSetMap(); >+ scheduledUpdate = null; >+ }, 300); > }}); > let unmodifiedInput = input; > >@@ -494,7 +565,7 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > CommitLog.fetchLatestCommitForPlatform(repository, platform).then((commit) => { > if (commit && unmodifiedInput) { > unmodifiedInput.value = commit.revision(); >- this._fetchedRevisions[configurationName].set(repository, commit.revision()); >+ this._fetchedCommits[configurationName].set(repository, commit); > this._updateCommitSetMap(); > } > }); >@@ -521,6 +592,7 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > <section id="baseline-configuration-pane" class="pane"> > <h2>3. Configure Baseline</h2> > <table id="baseline-revision-table" class="revision-table"></table> >+ <table id="baseline-testability"></table> > </section> > <section id="specify-comparison-pane" class="pane"> > <button id="specify-comparison-button">Configure to Compare</button> >@@ -528,6 +600,7 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > <section id="comparison-configuration-pane" class="pane"> > <h2>4. Configure Comparison</h2> > <table id="comparison-revision-table" class="revision-table"></table> >+ <table id="comparison-testability"></table> > </section>`; > } > >@@ -674,6 +747,16 @@ class CustomAnalysisTaskConfigurator extends ComponentBase { > font-size: 1.2rem; > font-weight: inherit; > } >+ >+ .testability-table, >+ .testability-table tr, >+ .testability-table td { >+ border: none; >+ border-top: solid 1px #ddd; >+ width: 21rem; >+ text-align: left; >+ color: #c33; >+ } > `; > } > } >diff --git a/Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js b/Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js >index a1cd2dc3e3797cfda9ffb6020b08a02eab62e0d2..e79d9732336459518f4f894ab25c9bd73ac40eea 100644 >--- a/Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js >+++ b/Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js >@@ -135,7 +135,30 @@ class CustomizableTestGroupForm extends TestGroupForm { > element('thead', > element('tr', > [element('td', {colspan: 2}, 'Repository'), commitSetLabels.map((label) => element('td', {colspan: commitSetLabels.length + 1}, label)), element('td')])), >- this._constructTableBodyList(repositoryList, commitSetMap, ownedRepositoriesByRepository, this._hasIncompleteOwnedRepository, uncustomizedCommitSetMap)]); >+ this._constructTableBodyList(repositoryList, commitSetMap, ownedRepositoriesByRepository, this._hasIncompleteOwnedRepository, uncustomizedCommitSetMap), >+ this._constructTestabilityRows(commitSetMap)]); >+ } >+ >+ _constructTestabilityRows(commitSetMap) >+ { >+ const element = ComponentBase.createElement; >+ >+ let hasCommitWithTestability = false; >+ const commitSets = Array.from(commitSetMap.values()); >+ for (const commitSet of commitSets) >+ hasCommitWithTestability |= !!commitSet.commitsWithTestability(); >+ if (!hasCommitWithTestability) >+ return []; >+ >+ >+ const testabilityRows = []; >+ for (const commitSet of commitSetMap.values()) { >+ const rows = commitSet.commitsWithTestability().map((commit) => >+ element('tr', {class: 'testability'}, `${commit.repository().name()} - ${commit.label()}: ${commit.testability()}`)); >+ testabilityRows.push(element('td', {colspan: commitSetMap.size + 1}, rows)); >+ } >+ >+ return element('tbody', element('tr', [element('td', {colspan: 2}), testabilityRows, element('td')])); > } > > _constructTableBodyList(repositoryList, commitSetMap, ownedRepositoriesByRepository, hasIncompleteOwnedRepository, uncustomizedCommitSetMap) >@@ -255,8 +278,8 @@ class CustomizableTestGroupForm extends TestGroupForm { > onchange: () => { > if (ownerRepository) > return; >- >- commitSetMap.get(columnLabel).updateRevisionForOwnerRepository(repository, revisionEditor.value).catch( >+ commitSetMap.get(columnLabel).updateRevisionForOwnerRepository(repository, revisionEditor.value).then( >+ () => this.enqueueToRender(), > () => { > alert(`"${revisionEditor.value}" does not exist in "${repository.name()}".`); > revisionEditor.value = revision; >@@ -278,6 +301,7 @@ class CustomizableTestGroupForm extends TestGroupForm { > revisionEditor.value = uncustomizedCommit ? uncustomizedCommit.revision() : ''; > if (uncustomizedCommit && uncustomizedCommit.ownerCommit()) > this._ownerRevisionMap.get(columnLabel).set(repository, uncustomizedCommit.ownerCommit().revision()); >+ this.enqueueToRender(); > }}); > nodes.push(element('td', element('label', [radioButton, labelToChoose]))); > } >@@ -336,6 +360,11 @@ class CustomizableTestGroupForm extends TestGroupForm { > #notify-on-completion-checkbox { > margin-left: 0.4rem; > } >+ >+ #custom-table tr.testability { >+ text-align: left; >+ color: #c33; >+ } > `; > } > >diff --git a/Websites/perf.webkit.org/public/v3/models/commit-set.js b/Websites/perf.webkit.org/public/v3/models/commit-set.js >index 445b27017f248d9e5ac4c13b8755a0aad5722ca4..bb5b7f198cef39a14d33ffa1803d692f667aa8fa 100644 >--- a/Websites/perf.webkit.org/public/v3/models/commit-set.js >+++ b/Websites/perf.webkit.org/public/v3/models/commit-set.js >@@ -389,7 +389,7 @@ class IntermediateCommitSet { > return Promise.all(fetchingPromises); > } > >- commitsWithTestabilityWarnings() { return this.commits().filter((commit) => !!commit.testabilityWarning()); } >+ commitsWithTestability() { return this.commits().filter((commit) => !!commit.testability()); } > commits() { return Array.from(this._commitByRepository.values()); } > > _fetchCommitLogAndOwnedCommits(repository, revision)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192972
:
357925
|
357926
|
358009
|
358048
|
358860
|
358878