Last Comment Bug 744581 - implement ability to see a list of all published snippets, and their source
: implement ability to see a list of all published snippets, and their source
Product: Snippets
Classification: Other
Component: Service (show other bugs)
: unspecified
: All All
-- normal
: ---
Assigned To: Michael Kelly [:mkelly,:Osmose]
Depends on:
  Show dependency treegraph
Reported: 2012-04-11 14:29 PDT by :Gavin Sharp [email:]
Modified: 2012-06-06 15:25 PDT (History)
5 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

Mockup (114.22 KB, image/png)
2012-04-12 15:14 PDT, Michael Kelly [:mkelly,:Osmose] feedback+

Description User image :Gavin Sharp [email:] 2012-04-11 14:29:23 PDT
It's come up a few times that we've released snippets that are problematic in some way (e.g. bug 682944, and more recently a snippet that was erroneously telling users that their build was out of date).

I don't know exactly how the snippet service works, but it would be ideal if it were possible to easily audit the source of all snippets that are currently being sent to Firefox users, and their relevant parameters.
Comment 1 User image Michael Kelly [:mkelly,:Osmose] 2012-04-11 15:23:18 PDT
So, just as a quick refresher:

Snippets are chunks of HTML that are associated with Client Match Rules. These Rules specify strings or regexes that match things like browser version, OS version, release channel, or locale. The rules determine who a snippet goes to.

Currently, we have a small set of automated tests that periodically run on the snippets service and assert a few things, such checking for broken links. We also have a small process in place for testing interactive snippets that might break the about:home page like the one that caused bug 682944.


I think that a human-driven audit would be unmaintainable given the amount of snippets in production at any given time (the last import I was involved in added a couple hundred new snippets, including other locales). 

An automatic audit should be able to be implemented by out automated tests.
Comment 2 User image :Gavin Sharp [email:] 2012-04-11 15:32:41 PDT
I'm not asking that we put in place any requirements for human review, or any kind of additional restrictions on whatever standard practice you use to publish snippets.

As a Firefox developer, I just personally want to be able to look and see what we're pushing to Firefox users when it comes up as a potential issue. There's no visibility into the snippets service at all for anyone outside of the people who have access to the snippets service, and I'd like to change that.
Comment 3 User image Michael Kelly [:mkelly,:Osmose] 2012-04-11 15:38:10 PDT
How would you want the client match rules to be displayed? Just a list showing what fields and what the regexes are for each field? 

I'll mock up what I'm thinking of and attach it tomorrow.
Comment 4 User image :Gavin Sharp [email:] 2012-04-11 15:41:12 PDT
That sounds good. Whatever is easiest would be fine as a first step - it doesn't have to be pretty :)
Comment 5 User image Michael Kelly [:mkelly,:Osmose] 2012-04-12 15:14:27 PDT
Created attachment 614583 [details]

Is this what you were thinking about?

If that works, we can throw this over to cmore and lforrest so they can determine when we want to fit it in.
Comment 6 User image :Gavin Sharp [email:] 2012-04-12 15:34:37 PDT
Comment on attachment 614583 [details]

Yeah, this looks good. It would be cool if you could group (or even sort) by match rules, but this is a nice first step.
Comment 7 User image Winston Bowden 2012-04-12 15:35:33 PDT
+1 to Gavin.
Comment 8 User image :Gavin Sharp [email:] 2012-05-14 16:35:47 PDT
Michael, any updates here? I know this isn't a high priority, but since it seems to be relatively easy to do it'd be nice to get this in production :)
Comment 9 User image Chris More [:cmore] 2012-05-14 21:25:46 PDT
Michael is on PTO all this week due to him moving from Mountain View to Florida. Then next week he is at the Engagement offsite from Tuesday-Thursday. He will not be completely available until May 28th. We will schedule this work with our upcoming development sprints and that date is not yet scheduled. As soon as we have an estimate, we will get back in this bug.
Comment 10 User image Michael Kelly [:mkelly,:Osmose] 2012-05-30 15:51:02 PDT
Fixed in and

IIRC this should be up on staging soon at (if stage hasn't been updated, it will show a blank page).

If stage isn't on an auto-update schedule, then I'll file a push bug shortly to get it up.
Comment 11 User image Michael Kelly [:mkelly,:Osmose] 2012-05-30 19:35:22 PDT
This is now definitely available at

Gavin: How does the page look to you?
Comment 12 User image Michael Kelly [:mkelly,:Osmose] 2012-05-31 12:58:39 PDT
Reopening, as the concern was brought up that this page isn't cached and could be used to overload the snippets server. I'm thinking a 24 hour cache will work fine here?
Comment 13 User image Winston Bowden 2012-05-31 13:03:14 PDT
Should we be seeing all snippets at  I'm not seeing everything that's currently live in GA.  For example, I'm looking for our Collusion snippet.  Copy reads:

"Who's tracking you online? Watch the TED Talk from Mozilla CEO Gary Kovacs to find out."
Comment 14 User image Michael Kelly [:mkelly,:Osmose] 2012-05-31 13:19:51 PDT
Winston: We should only be seeing snippets that are live on stage, so anything on production won't show up.
Comment 15 User image :Gavin Sharp [email:] 2012-06-01 15:36:29 PDT
(In reply to Michael Kelly [:mkelly] from comment #11)
> Gavin: How does the page look to you?

Looks perfect! Thanks a lot for getting this done!
Comment 16 User image Michael Kelly [:mkelly,:Osmose] 2012-06-06 15:25:59 PDT
This has been pushed to production. Final URL:

Note You need to log in before you can comment on or make changes to this bug.