Closed Bug 1637851 Opened 5 years ago Closed 5 years ago

Tags are broken for Firefox

Categories

(Webtools Graveyard :: Pontoon, defect)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: flod, Assigned: mathjazz)

Details

Attachments

(1 file)

I have no idea what's happening, but tags don't work as expected, and I have very little visibility to understand what's going on with the data.

Open https://pontoon.mozilla.org/fr/firefox/

Search for createProfile. You should find 2 files, one DTD and one FTL:

  • The DTD has 5 stars (highest). There are only 2 tags with that level, but if you search for linked resources in those, you won't find this file (it should be in Shared).
  • The FTL shows 3 stars (normal), but it's linked to Shared, which is Highest priority (5 stars).

Since we're looking at the data, it would be nice to run a one-off check, and remove obsolete entries, and check if any file is associated to more than one tag.

Early findings:

  1. The DTD resource is linked to the 'Shared' tag (5 stars), the FTL resource is linked to the 'Shared Secondary' tag (3 stars), which means data is displayed properly in the dashboard.
  2. There's a bug in the Tags widget in the Project Admin, which doesn't show the right resources under the 'Shared' tag. That's why the FTL resource appears instead of the DTD resource under the 'Shared' tag. 'Shared Secondary' tag shows the FTL file (as expected).
  3. Several resources are listed under two tags (all other Firefox resources belong to exactly 1 Tag):
Firefox: browser/chrome/browser/safebrowsing/safebrowsing.properties
<TagQuerySet ['Browser', 'Browser Secondary']>
Firefox: dom/chrome/global-strres.properties
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/nsWebBrowserPersist.properties
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/layout/printing.properties
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/netError.dtd
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/global.dtd
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/layout/MediaDocument.properties
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/netErrorApp.dtd
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/appstrings.properties
<TagQuerySet ['DOM Technical', 'Shared']>
Firefox: dom/chrome/plugins.properties
<TagQuerySet ['DOM Technical', 'Shared']>
Assignee: nobody → m
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

I think I managed to clean up.

Questions:

  • Could you share the code you used to get the duplicates? I wonder if I could run it from time to time on my own.
  • Is the structure of the DB associated to tags documented anywhere? At some point, I'm sure some of the resources are misplaced, but there's no easy way for me to the full list of resources+tags.
Status: RESOLVED → VERIFIED

This is the script I used for Firefox:

from pontoon.base.models import *
from pontoon.tags.models import *

for resource in Resource.objects.filter(project__slug="firefox"):
  tags = Tag.objects.filter(resources__in=[resource])
  if tags.count() != 1:
    resource
    tags.values_list("slug", flat=True)

The tags model is defined here:
https://github.com/mozilla/pontoon/blob/master/pontoon/tags/models.py

Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: