Closed Bug 488517 Opened 15 years ago Closed 15 years ago

Create Tag CRUD

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clouserw, Assigned: yem.huynh)

References

Details

(Whiteboard: [webmocha])

Attachments

(4 files)

This is the core of our tagging framework.  Once bug 488516 is finished we'll have the Tag namespace free.  We must swoop in and stake our new claim before something else in the database decides to rename itself to `tags` (`ratings` has shifty eyes...keep an eye on that table).  This bug builds on the spec ( http://docs.google.com/Doc?docid=dds6vwb4_1dxwx5vg3&hl=en ) and is specifically for:

1.1, 1.4, 1.6, 1.8: Building the general format and restrictions for tags.  Additional info is at http://micropipes.com/blog/2009/03/06/the-tagging-plan-for-amo/
1.2, 1.3: Users can add tags (track which users add which tags)
1.5: Users can delete tags
1.13: Admin blacklist
Blocks: 488519
Depends on: 410205
Blocks: 410205
No longer depends on: 410205
This task involves:

MySQL: Creating optimal tables & join tables to integrate tagging into addons, developer & user tags, and the blacklist table (the database schema).

Cake: Creating all required models for tags.
Oops, another task for the list:

SimpleTest: Write unit tests for models created.
(In reply to comment #2)
> Oops, another task for the list:
> 
> SimpleTest: Write unit tests for models created.

Hells yeah! :)
Assignee: nobody → mikelee
Assignee: mikelee → expatrick
Assignee: expatrick → yem.huynh
Blocks: 494700
Blocks: 494701
Blocks: 494702
Blocks: 494703
Blocks: 494704
I don't have a fully layered PSD so this is kind of hacked together, but this builds on what Clearleft has already done for tags.
Here's the flow for how we could implement adding a tag. When there are no Tags for that particular add-on you would only have the Tags heading and the "+ Add a tag" link.
Here's the flow for how removing a tag could work. Instead of prompting the user I suggest we implement undo instead - it's a better experience overall and gives the user a way to back out of a change.
Whiteboard: webmocha
Whiteboard: webmocha → [webmocha]
Blocks: 496655
Blocks: 496657
Blocks: 496658
Blocks: 496659
Blocks: 496794
Blocks: 496795
Blocks: 496796
Blocks: 496797
Blocks: 496798
Blocks: 496799
-added create sql scripts for new tables in /site/app/config/sql/remora.sql
-added new tag models
-added simpletests
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
For reference in ViewVC
r27398
Hey,

I was just glancing through some of the commits and ran across r27398 - it's not the only code that does this but as an example:

in the addTag(), removeUserTagFromAddon(), etc. functions you do a SELECT query and then if it's empty you do an INSERT and increment TagStat.  There would be less db queries if you used a REPLACE INTO instead of the double query (there are a bunch of places that do the double query that I saw) and there would be less overall db traffic if you used database triggers everywhere that you are incrementing/decrementing tag statistics or strength instead of doing separate queries.
Thank you for those comments, Wil. Reopening bug. Yem, please look into this. Thanks.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
-added triggers to update tag_stat when records are added/removed from users_tags_addons.

-removed uses of TagStat->increment() from all code

-updated functions that add/remove users_tags_addons records to utilize INSERT IGNORE instead of doing a find and then insert if it does not exist.

Revision 28448.

NOTE:
====
Developers please update your schemas with the attached sql script (trg.sql)
marking as fixed.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
For reference in ViewVC:
r28448
Attachment #385054 - Attachment mime type: text/x-sql → text/plain
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: