It's sometimes useful to know the exact version of the source code which is indexed. Show the VCS revision identifier (git hash, etc.) somewhere. A natural place might be with the "Built 6 days ago" indicator at the bottoms of pages.
On the other hand, this will likely require a bit of design work, since the most natural source of the information is the omniglot plugin, but there are no currently exposed hooks in the plugin API for getting stuff into the page footer.
Whiteboard: easy → easy, mxr-parity
I want to work on this bug.Please give me some pointers on how to start.
This bug may be marked "easy", but it's not trivial. The solution will likely involve calling the omniglot plugin's get_rev() method (when the indexed code is checked into a version control system at all) and then outputting the result in the page footers. I recommend doing this work on the "es" (elasticsearch) branch rather than master, as we've rewritten the omniglot plugin there to conform to the new plugin API, and the way we render pages has changed. Most pages are still rendered at build time, so changes will be needed in build.py. Folder listings are now renderered at request time, so changes to app.py will be needed as well. Do pop into #static if you have more questions; there are a number of fine people there who can answer. Welcome to the project!
(Sritanu isn't working on this bug after all. Someone else can feel free to claim it.)
Hi there, I am a bit confused by this item. I'm looking at this page right here: http://dxr.mozilla.org/mozilla-central/source/client.mk On the right-hand side in the navigation pane I see the following string: "Mercurial (ca6b46cbca3b)". What is that? Looking at the log it doesnt appear to be the latest hg revision. Also, where are you seeing the "Built 6 days ago" string? Do you actually mean the "This page was generated by..." string? I think I can take this item, I'm just trying to understand the requirements a bit. The page appears to have changed since the comments were written, that or I'm looking at the wrong page.
This bug involves adding a revision identifier to the footers of pages. Right now, the only identifiers are, as you observe, at the bottoms of nav panes on file views; there's nothing on folder views. > Also, where are you seeing the "Built 6 days ago" string? Do you actually mean the "This page was generated by..." string? Yes. Like I said above, it's not a simple markup change; it'll hoisting some VCS concepts up out of the omniglot plugin into DXR proper.
"it'll involve", that is
Understood. I think I can handle this but Ill have to take a closer look the omniglot plugin.
If you do try to tackle this, do it on the "es" branch. Omniglot (and some of the rendering pipeline) has been rewritten there.
Hi ! I wanted to tackle some dxr bugs before going into plugin development (If I could be of some help to completely get rid of MXR !). This one seems to get old so I thought I could start working on it. If Torehan still want to work on this (or is currently working on this), I don't mind him to reuse what I just did and fix the bug himself ! This is still a work in progress (I only did the build.py part for now) and it introduces a new metadata interface in the plugin system so I won't be offended if it's rejected because I add unnecessary stuff ! You can follow my WIP branch here: https://github.com/rricard/dxr/tree/938222
Anyway, I'm done for today... (it's getting really late here…) Maybe I'll finish this tomorrow if I have time but it's more likely that I will finish this this weekend. Don't hesitate to give me some feedback here or just publish a completely different patch here, I just realize that Torehan may have worked on his side for one month and I'm just popping here like that. So if you worked on something, I don't want you to throw away your patch. It's just a WIP on my side and I don't mind discarding it !
Robin, go ahead and take this. I havent been able to commit the time to taking this. Thanks for asking.
Ok, I think I'm stuck here. I don't want to use the plugins at "serve" time (hg/git ops can be expensive) when doing a tree lookup so I think we have to index the metadata too… If we're doing so, we should stop precompiling the source pages and generate them at serve time…
Note to myself: see line 483 in build.py for adding new data in the index.
Created attachment 8530622 [details] Tree Ok, I think I've got a bit beyond the scope of this bug… And I think there is better things to do with than this metadata thing… Waiting for your feedback on this !
Note: I opened a PR on this: https://github.com/mozilla/dxr/pull/369
Hi, Robin! I'll have a look at your patch soon; it was a holiday weekend in the US, so we were all out making merry. :-)
Don't worry, I expected that ! :) I don't want to rush you, take your time !
We now have a VCS hash in the links menu on the right side of the page, as the heading above Permalink. Example: https://dxr.allizom.org/mozilla-central/source/client.mk.
Is this bug just for showing it on directory listings now? If so, please update the summary and remove mxr-parity
Summary: Show hash or other VCS identifier of the indexed source → Show VCS hash on page footers
Whiteboard: easy, mxr-parity → easy
You need to log in before you can comment on or make changes to this bug.