Closed Bug 1091269 Opened 11 years ago Closed 10 years ago

Replace automationutils:ZipFileReader with zipfile.extractall

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla37

People

(Reporter: jgriffin, Assigned: prashantbaisla, Mentored)

References

Details

(Whiteboard: [good first bug][lang=python])

User Story

We want to move the ZipFileReader class out of http://dxr.mozilla.org/mozilla-central/source/build/automationutils.py and into http://dxr.mozilla.org/mozilla-central/source/build/automation.py.in.

Replace with https://docs.python.org/2/library/zipfile.html#zipfile.ZipFile.extractall if possible.

Attachments

(1 file)

automationutils:ZipFileReader is used in only one file, automation.py.in. We should move it there.
User Story: (updated)
I believe the zipfilereader class was mainly used because extractall wasn't in older versions of python that we were using a few years ago. So we might just be able to chuck it wholesale by using extractall directly: https://docs.python.org/2/library/zipfile.html#zipfile.ZipFile.extractall
Even better!
User Story: (updated)
I'd like to do this. Can someone tell me how to get started?
I want to work on this bug. Please assign it to me.
At http://dxr.mozilla.org/mozilla-central/source/build/automation.py.in#936, we currently use ZipFileReader from automationutils.py. Instead, we'd prefer to use Python's built-in ZipFile class.
Hi Prashant and Amit, thanks for the interest! We can't have you both working on this at the same time, and since Prashant asked first I'll assign it to them. Prashant, please let jgriffin or I know if you have any questions! Amit, take a look at bug 1091280 and add a comment over there if you are interested in trying it.
Assignee: nobody → prashantbaisla
Status: NEW → ASSIGNED
Thanks Andrew! Could you tell me how to set up a development environment for this? And how I should submit the patch? I've never used mercurial before.
I need some help in getting started. Can someone tell me how to begin?
Hi Prashant, sorry for missing your comment last month. One trick you can do to make sure a person sees a comment is to flag them for needinfo. To do that you can check the 'Need more information from' box below and enter in the person's name. For this bug you'll need the main repo called 'mozilla-central'. To clone it see: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Mercurial Once you have the source, the two files you'll need to modify are 'build/automationutils.py' and 'build/automation.py.in' (see the user story above for more details). In terms of working with mercurial, there are many different workflows that people use. Some people use mq, others use bookmarks. Probably the simplest way of managing patches to start out with is mq (though bookmarks are the newer way of working): https://developer.mozilla.org/en-US/docs/Mercurial_Queues
I'm pretty sure we should be able to just use zipfile.extractall here, we should definitely try that first, at least.
Summary: Move automationutils:ZipFileReader to automation.py.in → Replace automationutils:ZipFileReader with zipfile.extractall
(In reply to Andrew Halberstadt [:ahal] from comment #9) > Hi Prashant, sorry for missing your comment last month. One trick you can do > to make sure a person sees a comment is to flag them for needinfo. To do > that you can check the 'Need more information from' box below and enter in > the person's name. That's really something I don't like about the needinfo? flag, it creates another barrier of entry for newcomers, who ask questions in bugs and don't get any response, because developers don't look at regular bugmail anymore (because they are overwhelmed, I understand).
I've removed the ZipFileReader class from automationutils.py and changed automation.py.in to use zipfile.extractall
Attachment #8539686 - Flags: review?(jgriffin)
Second try run with a different test selection: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=ed7a300112dd
Comment on attachment 8539686 [details] [diff] [review] bug-1091269-fix.patch Review of attachment 8539686 [details] [diff] [review]: ----------------------------------------------------------------- try runs look good, thanks for the patch!
Attachment #8539686 - Flags: review?(jgriffin) → review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: