Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Plugin contribution

From MoodleDocs
Revision as of 04:45, 28 February 2008 by Anthony Borrow (talk | contribs)

Guidelines for Contributing Code

Question: I have written a new block, activity, patch or theme to share with the Moodle community. What is the process for contributing the code?

Answer: First, thank you for your generosity and desire to share your work with the rest of the Moodle community. Code contributions are highly valued and Moodle wants to encourage creativity and generosity in keeping with its constructivist tradition and pedagogical approach. To support this, there are several tools will support your contribution by allowing the code to be more easily found, tested, used, maintained, documented, and evaluated by fellow Moodlers and developers. Learning to use the various tools common among Moodle developers will help you to efficiently and effectively develop, share and maintain the contributed code.

Learning to Submit Code by Using the Tracker (http://tracker.moodle.org/)

After having identified code that you would like to contribute to the Moodle community, begin the process by creating an issue in the CONTRIB section of the tracker. The issue requests that the code be evaluated and uploaded into CVS. Provide a clear description of what the code does and the functionality that it adds to Moodle. Attach the contributed code as a zip (or tar.gz) file to the tracker issue. At that point, the Contrib Coordinator will work directly with the code contributor to help evaluate the code, work on resolving any questions/issues found, etc. Contributors are encouraged to follow Moodle's coding guidelines (https://docs.moodle.org/en/Development:Coding).

Learning to Work Code with CVS (http://cvs.moodle.org/)

Once the code has been added to the CONTRIB section of Moodle's CVS, the contributor will request CVS write access in order to be able to make changes to the contributed code. Contributors are encouraged to maintain a branch for each major Moodle release (i.e. 1.8, 1.9, etc.). The HEAD branch should be used as the development branch. Once CVS write access is approved, the maintainer will be able to make whatever changes are needed to maintain the code. More information on working with CVS is available at: https://docs.moodle.org/en/CVS_%28developer%29. Eclipse is an example of an Integrated Development Environment (IDE) that integrates and facilitates many of the common CVS tasks involved in working with Moodle CVS. Instructions for setting up and using are available at: https://docs.moodle.org/en/Eclipse. Developers are free to use the tools they are most comfortable/productive with.

Learning to Support Code by Providing Documentation (https://docs.moodle.org)

Having great code available is wonderful; however, it is important to educate users about how to use the code. Thus, after sharing contributed code it is helpful to provide users with documentation. Documentation pages can be created using the https://docs.moodle.org site. Contributors should create a page for the contributed code. The documentation page should include a Description of Features, Installation Instructions, Languages Supported, Known Issues, Supported Versions (for Moodle 1.8, 1.9), etc. This information will let others know how to use the contributed code or how they can become involved in supporting it. Documentation should include for which versions of Moodle the code is designed/intended to work. In addition, it is helpful to indicate for which versions of Moodle support is provided and the degree to which the code is being actively maintained. If a particular version (branch) is not being actively maintained by the contributor/maintainer, then other users may volunteer to help assist in that effort. Information about the maintainer(s) of the code helps users to know to whom they should be grateful. To facilitate an effective index of contributed code, it is helpful to make the page part of the Contributed Code category.

Learning to Share Code by Using the Modules and Plugins Database (http://moodle.org)

Moodle users can easily find information about contributed code in the Modules and Plugins database available at: http://moodle.org/mod/data/view.php?id=6009. To spread the word about the contributed code, the maintainer adds an entry to the Modules and Plugins database providing as much of the information as possible. Having the code in CVS allows for automatically generated nightly zips of the code and simplifies where the code can be found. This helps to avoids having several posts of code in the forums and allows users to effeciently and easily find the latest or most appropriate version of the contributed code. Thus, most contributed code will be found and available at http://download.moodle.org/. Similarly, most documentation should be available at https://docs.moodle.org/.

Learning to Maintain Code by Using the Tracker (http://tracker.moodle.org)

In order to facilitate keeping track of feature requests, bugs, and other code issues, the contributor may request that a component be created in the CONTRIB section of the Moodle tracker. The contributor can be added to the group of CONTRIB developers in the tracker to manage the issues assigned to them and better coordinate with other developers. Users of the contributed code can then add issues which can be assigned directly to the maintainer. The tracker helps to manage the work flow involved in fixing bugs, working through feature requests, and maintaining the code. When committing changes, maintainers are strongly encouraged to begin the commit comment with a tracker number. While it may seem like just one more thing to do, the process of thinking through, creating an issue in the tracker and describing the fix can help clarify the need for the code change. Further, it helps to establish good documentation about how the code developed. Others will be able to identify the issues addressed and understand why a particular decision was made.

Learning to Evolve Code Using the Moodle.org Forums (http://moodle.org)

As users become familiar with the contributed code, discussions about the code are likely to emerge on the Moodle.org site. It is important to respond to users who have questions about how to use the code, suggestions for how to make it better, etc. As the code becomes more popular, it may be helpful to create a specific forum to handle such discussions. If it looks like there is sufficient need for some contributed code to have its own forum, please create a request via the tracker in the MDL-SITE section. Eventually, the community may wish for the code to become part of the Moodle core. By following the steps above, the developers will be able to evaluate the merit of the contributed code, understand how users have used the code, see the issues that have emerged and thus have more information to make an informed decision about whether or not to incorporate the contributed code into core.

Goals

It is hoped that following this procedure, will help guide contributors of code in the process of learning the tools and skills used by the Moodle developers. Learning to submit code by using the tracker, work the code with CVS, support the code by providing documentation, share code in Modules and Plugins, maintain the code by using the tracker, and evolve the code by using the Moodle.org forums will assist you in successfully contributing to the Moodle community and working with Moodle's developers. Throughout this process, the CONTRIB Coordinator is here to encourage and support those contributing code to the Moodle community and fostering the development of tomorrow's Moodle developers.