File:  [LON-CAPA] / doc / build / Attic / software_review.html
Revision 1.2: download - view: text, annotated - select for diffs
Sat May 19 14:43:51 2001 UTC (23 years, 1 month ago) by harris41
Branches: MAIN
CVS tags: version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, version_0_6_2, version_0_6, version_0_5_1, version_0_5, version_0_4, stable_2002_spring, stable_2002_july, stable_2002_april, stable_2001_fall, conference_2003, STABLE, HEAD
updating dates of change

    1: <html>
    2: <head>
    3: <title>Software Review</title>
    4: </head>
    5: <body>
    6: <h1>Submitting software patches</h1>
    7: <p>
    8: Scott Harrison, last updated 05/19/2001
    9: </p>
   10: The system works, yet there remains much tweaking to do.
   11: </p>
   12: <p>
   13: <img src='sharetweaks.gif' />
   14: </p>
   15: <h3>General Guidelines</h3>
   16: <ol>
   17: <li>submit patches to <tt>albertel@msu.edu</tt></li>
   18: <li>patches must be a unified diff format (-u)</li>
   19: <li>should be against a specific CVS tag (like HEAD, or when we get to
   20: releases, the most recent *_RELEASE tag)</li>
   21: <li>should contain a description of bugs they fix or functionality they
   22: add</li>
   23: <li>try to make each patch as _targetted_ as possible. (Fix 1 bug, or
   24: add 1 feature) to make it easier to see what is going on.</li>
   25: <li>Large functionality changes should probably get some discussion on
   26:  the mailing list before being submitted.</li>
   27: </ol>
   28: <h3>Example Scenario</h3>
   29: <table border=1><tr><td>
   30: <p>
   31: <b>Large functionality changes should probably get some discussion on
   32:  the mailing list before being submitted.</b>
   33: </p>
   34: <p>
   35: A fictional Dr. Sherbert is writing a handler to display web statistics
   36: (information present in /var/log/httpd/access.log).  Here is
   37: a list of e-mails and commands which take place.
   38: </p>
   39: <p>
   40: Dr. Sherbert e-mails the list with his idea
   41: <pre>
   42: <b>sherbert %&gt;</b> mail lon-capa@hobbes.lite.msu.edu
   43: Hi,
   44: 
   45: I want to create a handler to show web statistics (hits
   46: per hour, IP addresses, most popular URLs, hits per day,
   47: etc).  This would provide data I can show the
   48: administration as well as helping me better monitor
   49: how adequately my server cluster is performing.
   50: I plan on calling this handler lonapachestat.pm, associating
   51: with apachestat, and available only to those with roles (see
   52: roles.tab and rolesplain.tab) of "gan=generating anonymous
   53: statistics".  I would make appropriate changes to
   54: /etc/httpd/conf/srm.conf
   55: 
   56: -Bert
   57: </pre>
   58: </p>
   59: <p>
   60: Two others respond on the mailing list.
   61: <pre>
   62: <b>gwynne %&gt;</b> mail lon-capa@hobbes.lite.msu.edu
   63: Bert,
   64: 
   65: I like that idea, but don't you think that this is
   66: better handled as a batch-cron job?  Why not have
   67: these statistics compiled every day?  I think
   68: SOURCE="loncom/cron/loncapa" TARGET="etc/cron.d/loncapa"
   69: handles this.  Also, I assume you mean associating
   70: with the location http://MACHINENAME/adm/lonapachestat.
   71: 
   72: Gwynne
   73: 
   74: 
   75: <b>godfried %&gt;</b> mail lon-capa@hobbes.lite.msu.edu
   76: Bert,
   77: 
   78: This would be of immense help to some questions I have.
   79: I want to be able to "play-back" what each user session
   80: is doing for my course.  Also, if a student e-mails me,
   81: I want to be able to see where in the course sequence
   82: the student was working.  I would need the statistics calculated
   83: dynamically as opposed to a batch process.
   84: 
   85: Godfried
   86: </pre>
   87: </p>
   88: <p>
   89: After more discussion, Dr. Sherbert's idea is accepted.
   90: </p>
   91: </td></tr></table>
   92: <p>
   93: &nbsp;
   94: </p>
   95: <table border=1><tr><td>
   96: <p>
   97: <b>PATCHING /etc/httpd/conf/srm.conf</b>
   98: </p>
   99: <p>
  100: <b>submit patches to <tt>albertel@msu.edu</tt></b>
  101: <br /><b>patches must be a unified diff format (-u)</b>
  102: <br /><b>should be against a specific CVS tag (like HEAD, or when we get to
  103: releases, the most recent *_RELEASE tag)</b>
  104: <br /><b>should contain a description of bugs they fix or functionality they
  105: add</b>
  106: <br /><b>try to make each patch as _targetted_ as possible. (Fix 1 bug, or
  107: add 1 feature) to make it easier to see what is going on.</b>
  108: </p>
  109: <p>
  110: Dr. Sherbert wants to alter the web server configuration so that
  111: whenever http://MACHINENAME/apachestat is requested, the lonapachestat.pm
  112: handler is called.
  113: </p>
  114: <p>
  115: To do this, he needs to alter srm.conf.  After setting up CVS
  116: and checking out LON-CAPA (cvs co loncapa), he needs to find srm.conf
  117: in the CVS source repository.
  118: </p>
  119: <pre>
  120: [sherbert@morphy1 loncapa]$ find . -type f | grep srm.conf
  121: ./loncom/srm.conf
  122: [sherbert@morphy1 loncapa]$ 
  123: </pre>
  124: <p>
  125: Dr. Sherbert sees the following section of code in srm.conf.
  126: <pre>
  127: # -------------------------------------------------------------- Admin Programs
  128: 
  129: &lt;Location /adm/roles&gt;
  130: PerlAccessHandler       Apache::lonacc
  131: SetHandler perl-script
  132: PerlHandler Apache::lonroles
  133: ErrorDocument     403 /adm/login
  134: ErrorDocument	  500 /adm/errorhandler
  135: &lt;/Location&gt;
  136: 
  137: &lt;Location /adm/login&gt;
  138: SetHandler perl-script
  139: PerlHandler Apache::lonlogin
  140: &lt;/Location&gt;
  141: 
  142: &lt;Location /adm/logout&gt;
  143: PerlAccessHandler       Apache::lonacc
  144: SetHandler perl-script
  145: PerlHandler Apache::lonlogout
  146: ErrorDocument     403 /adm/login
  147: &lt;/Location&gt;
  148: </pre>
  149: </p>
  150: <p>
  151: Dr. Sherbert then adds in his handler.
  152: </p>
  153: <pre>
  154: # -------------------------------------------------------------- Admin Programs
  155: 
  156: &lt;Location /adm/apachestat&gt;
  157: PerlAccessHandler       Apache::lonacc
  158: SetHandler perl-script
  159: PerlHandler Apache::lonapachestat
  160: ErrorDocument     403 /adm/login
  161: ErrorDocument	  500 /adm/errorhandler
  162: &lt;/Location&gt;
  163: 
  164: &lt;Location /adm/roles&gt;
  165: PerlAccessHandler       Apache::lonacc
  166: SetHandler perl-script
  167: PerlHandler Apache::lonroles
  168: ErrorDocument     403 /adm/login
  169: ErrorDocument	  500 /adm/errorhandler
  170: &lt;/Location&gt;
  171: 
  172: &lt;Location /adm/login&gt;
  173: SetHandler perl-script
  174: PerlHandler Apache::lonlogin
  175: &lt;/Location&gt;
  176: 
  177: &lt;Location /adm/logout&gt;
  178: PerlAccessHandler       Apache::lonacc
  179: SetHandler perl-script
  180: PerlHandler Apache::lonlogout
  181: ErrorDocument     403 /adm/login
  182: &lt;/Location&gt;
  183: </pre>
  184: <p>
  185: Dr. Sherbert then creates a unified diff format of his changes
  186: against the HEAD (current) release.
  187: <pre>
  188: [sherbert@morphy1]$ cd loncapa/loncom
  189: [sherbert@morphy1]$ cvs diff -U 3 -r HEAD srm.conf
  190: Index: srm.conf
  191: ===================================================================
  192: RCS file: /home/cvs/loncom/srm.conf,v
  193: retrieving revision 1.14
  194: diff -U3 -r1.14 srm.conf
  195: --- srm.conf	2001/05/15 12:35:07	1.14
  196: +++ srm.conf	2001/05/19 13:14:53
  197: @@ -353,6 +353,14 @@
  198:  
  199:  # -------------------------------------------------------------- Admin Programs 
  200: +<Location /adm/apachestat>
  201: +PerlAccessHandler       Apache::lonacc
  202: +SetHandler perl-script
  203: +PerlHandler Apache::lonapachestat
  204: +ErrorDocument     403 /adm/login
  205: +ErrorDocument	  500 /adm/errorhandler
  206: +</Location>
  207: +
  208:  <Location /adm/roles>
  209:  PerlAccessHandler       Apache::lonacc
  210:  SetHandler perl-script
  211: </pre>
  212: </p>
  213: <p>
  214: Dr. Sherbert e-mails his patch to Guy.
  215: <pre>
  216: [sherbert@morphy1]$ cvs diff -U 3 -r HEAD srm.conf | mail -s 'patch to\
  217:  srm.conf to add adm/apachestat handling with lonapachestat.pm'\
  218: albertel@msu.edu
  219: </pre>
  220: </p>
  221: <p>
  222: Guy responds
  223: <pre>
  224: Bert,
  225: 
  226: Your change was checked into the LON-CAPA system.  Thanks!
  227: 
  228: -Guy
  229: </pre>
  230: </p>
  231: Dr. Sherbert did the following right things.
  232: <ul>
  233: <li>he described the fix in his mail message
  234: <br>patch to srm.conf to add adm/apachestat handling with lonapachestat.pm</li>
  235: <li>his submitted change fixed 1 bug/feature</li>
  236: <li>he created a unified diff format for his patch</li>
  237: </ul>
  238: </pre>
  239: </p>
  240: </td></tr></table>
  241: </body>
  242: </html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>