Closed Bug 628655 Opened 13 years ago Closed 13 years ago

Support daily builds in download script

Categories

(Mozilla QA Graveyard :: Mozmill Automation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

Attachments

(1 file, 5 obsolete files)

With bug 528064 we now have the capability to easily download builds from our staging server and mirrors. But it only implements the download for release and release candidate builds. We have to implement the NightlyScraper class to also support nightly builds.
Heather, would you be ok with when we take parts of your script for out downloader script? It's only missing the nightly build pieces.

https://github.com/harthur/mozregression/blob/master/mozregression/runnightly.py
(In reply to comment #1)
> Heather, would you be ok with when we take parts of your script for out
> downloader script? It's only missing the nightly build pieces.
> 
> https://github.com/harthur/mozregression/blob/master/mozregression/runnightly.py

That's fine, yeah
With the new channels we have to support daily builds for Nightly and Aurora. Both will be covered by my upcoming patch.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Summary: Support nightly builds in download script → Support daily builds in download script
Attached patch Patch v1 (obsolete) — Splinter Review
Please note that we do not support the old structure on the FTP server yet. It will only work with the structure we have right now. As long as we do not run regression tests with Mozmill there will also be no need for it.
Attachment #542293 - Flags: review?(jhammel)
Comment on attachment 542293 [details] [diff] [review]
Patch v1

Nit:
+    parser.add_option('--build', '-b',
+                     dest='build',
+                     default=1,
indentation of dest, etc should be one additional space

You should also do `type="int"` if you expect an int. Otherwise you'll get a string

+        self.list_regex = 'nightly/%(YEAR)s/%(MONTH)s/' % {
+                              'YEAR': self.date.year,
+                              'MONTH': str(self.date.month).zfill(2) }

I find this type of filtering very brittle. I would expect some tests, a docstring, or otherwise documentation on why things are done this way, preferably citing a URL

+        regex = r'%(DATE)s-(\d+-)+mozilla-%(BRANCH)s%(L10N)s$' % {
+                    'DATE': self.date.strftime('%Y-%m-%d'),
+                    'BRANCH': self.branch,
+                    'L10N': '' if self.locale == 'en-US' else '-l10n'}

Likewise

+    @property
+    def binary_regex(self):

Is there any reason to have this a property vs a function?

I really find the filtering stuff more complex and it would be nice to have this live as a utility.  I'll grant a review, fixing the type="int" issue, but it is with a grain of salt
Attachment #542293 - Flags: review?(jhammel) → review+
(In reply to comment #5)
> +    @property
> +    def binary_regex(self):
> 
> Is there any reason to have this a property vs a function?

Why should that not be a property? From all what I can see it speaks for a getter. Also all other elements on the classes are properties.

> I really find the filtering stuff more complex and it would be nice to have
> this live as a utility.  I'll grant a review, fixing the type="int" issue,
> but it is with a grain of salt

The parser is already a separate class, which we can put into another module in the future. But all the regular expressions are closely tied to the scraper class and can't be moved out.
Attached patch Patch v2 (obsolete) — Splinter Review
Any of the review comments have been addressed and documentation added. I hope it's more understandable now.

Also I have found an issue with branch handling. We only supported branches with a 'mozilla-' prefix. Now we support all branches like 'private-browsing', 'ux', and others.
Attachment #542293 - Attachment is obsolete: true
Attachment #542430 - Flags: review?(jhammel)
Comment on attachment 542293 [details] [diff] [review]
Patch v1

+    def __init__(self, branch='mozilla-central', date=date.today(),
So, this will set the default date argument for the function to when the module is first loaded.  In other words, it will be wrong after 24-N hours.  Probably better to set to None and then do 

if date is None:
   date = datetime.date.today()
Attachment #542430 - Flags: review?(jhammel) → review+
Attached patch Patch v3 (obsolete) — Splinter Review
With updated review comments. Thanks for the clarification, that were news to me.
Attachment #542430 - Attachment is obsolete: true
Attachment #542662 - Flags: review?(jhammel)
Attached patch Patch v3.1 (obsolete) — Splinter Review
I should not upload broken patches. Here the qrefreshed version of the last patch.
Attachment #542662 - Attachment is obsolete: true
Attachment #542779 - Flags: review?(jhammel)
Attachment #542662 - Flags: review?(jhammel)
Attached patch Patch v3.2 (obsolete) — Splinter Review
Not sure what hg is doing. Even with a hg qrefresh the latest changes weren't included. Seems to be fixed now.
Attachment #542779 - Attachment is obsolete: true
Attachment #542783 - Flags: review?(jhammel)
Attachment #542779 - Flags: review?(jhammel)
Comment on attachment 542783 [details] [diff] [review]
Patch v3.2

+from datetime import date

...

+    def __init__(self, branch='mozilla-central', date=None,
+                 build=1, *args, **kwargs):
         MozillaScraper.__init__(self, *args, **kwargs)
-        raise NotImplementedError("Download of nightly builds hasn't been implemented yet.")
+        self.branch = branch
+        self.build = build
+        self.date = date if date else datetime.date.today()

This won't work, as you don't import datetime abict (just from datetime import date).  I recommend changing the import 

r+ if you fix that
Attachment #542783 - Flags: review?(jhammel) → review+
Attached patch Patch v4Splinter Review
Thanks for catching that Jeff! What an awkward mistake. Here the updated patch and taking over r+.
Attachment #542783 - Attachment is obsolete: true
Attachment #542967 - Flags: review+
Landed as:
http://hg.mozilla.org/qa/mozmill-automation/rev/78fcedc41024

Thanks everyone. Support for tinderbox or hourly builds can be added later on another bug.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Blocks: 671372
Depends on: 683469
Blocks: 704186
Blocks: 709891
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: