Page MenuHomePhabricator

OOjs UI's PHP docs should be auto-generated
Closed, ResolvedPublic

Description

Mediawiki has autogenerated JS and PHP docs at:
http://doc.wikimedia.org/mediawiki-core/master/php
http://doc.wikimedia.org/mediawiki-core/master/js

OOjs UI currently has docs at:
https://doc.wikimedia.org/oojs-ui/master/

These should be split into PHP and JS sections like for core.

There should be a Jenkins job which runs doxygen with a Doxyfile present at the root of the repo which updates doc.wikimedia.org. Look at jenkins:tools/mwcore-docgen.sh which is triggered by the mediawiki-core-doxygen-publish job.

hashar: cscott: I would go with a configuration file named 'Doxyfile' at the root of the repository and a thin JJB job template that just invokes Doxygen
hashar: cscott: that would let dev easily tweak the doxygen configuration without having to make a JJB conf change and refresh the job


Version: unspecified
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:46 AM
bzimport added a project: OOUI.
bzimport set Reference to bz72454.

gerritadmin wrote:

Change 168490 had a related patch set uploaded by Cscott:
Conf for doxygen based PHP doc

https://gerrit.wikimedia.org/r/168490

gerritadmin wrote:

Change 168490 merged by jenkins-bot:
Conf for doxygen based PHP doc

https://gerrit.wikimedia.org/r/168490

Does this now need a jenkins config change?

(In reply to James Forrester from comment #3)

Does this now need a jenkins config change?

Definitely :-)

I wrote an overview of the architecture we are using to generate documentation on slave and have them ultimately published to doc.wikimedia.org. It has a very simple job template example: https://www.mediawiki.org/wiki/Continuous_integration/Documentation_generation

Some additional guidelines:

  • the job should be run on Trusty slaves using:

    node: contintLabsSlave && UbuntuTrusty
  • use the zuul-cloner to clone the repository (see jjb/macro-scm.yaml) should be as simple as:

    builders:
      • zuul-cloner: projects: "oojs/ui"

        The clone is made under $WORKSPACE/src/$ZUUL_PROJECT so the doxygen builder would be:
    • shell: | cd src/$ZUUL_PROJECT doxygen
  • the output destination is defined in the Doxyfile. We could parse the file to figure it out but it is probably easier to just hardcode it for now:
    • push-doc: docsrc: 'src/oojs/ui/docs/php' # path in the workspace docdest: 'oojs-ui/php' # destination under doc.wikimedia.org

A few culprits:

  • there is already some jsduck documentation published, probably want to namespace the path based on the language (php / js).
  • we do not have a shell helper yet to easily namespace by git branch / tag. IIRC there is some logic around hardcoded in the jsduck macro for it.

Later on we can refactor the resulting job template to make it reusable by other projects as well.

And I just found out on stackoverflow that we can probably override the destination directory used by doxygen using something like:

( cd $WORKSPACE/src/$ZUUL_PROJECT; cat Doxyfile ; echo "HTML_OUTPUT=$WORKSPACE/build/doc" ) | doxygen -

Thus the push-docs macro docsrc parameter can be hardcoded to "build/doc" :D

gerritadmin wrote:

Change 170012 had a related patch set uploaded by Hashar:
contint: Graphviz on Jenkins slaves

https://gerrit.wikimedia.org/r/170012

gerritadmin wrote:

Change 170012 merged by Dzahn:
contint: Graphviz on Jenkins slaves

https://gerrit.wikimedia.org/r/170012

Jdforrester-WMF renamed this task from OOjs UI: PHP docs should be auto-generated to PHP docs should be auto-generated.Dec 2 2014, 12:36 AM
Jdforrester-WMF set Security to None.
matmarex raised the priority of this task from Medium to High.Feb 17 2015, 2:35 PM
Jdforrester-WMF renamed this task from PHP docs should be auto-generated to OOjs UI's PHP docs should be auto-generated.Mar 4 2015, 3:46 PM

Change 222503 had a related patch set uploaded (by Legoktm):
Add 'oojs-ui-doxygen-publish' job

https://gerrit.wikimedia.org/r/222503

Change 222503 merged by jenkins-bot:
Add 'oojs-ui-doxygen-publish' job

https://gerrit.wikimedia.org/r/222503

Change 222517 had a related patch set uploaded (by Legoktm):
Add link to OOUI PHP documentation

https://gerrit.wikimedia.org/r/222517

Change 222517 merged by jenkins-bot:
Add link to OOUI PHP documentation

https://gerrit.wikimedia.org/r/222517

Legoktm subscribed.

ta-da: https://doc.wikimedia.org/oojs-ui/master/php/

The README needs some prettying, but we can deal with that in a follow up.