Closed Bug 767176 Opened 13 years ago Closed 5 years ago

kuma/kumascript: Track templates used in rendering a page

Categories

(developer.mozilla.org Graveyard :: KumaScript, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: lorchard, Unassigned)

References

Details

There's currently no decent way to know what templates were used in the course of rendering a page, nor to know on what pages any given template is used. This information could be useful eventually for things like metrics, caching invalidation, and general template debugging. I did some data spelunking as a one-shot, in bug 714804, on an old export of MindTouch documents. That was cumbersome, expensive, and hard to repeat. What might be interesting in the future is something like this, using Redis: * Let KumaScript accumulate an inventory of templates loaded while rendering a page * Once done rendering: * Push the inventory of templates into a set indexed by the page path. * Push the page path into a set indexed by each template name. Redis should make this very cheap vs using mysql. This would, over time, leave us with sets of templates-by-page and pages-by-template. We could put this info on dashboards, list pages-in-use on template editing pages, list templates-used in diagnostic info on pages, etc.
(Note that this presupposes the availability of a Redis installation for MDN)
Whiteboard: u=user c=wiki s=2012-07-18 p=
FWIW, this is more of a "nice idea" bug than an immediate need. It also requires a lot of IT cooperation, per comment #1. This will spawn sub-bugs and will not get done in a single sprint
Whiteboard: u=user c=wiki s=2012-07-18 p= → u=user c=wiki s= p=
Something else: If / when we have an offline queue for building pages, these lists could be handy for scheduling auto-rebuilds of pages that call modified templates as their dependencies. Also, would be good to track dependencies-of-dependencies. That is, templates which call templates, and trace their path up to documents in need of rebuild.
Blocks: 772704
Blocks: 774383
FWIW, here's an interesting template use case that makes this even more challenging: https://developer-new.mozilla.org/en-US/docs/Template:InterfaceEntry That template uses the value of a parameter to decide the name of another template to call at run time.
Is he just localizing one template in many languages? On Deki, I think we did that by writing one template and checking the locale within that.
(In reply to John Karahalis [:openjck] from comment #5) > Is he just localizing one template in many languages? On Deki, I think we > did that by writing one template and checking the locale within that. No, that template chooses between two templates based on an interface status flag (ie. unfrozen vs frozen). Both of *those* templates are themselves localized in the way you mention
Version: Kuma → unspecified
Component: Docs Platform → Editing
No longer blocks: 756266
Priority: -- → P2
Blocks: 773855
Component: Editing → KumaScript
Whiteboard: u=user c=wiki s= p=
Blocks: 744520
Blocks: 880614
No longer blocks: 773855
Severity: normal → enhancement
Priority: P2 → --
See Also: → 1118636
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.