cleaning bug helper cache

Bug #87448 reported by David Farning on 2007-02-24
2
Affects Status Importance Assigned to Milestone
Bug Helper
Low
Daniel Holbach
bughelper (Ubuntu)
Low
Daniel Holbach

Bug Description

Binary package hint: bughelper

A RFE from the Mozillateam.

I was wondering if you could add code to remove the attachments for closed or rejected issue reports from the local attachment-cache. I am at 3.5 gigs and climbing for firefox issues.

Thanks
David Farning

Daniel Holbach (dholbach) wrote :

Thanks for your bug report. At the moment we don't check closed bugs at all, so we don't have that information yet.

Maybe we should check the mtime of the attachments file. Hm.

Changed in bughelper:
importance: Undecided → Low
status: Unconfirmed → Confirmed
importance: Undecided → Low
status: Unconfirmed → Confirmed
Markus Korn (thekorn) wrote :

The problem is, from my point of view, that we are not able to identify the bug who belongs to a special attachment at the moment. We only have the seven digit number of librarian.launchpad.net for the folder name, maybe we should change the folder name into the bug-number.

I just bought a 250G NAS so this issues is of much lower importance to
me:)

I agree the the best, not necessarily the easist, would be to save the
attachment under their bug number rather than their librarian number.

thanks
--
David Farning <email address hidden>

Daniel Holbach (dholbach) wrote :

I did this for a reason: librarian_numbers+attachment_name is unique and you don't have to find out if there's an attachment on the bug that you downloaded already or didn't.
But yeah, a fix could look like this:
 * add the bug number to the path name ("%s-%s" % (bugnumber, librariannumber)),
 * use information of the buglist.closed set to purge unneeded attachments
 * (maybe add a --nopurge command line option or a setting in the config file for people who check closed bugs too *shrug*)

Markus Korn (thekorn) wrote :

The first step to provide any kind of option to clean/organize the bughelper attachment - cache is to rename the path to the attachments.
current implementation:
~/.bughelper/attachments-cache/<librarian.launchpad-ID>/<file>
* The correlation PATH -> BUGNR is impossible

My suggestion is to change the path into:
~/.bughelper/attachments-cache/<bugnr>/<librarian.launchpad-ID>/<file>
* all files attached to a bug are in one folder

The attached patch against .main r117 provides a "on the fly" solution for renaming the paths:
* Whenever a cached file is used by bughelper, this file is moved into the new path, old path is deleted
* New files are saved in the new path

Needs to be reviewed so it can be merged into bughelper.main!

Regards
Markus

Markus Korn (thekorn) on 2007-03-19
Changed in bughelper:
status: Confirmed → In Progress
Daniel Holbach (dholbach) wrote :

The patch changes the BugAttachment constructor. Fortunately neither we nor apport use it heavily (apport not at all).

Maybe we should pass a Bug() object to constructor which contains a lot of information already?

Daniel Holbach (dholbach) wrote :

------------------------------------------------------------
revno: 144
committer: Daniel Holbach <email address hidden>
branch nick: bughelper.clean
timestamp: Thu 2007-04-19 12:56:17 +0200
message:
  attachment cleaning
------------------------------------------------------------

Changed in bughelper:
assignee: nobody → dholbach
status: In Progress → Fix Released
Daniel Holbach (dholbach) wrote :

This change will land in Gutsy first thing.

Changed in bughelper:
assignee: nobody → dholbach
status: Confirmed → Fix Committed
Emilio Pozuelo Monfort (pochu) wrote :

Fixed with 0.2~169

Changed in bughelper:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers