Bug 207684 - Stub repositories fail to upload some results due to missing head svn revision
Summary: Stub repositories fail to upload some results due to missing head svn revision
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matt Lewis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-12 23:15 PST by Matt Lewis
Modified: 2020-02-21 10:08 PST (History)
5 users (show)

See Also:


Attachments
Patch (10.60 KB, patch)
2020-02-13 08:37 PST, Matt Lewis
no flags Details | Formatted Diff | Diff
Patch (5.93 KB, patch)
2020-02-18 11:43 PST, Matt Lewis
no flags Details | Formatted Diff | Diff
Patch (9.05 KB, patch)
2020-02-20 10:23 PST, Matt Lewis
no flags Details | Formatted Diff | Diff
Patch (6.83 KB, patch)
2020-02-20 15:22 PST, Matt Lewis
no flags Details | Formatted Diff | Diff
Patch (6.48 KB, patch)
2020-02-20 15:50 PST, Matt Lewis
jbedard: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Lewis 2020-02-12 23:15:12 PST
Currently we fail to upload some results when running tests from a stub repository because we expect to be able to get the head for a given svn checkout. We need to make it possible to get this information from the checkout_information.json

I'm proposing we just add an additional entry to the json for 'head': '<revision>' to help with getting the required information.
Comment 1 Radar WebKit Bug Importer 2020-02-12 23:15:25 PST
<rdar://problem/59414903>
Comment 2 Matt Lewis 2020-02-13 08:37:59 PST
Created attachment 390649 [details]
Patch

I believe this should fix the issues while maintaining functionality.
Comment 3 Jonathan Bedard 2020-02-13 10:10:07 PST
Comment on attachment 390649 [details]
Patch

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

> Tools/Scripts/webkitpy/common/checkout/scm/git.py:295
> +        return self.svn_revision(path)

I'm a bit confused. What does webkitpy think the difference between a head revision and the svn revision is?

> Tools/Scripts/webkitpy/common/checkout/scm/stub_repository.py:70
> +        return self._find_parent_path_matching_callback_condition(path, lambda path: self._decode_json(path)['head'], filesystem=self._filesystem)

I think that the if you don't have a HEAD in the json, you should default to the native_revision(...)
Comment 4 Matt Lewis 2020-02-17 11:23:08 PST
We discovered that there is a better way to fix this issue than the proposed one due to the outdated code. As such a slightly bigger change is needed.
Comment 5 Matt Lewis 2020-02-18 11:43:01 PST
Created attachment 391073 [details]
Patch

Though this doesn't seem like a large change, this has a bigger impact. In multiple spots we are determining our root directory off the actual host running the test suites. This basically made our unit test for certain areas using the mock filesystem and SCMs worthless.
Comment 6 Jonathan Bedard 2020-02-18 12:08:43 PST
Comment on attachment 391073 [details]
Patch

Matt and I talked about this change this morning. This looks correct, although we should be careful landing because fully testing upload changes is difficult, I know we've been bitten by that a few times in the last 2-3 months.
Comment 7 Matt Lewis 2020-02-18 12:17:42 PST
Committed r256851: <https://trac.webkit.org/changeset/256851>
Comment 8 Ryan Haddad 2020-02-18 17:16:16 PST
Reverted r256851 for reason:

Broke internal bots

Committed r256894: <https://trac.webkit.org/changeset/256894>
Comment 9 Ryan Haddad 2020-02-18 17:16:37 PST
(In reply to Ryan Haddad from comment #8)
> Reverted r256851 for reason:
> 
> Broke internal bots
> 
> Committed r256894: <https://trac.webkit.org/changeset/256894>
Details in radar.
Comment 10 Matt Lewis 2020-02-20 10:23:11 PST
Created attachment 391302 [details]
Patch

Still needs testing.
Comment 11 Matt Lewis 2020-02-20 11:13:33 PST
Comment on attachment 391302 [details]
Patch

Testing show this should work.
Comment 12 Jonathan Bedard 2020-02-20 13:20:59 PST
Comment on attachment 391302 [details]
Patch

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

I don't think we have correctness issues anymore.

I think we need to think about script performance for a moment, though. initialie_scm() is a relatively expensive call and should be avoided unless we really need it.

> Tools/Scripts/webkitpy/api_tests/run_api_tests.py:44
> +    host.initialize_scm()

Do we actually need this?

It's a relatively expensive call, this patch means that we're running it even when we pass --help.

> Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:67
> +        host.initialize_scm()

What happens if we call this twice in a test run? Does the function actually run twice?

I ask because initializing the sum is actually a relatively expensive task, it feels like we should reserve it for the commits_for_upload call.

> Tools/Scripts/webkitpy/test/main.py:61
> +    _webkit_root = _host.scm().checkout_root

I know I r+ed something like this earlier, but I wonder if we're actually making the right call here.

We don't need the SCM to run the tests, we only need it for reporting. If we want to make changes to this file, I think we should do it in another patch. This change (in my opinion) would make things worse in test-webkitpy.
Comment 13 Matt Lewis 2020-02-20 15:22:43 PST
Created attachment 391341 [details]
Patch

Still needs testing.
Comment 14 Matt Lewis 2020-02-20 15:50:33 PST
Created attachment 391348 [details]
Patch

Good point about the initialize stuff. We now only call it when uploading. Unfortunately we still have to detect the SCM per repo to get the right type, but this allows it to work in all types of SCMs that we might be using, or lack there of.I think we got it this time.
Comment 15 Jonathan Bedard 2020-02-20 16:51:28 PST
Comment on attachment 391348 [details]
Patch

I talked to Matt about this offline, he's going to refrain landing it until tomorrow morning.
Comment 16 Matt Lewis 2020-02-21 10:08:23 PST
Committed r257144: <https://trac.webkit.org/changeset/257144>