Bug 190863 - Customizable test group form should not reset manually edited commit value sometimes.
Summary: Customizable test group form should not reset manually edited commit value so...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: dewei_zhu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-23 22:32 PDT by dewei_zhu
Modified: 2018-11-06 22:34 PST (History)
2 users (show)

See Also:


Attachments
Patch (11.18 KB, patch)
2018-10-23 22:56 PDT, dewei_zhu
no flags Details | Formatted Diff | Diff
Patch (11.56 KB, patch)
2018-11-06 17:37 PST, dewei_zhu
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewei_zhu 2018-10-23 22:32:15 PDT
Customizable test group form should not reset manually edited commit value sometimes.
Comment 1 dewei_zhu 2018-10-23 22:56:42 PDT
Created attachment 353022 [details]
Patch
Comment 2 dewei_zhu 2018-10-23 22:57:37 PDT
rdar://problem/45510389
Comment 3 dewei_zhu 2018-10-23 23:03:37 PDT
Comment on attachment 353022 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353022&action=review

> Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js:255
> +                if (ownerRepository)

The correct logic should be avoid updating commit for repositories with owner.

> Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js:270
> +                    const originalCommit = originalCommitSetMap[labelToChoose].commitForRepository(repository) || commit;

If this repository exists in originalCommitSetMap, we the radio button should set the value from original commit.
Comment 4 Ryosuke Niwa 2018-11-05 19:58:18 PST
Comment on attachment 353022 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353022&action=review

> Websites/perf.webkit.org/ChangeLog:7
> +        After changing the radio button and manually editing the commit value, commit value should not be reset
> +        while changing the name of the test group.

Why don't we add a test for this?
And let's split this patch into two since these two changes are pretty complex.

> Websites/perf.webkit.org/ChangeLog:10
> +        Reviewed by NOBODY (OOPS!).

This line should appear before the long description bug after the bug link.

> Websites/perf.webkit.org/ChangeLog:22
> +        (CustomizableTestGroupForm.prototype._constructRevisionRadioButtons):

Let's add a comment saying that this code change is the one which fixes the toggling A/B would not update the commit set.

> Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js:20
> +        this._originalCommitSetMap = map;

How about uncustomizedCommitSetMap to match the terminology?

> Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js:258
> +                commitSetMap.get(columnLabel).updateRevisionForOwnerRepository(repository, revisionEditor.value).catch(
>                      () => revisionEditor.value = '');

This needs to be updated to revert to the old value.
We should probably warn the user that the specified revision doesn't exist with a nice error message.
Comment 5 dewei_zhu 2018-11-06 17:37:45 PST
Created attachment 354038 [details]
Patch
Comment 6 Ryosuke Niwa 2018-11-06 18:04:01 PST
Comment on attachment 354038 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=354038&action=review

> Websites/perf.webkit.org/browser-tests/customizable-test-group-form-tests.js:78
> +        let revisionEditors = customizableTestGroupForm.content('custom-table').querySelectorAll('input:not([type="radio"])');
> +        expect(revisionEditors.length).to.be(2);
> +        let revisionEditor = revisionEditors[0];

Use const?

> Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js:259
> +                        alert(`Commit "${revisionEditor.value}" from "${repository.name()}" does not exits.`);

I think a better error message would be `"${revisionEditor.value}" doesn't exist in "${repository.name()}"`.
Saying that it's a commit is both redundant for regular repositories and erroneous for OS versions.
Comment 7 dewei_zhu 2018-11-06 18:23:48 PST
Comment on attachment 354038 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=354038&action=review

>> Websites/perf.webkit.org/browser-tests/customizable-test-group-form-tests.js:78
>> +        let revisionEditor = revisionEditors[0];
> 
> Use const?

We need to querySelect another revision editor after form gets re-rendered. Line 89 re-assigned it.

>> Websites/perf.webkit.org/public/v3/components/customizable-test-group-form.js:259
>> +                        alert(`Commit "${revisionEditor.value}" from "${repository.name()}" does not exits.`);
> 
> I think a better error message would be `"${revisionEditor.value}" doesn't exist in "${repository.name()}"`.
> Saying that it's a commit is both redundant for regular repositories and erroneous for OS versions.

Sure.
Comment 8 dewei_zhu 2018-11-06 21:58:48 PST
Landed in r237915.
Comment 9 dewei_zhu 2018-11-06 22:34:04 PST
rdar://problem/45510389