Index: openacs-4/packages/acs-core-docs/www/contributing-code.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/Attic/contributing-code.html,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-core-docs/www/contributing-code.html 16 Feb 2005 00:21:02 -0000 1.2 +++ openacs-4/packages/acs-core-docs/www/contributing-code.html 4 Jun 2006 00:45:24 -0000 1.3 @@ -1,9 +1,10 @@ -Contributing code back to OpenACS +Contributing code back to OpenACS

Contributing code back to OpenACS

There are three main ways to contribute code to OpenACS:

  1. To contribute a small fix, if you do not have a developer account, submit a patch.

  2. If you are making many changes, or would like to become a direct contributor, send mail to the Core Team asking for commit rights. You can then commit code directly to the repository:

    1. Use one of the checkout methods described above to get files to your system. This takes the place of steps 1 and 2 in the section called “Installation Option 2: Install from tarball”. Continue setting up the site as described there.

    2. Fix bugs and add features.

    3. - Commit that file (or files):

      cvs commit -m "what I did and why" filename

      + Next


    Contributing code back to OpenACS

    There are three main ways to contribute code to OpenACS:

    1. To contribute a small fix, if you do not have a developer account, submit a patch.

    2. If you are making many changes, or would like to become a direct contributor, send mail to the Core Team asking for commit rights. You can then commit code directly to the repository:

      1. Use one of the checkout methods described above to get files to your system. This takes the place of steps 1 and 2 in Section�, “Installation Option 2: Install from tarball”. Continue setting up the site as described there.

      2. Fix bugs and add features.

      3. + Commit that file (or files):

        cvs commit -m "what I did and why" filename

        Because this occurs in your personal checkout and not an anonymous one, this commit automagically moves back upstream to the Mother Ship repository at cvs.openacs.org. The names of the changed files, and your comments, are sent to a mailing list for OpenACS developers. A Core Team developer may review or roll back your changes if necessary. @@ -14,16 +15,16 @@

    3. Add a new package. Contact the Core Team to get approval and to get a module alias created.

      1. Check out acs-core on the HEAD branch. (Weird things happen if you add files to a branch but not to HEAD):

        cd /tmp
         cvs -d:ext:cvs.openacs.org:/cvsroot checkout acs-core

        Copy your package directory from your working directory to this directory. Make sure not to copy any CVS directories.

        cp -r /var/lib/aolserver/service0/packages/newpackage /tmp/openacs-4/packages

        Import the package into the cvs.openacs.org cvs repository:

        cd /tmp/openacs-4/packages/newpackage
        -cvs import -m "Initial import of newpackage" openacs-4/packages/newpackage myname newpackage-0-1d
      2. Add the new package to the modules file. (An administrator has to do this step.) On any machine, in a temporary directory:

        cvs -d :ext:cvs.openacs.org:/cvsroot co CVSROOT
        +cvs import -m "Initial import of newpackage" openacs-4/packages/newpackage myname newpackage-0-1d
      3. Add the new package to the modules file. (An administrator has to do this step.) On any machine, in a temporary directory:

        cvs -d :ext:cvs.openacs.org:/cvsroot co CVSROOT
         cd CVSROOT
        -emacs modules

        Add a line of the form:

        photo-album-portlet openacs-4/packages/photo-album-portlet

        Commit the change:

        cvs commit -m "added alias for package newpackage" modules

        This should print something like:

        cvs�commit:�Examining�.
        +emacs modules

        Add a line of the form:

        photo-album-portlet openacs-4/packages/photo-album-portlet

        Commit the change:

        cvs commit -m "added alias for package newpackage" modules

        This should print something like:

        cvs�commit:�Examining�.
        ****�Access�allowed:�Personal�Karma�exceeds�Environmental�Karma.
        Checking�in�modules;
        /cvsroot/CVSROOT/modules,v��<--��modules
        new�revision:�1.94;�previous�revision:�1.93
        done
        cvs�commit:�Rebuilding�administrative�file�database

      4. Although you should add your package on HEAD, you should do package development on the latest release branch that your code is compatible with. So, after completing the import, you may want to branch your package:

        cd /var/lib/aolserver/service0/packages/newpackage
        -cvs tag -b oacs-5-1
      5. See the section called “How to package and release an OpenACS Package”

      Note

      Some packages are already in cvs at openacs-4/contrib/packages. Starting with OpenACS 5.1, we have a Maturity mechanism in the APM which makes the contrib directory un-necessary. If you are working on a contrib package, you should move it to /packages. This must be done by an OpenACS administrator. On cvs.openacs.org:

      1. cp -r /cvsroot/openacs-4/contrib/packages/package0 /cvsroot/openacs-4/packages
      2. Update the modules file as described above.

      3. Remove the directory from cvs in the old location using cvs rm. One approach for file in `find | grep -v CVS`; do rm $file; cvs remove $file; done

    +cvs tag -b oacs-5-1

  3. See Section�, “How to package and release an OpenACS Package”

