QA/Bugzilla/Attachments

This page is about Attachments in Bugzilla.

Filesize Limit
Temporarily, we're putting files too large for Bugzilla here on the wiki or on Nextcloud:
 * Currently 30MB
 * QA/Bugzilla/Attachments/Temporary Storage for Big Files

MIME Type Problems

 * UPDATE: Based on pre- and post-migration testing, we believe that the new TDF Bugzilla does not suffer from the mimetype problems seen on FDO Bugzilla. However, there are browser bugs that still cause problems. Currently we are aware of 🇲🇿.

We sometimes have problems getting the right MIME type set on Bugzilla attachments. For a period of time, auto-detection for MIME types was disabled in FDO Bugzilla. Tollef re-enabled auto-detection for the LibreOffice product (thank goodness!).

Currently,
 * Many attachments have incorrect MIME type
 * Many binary documents are marked as text/plain

Nuances
Michael Stahl points out that there are some special cases to consider when cleaning up MIME types:
 * MIME type may not match file extension
 * "this is a docx file with .doc extension and LO can't load it" (this was an actual example)
 * Possible Solution: Ignore file extension and just compare Bugzilla MIME type with embedded MIME type in file.
 * File format does not have a specified MIME type
 * e.g. MSO 2003 XML files
 * (For now, we're using type "text/xml")
 * they can't figure it out, either
 * Stack Overflow comments - (suggests )
 * Stack Overflow comments - (suggests )

Automation
It makes sense for us to have some type of automation (or at least automatic notification) to help us clean up improperly-annotated attachments.

External References

 * https://www.iana.org/assignments/media-types/media-types.xhtml

Current Manual Fixing
What we do now:
 * 1) Look up attachments of a particular MIME type - "set a 'Custom Search' on 'Attachment mime type' 'is equal to' "
 * 2) * e.g. Here is the search for
 * 3) Look at file extension and confirm that it matches the MIME type in Bugzilla
 * 4) If the extension does not match the MIME type, update the MIME type (Note: See MStahl's cautionary note about believing file extensions, above)

Shortlist of extensions and MIME types

Scripting
The general idea


 * 1) Create user 'MIMEtype Fixer'
 * 2) Use XML-RPC/etc.. API
 * 3) Get list of all attachments (id, filename, MIMEtype)
 * 4) Foreach attachment, compare (embedded) file MIMEtype w/Bugzilla MIMEtype
 * 5) * If they don't match, fix (or possibly review before fix)