Bug 200718 - results.webkit.org: Add database table to save zip archives to
Summary: results.webkit.org: Add database table to save zip archives to
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-14 09:02 PDT by Jonathan Bedard
Modified: 2019-08-21 17:24 PDT (History)
7 users (show)

See Also:


Attachments
Patch (23.48 KB, patch)
2019-08-14 09:16 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (23.25 KB, patch)
2019-08-21 08:18 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (23.56 KB, patch)
2019-08-21 14:39 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2019-08-14 09:02:49 PDT
We should have a table in Cassandra which stores zip archives associated with a test run.
Comment 1 Jonathan Bedard 2019-08-14 09:16:52 PDT
Created attachment 376270 [details]
Patch
Comment 2 Kocsen Chung 2019-08-20 14:23:24 PDT
Comment on attachment 376270 [details]
Patch

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

> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:101
> +                    ttl=int((uuid // Commit.TIMESTAMP_TO_UUID_MULTIPLIER) + self.ttl_seconds - time.time()) if self.ttl_seconds else None,

Seems repeated code from initial `ttl` declaration above.
Comment 3 Jonathan Bedard 2019-08-20 15:10:54 PDT
Comment on attachment 376270 [details]
Patch

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

>> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:101
>> +                    ttl=int((uuid // Commit.TIMESTAMP_TO_UUID_MULTIPLIER) + self.ttl_seconds - time.time()) if self.ttl_seconds else None,
> 
> Seems repeated code from initial `ttl` declaration above.

It would seem like that....I'll change it.
Comment 4 Jonathan Bedard 2019-08-21 08:18:51 PDT
Created attachment 376884 [details]
Patch
Comment 5 Aakash Jain 2019-08-21 13:46:57 PDT
Comment on attachment 376884 [details]
Patch

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

rs=me

> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:37
> +    DEFAULT_LIMIT = 10

DEFAULT_LIMIT for? Can rename it to be more expressive.

> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:74
> +            self.cassandra.create_table(self.ArchivesByCommit)

Just to confirm, we won't be creating a new table each time we instantiate this class, right?

> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:89
> +        if isinstance(timestamp, datetime):

can we use the get_time() method here as well?

> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:90
> +            timestamp = calendar.timegm(timestamp.timetuple())

why do we use timestamp.timetuple() here but not inside get_time() method?

> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:119
> +        def get_time(time):

you might consider making this stand-alone method(_get_time()), outside find_archive(). Also renaming the parameter 'time' to something like 'input_time' might be more clear.

> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:122
> +            elif time:

should convert this elif to if, since previous if has a corresponding 'return' statement.

> Tools/resultsdbpy/resultsdbpy/model/mock_model_factory.py:185
> +            old = current - 60 * 60 * 24 * 21

can we store 60 * 60 * 24 * 21 in a variable to make it more readable.
Comment 6 Jonathan Bedard 2019-08-21 14:16:38 PDT
Comment on attachment 376884 [details]
Patch

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

>> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:74
>> +            self.cassandra.create_table(self.ArchivesByCommit)
> 
> Just to confirm, we won't be creating a new table each time we instantiate this class, right?

Correct. The CassandraContext class is smart enough to only create the table if it doesn't exist.

>> Tools/resultsdbpy/resultsdbpy/model/archive_context.py:90
>> +            timestamp = calendar.timegm(timestamp.timetuple())
> 
> why do we use timestamp.timetuple() here but not inside get_time() method?

Because the get_time method is wrong....calendar.timegm(...) requires the tuple
Comment 7 Jonathan Bedard 2019-08-21 14:39:00 PDT
Created attachment 376923 [details]
Patch
Comment 8 WebKit Commit Bot 2019-08-21 17:21:57 PDT
Comment on attachment 376923 [details]
Patch

Clearing flags on attachment: 376923

Committed r248979: <https://trac.webkit.org/changeset/248979>
Comment 9 WebKit Commit Bot 2019-08-21 17:21:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2019-08-21 17:24:30 PDT
<rdar://problem/54579632>