[ 
https://issues.apache.org/jira/browse/LUCENE-7146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15215153#comment-15215153
 ] 

Hoss Man commented on LUCENE-7146:
----------------------------------


Quick summary of how the CMS currently gets that data...

* {{templates/core-sidebar.html}} & {{templates/solr-sidebar.html}} currently 
have blocks that look like this...{code}
{% if svn %}
<div id="svn">
  <h1>Latest SVN</h1>
  <div class="status-item">
  {% for e in svn.list %}
  <div class="section-content">
    <a class="svn" href="http://svn.apache.org/viewvc?revision={{ e.revision 
}};view=revision">r{{ e.revision }}</a>
    {{ e.message|safe|truncatewords_html:20 }} ({{
    e.projects|safe }}) &mdash;
    <a href="http://people.apache.org/committer-index.html#{{ e.author }}">{{ 
e.author }}</a>
  </div>
{% endfor %}</div></div>
{code}
* the {{svn}} variable(s) are populated by some code in {{lib/path.pm}} when it 
detecs that the page is either (core|solr)/index.html...{code}
# there is a similar looking block for solr's index.html
[qr!core\/index\.mdtext$!, main => { template => "core.html",
  preprocess => 1,
      jira     => ASF::Value::Jira->new(limit => 5,
                                    url => "http://s.apache.org/corejira";, 
localMode => $localMode),
  svn      => ASF::Value::SVN->new(limit => 5, project => "/lucene/dev/trunk",
                                    localMode => $localMode),
  coreuser => ASF::Value::Mail->new(list => 'java-u...@lucene.apache.org',
                                        limit => 3,
                                        localMode => $localMode),
  dev => ASF::Value::Mail->new(list => 'dev@lucene.apache.org',
                                          limit => 3, localMode => $localMode),
{code}
* the ASF::Value::SVN package is some ASF CMS custom code that can be found 
here: https://svn.apache.org/repos/infra/websites/cms/build/lib/ASF/Value/SVN.pm
** it uses SVN::Client under the covers


A big caveat here, is that unless i'm remembering completely wrong, all of this 
code is only evaluated when teh site is "built" just before it's "published" -- 
once upon a time there was a cron that automatically rebuilt & republished the 
site once an hour in order to dynamically update content like this, but IIRC we 
ask infra to disable that for our site because it was anoying, and was pushing 
out site updates even when we really didn't want it to (like when staging 
release announcement)

----

Now, with all the "existing" stuff out of the way, some misc notes on how we 
could "fix" "Latest SVN"...

* we could always just choose to completley remove that section from those 
sidebars
* As you can see in the code snippet above, in addition to ASF::Value::SVN, 
there are a few other "ASF::Value::" modules available to fetch data from ASF 
sources for sidebars: 
https://svn.apache.org/repos/infra/websites/cms/build/lib/ASF/Value/
** but none for GIT at the moment
** and even if there was it wouldn't solve the "this data will only updated on 
site publish" part of the problem
* the web based git browser apache is running does have an option to get an 
ATOM or RSS feed for a repo:
** https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=atom
** you can even restrict it by path so we could have distinct sidebar content 
for lucene and solr
*** https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=atom;f=lucene
*** https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=atom;f=solr
** by default it seems to constrain to master commits, but we could 
alternatively restrict to any named branch:
*** 
https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=atom;h=refs/heads/branch_6x
* writting our own perl code to fetch these feeds and populate variables for 
use in our sidebar templates would be fairly straight forward
** the existing ASF::Value::Blog class could almost be used as-is for this, 
except it's hard coded to only work with the blog.apache.org domain.
* one option to completely bypass the "this data will only updated on site 
publish" part of the problem would be to switch to a javascript solution for 
fetching the data
** my understanding of using javascript for this however is that it would 
require {{git-wip-us.apache.org}} to provide a {{Access-Control-Allow-Origin: 
*}} or {{Access-Control-Allow-Origin: *.apache.org}} header when serving these 
feeds -- something not currently done.
** it's possible infra might be willing to configure the webserver on 
git-wip-us.apache.org to add this, but i have no idea if there would be 
objections to that -- or to the subsequent load on that webserver (one ATOM 
feed request for ever index.html page view)



> "Latest SVN" needs replaced on the website
> ------------------------------------------
>
>                 Key: LUCENE-7146
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7146
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: general/website
>            Reporter: Hoss Man
>
> Mike ask a little while back on dev@lucene...
> {noformat}
> On the bottom right of Lucene's index.html we have "Latest SVN" but of
> course it only displays this last svn commit:
>   r1726344 LUCENE-6937: moving trunk from SVN to GIT. (lucene) — dweiss
> Does anyone know how to convert this to the "Latest GIT"?
> {noformat}
> This isn't particularly straight forward, so filing an issue to track it



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to