Note

Some packages are already in cvs at openacs-4/contrib/packages. Starting with OpenACS 5.1, we have a Maturity mechanism in the APM which makes the contrib directory un-necessary. If you are working on a contrib package, you should move it to /packages. This must be done by an OpenACS administrator. On cvs.openacs.org:

  1. cp -r /cvsroot/openacs-4/contrib/packages/package0 /cvsroot/openacs-4/packages
  2. Update the modules file as described above.

  3. Remove the directory from cvs in the old location using cvs rm. One approach for file in `find | grep -v CVS`; do rm $file; cvs remove $file; done

Rules for Committing Code to the OpenACS repository

CVS commit procedures are governed by @@ -82,11 +83,11 @@ versions.

  • CVS commit messages and code comments should refer to - bug, tip, or patch number if appropriate, in the format "resolves - bug 11", "resolves bugs 11, resolves bug 22". "implements tip 42", - "implements tip 42, implements tip 50", "applies patch 456 by User - Name", "applies patch 456 by User Name, applies patch 523 by - ...". + bug, tip, or patch number if appropriate, in the format "resolves + bug 11", "resolves bugs 11, resolves bug 22". "implements tip 42", + "implements tip 42, implements tip 50", "applies patch 456 by User + Name", "applies patch 456 by User Name, applies patch 523 by + ...".

  • When to TIP

    1. @@ -122,7 +123,7 @@ Tags

      1. When a package is released in final form, the developer - shall tag it "packagename-x-y-z-final" and "openacs-x-y-compat". x-y + shall tag it "packagename-x-y-z-final" and "openacs-x-y-compat". x-y should correspond to the current branch. If the package is compatible with several different core versions, several compat tags should be applied. @@ -135,7 +136,7 @@ flag which defaults to no-effect wouldn't require a TIP. Added a new mandatory flag to an existing function would require a TIP. -

      +

    Reasons

    We don't currently have clear standards for committing @@ -171,7 +172,7 @@ applies to all packages. This tag can be used to fork packages as needed, and provides a common ancestor between the fork and the OpenACS code so that patches can be generated. -

    +

    Informal Guidelines

    Informal guidelines which may be obsolete in places and should be reviewed: @@ -214,12 +215,12 @@

  • Always accompany a commit with a brief but informative comment. If your commit is related to bug number N and/or patch - number P, indicate this in the commit comment by including "bug N" - and/or "patch P". This allows us to link bugs and patches in the + number P, indicate this in the commit comment by including "bug N" + and/or "patch P". This allows us to link bugs and patches in the Bug Tracker with changes to the source code. For example suppose you are committing a patch that closes a missing HTML tag, then an - appropriate comment could be "Fixing bug 321 by applying patch 134. - Added missing h3 HTML close tag". + appropriate comment could be "Fixing bug 321 by applying patch 134. + Added missing h3 HTML close tag".

  • Commit one cohesive bug fix or feature change at a time. Don't put a bunch of unrelated changes into one commit.