[Webkit-unassigned] [Bug 168962] Add the ability to report a commit with sub-commits.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Mar 4 00:25:32 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=168962

Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #303388|review?                     |review+
              Flags|                            |

--- Comment #4 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 303388
  --> https://bugs.webkit.org/attachment.cgi?id=303388
Patch

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

> Websites/perf.webkit.org/ChangeLog:18
> +            CREATE UNIQUE INDEX repository_name_unique_index ON repositories (repository_name) WHERE repository_owner IS NOT NULL;

Please also fix this to say "IS NULL".

> Websites/perf.webkit.org/init-database.sql:48
> +WHERE repository_owner IS NOT NULL;

Nit: indent WHERE by 4 spaces.

> Websites/perf.webkit.org/init-database.sql:50
> +WHERE repository_owner IS NOT NULL;

Ditto. This should be WHERE repository_owner IS NULL;

> Websites/perf.webkit.org/public/api/report-commits.php:5
> -function main($post_data) {
> +function insert_commit($db, $commit_info, $repository_id, $owner_commit_id)

Please put this after main before calling main so that they appear in the order of execution.

> Websites/perf.webkit.org/public/api/report-commits.php:76
> +        $owner_repository_id = $db->select_or_insert_repository_row($commit_info['repository'], NULL);
> +        if (!$owner_repository_id) {

I think we should keep this repository_id. It's confusing to talk about owner_repository_id when we're in the midst of inserting the owner itself.

> Websites/perf.webkit.org/public/api/report-commits.php:80
> +        $owner_commit_id = insert_commit($db, $commit_info, $owner_repository_id, NULL);

Ditto about keeping this just commit_id.

> Websites/perf.webkit.org/public/include/db.php:190
> +    // FIXME: Should improve _select_update_or_insert_row to handle the NULL column case.

Nit: there should be a blank line above this comment.

> Websites/perf.webkit.org/public/include/db.php:193
> +        $condition = $repository_owner_id != NULL ? '(repository_name, repository_owner) = ($1, $2)' : 'repository_name = $1 AND repository_owner IS NULL';

I think it's cleaner to rewrite this function where we just have two set of queries for when repository_owner_id is null and when it's not.

> Websites/perf.webkit.org/public/include/db.php:204
> +
>  

Nit: two blank lines here.

> Websites/perf.webkit.org/server-tests/admin-reprocess-report-tests.js:42
> +                }

Just place this curly bracket at the end of the pervious line.

> Websites/perf.webkit.org/server-tests/admin-reprocess-report-tests.js:56
> +            assert.equal(repositories.length, 2);

You should assert that the only commit that you can get is assigned to the second repository we just inserted.

> Websites/perf.webkit.org/server-tests/api-manifest.js:315
> +            let webkit1 = Repository.findById(101);

Why don't we call this osWebkit or instead of webkit1?

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:81
> +    const systemVersionCommitWithSubcommits = {

Please move this to where it's used.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:180
> +    const sameRepositoryNameInSubCommitAndMajorCommit = {

It's better to have this right next to the test.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:419
> +    it("should distinguish between repository with same name but different owner", function (done) {

Nit: repositories with the asme name but with a different owner.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:429
> +            let webkitRepository0 = result[0];
> +            let webkitRepository1 = result[1];

I think we should call one of the osWebKit or something.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:433
> +            done();

You should verify that each commit is associated with the right repositories.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:444
> +                db.selectRows('commits', {'message': 'WebKit Commit'}),

We should get the list of all commits for WebKit and verify that we have exactly one commit for WebKit.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:457
> +            const osxCommit = result[0][0];

Move each of these right next to where length is asserted so that when one of them fails, it's clear which one it is.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:464
> +            assert.notEqual(osxCommit, null);

Also move these next to where the variable is declared so that they're next to each other.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:480
> +            const ownerCommitForWebKitCommit = result[0][0];

Ditto.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:496
> +                db.selectRows('commits', {'message': 'WebKit Commit'}),

Please check the number of commits here again.

> Websites/perf.webkit.org/server-tests/api-report-commits-tests.js:568
> +            assert.equal(commits.length, 1);

Please assert that the one commit we have is for the OS.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170304/3e8f9408/attachment-0001.html>


More information about the webkit-unassigned mailing list