Last modified: 2014-09-24 15:58:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60620, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58620 - Jenkins: Generate KSS docs from LESS and publish to doc.wikimedia.org
Jenkins: Generate KSS docs from LESS and publish to doc.wikimedia.org
Status: PATCH_TO_REVIEW
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 64221 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-18 03:17 UTC by spage
Modified: 2014-09-24 15:58 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2013-12-18 03:17:25 UTC
MobileFrontend generates documentation of its CSS with actual sample rendered HTML from the project's source LESS files, see http://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMobileFrontend.git/HEAD/Makefile .  Gerrit change #98990 generates this documentation for core CSS/LESS. It would be nice if this documentation appeared in doc.wikimedia.org along with other generated documentation.

This sounds like bug 48337. Presumably there's some Zuul job somewhere building the doc that appears.
Comment 1 Antoine "hashar" Musso (WMF) 2013-12-18 09:12:41 UTC
S, as a first step we need a way to deploy kss on the Jenkins slave.

It seems that is a nodejs application so I guess we want to use our own repository that would provide kss and ALL the required modules.  We did such a thing to provide ruby bundler (integration/bundler.git) and phpunit (integration/phpunit.git).

Could you take care of having an integration/kss.git repository created and upload there the kss + its npm modules ?


Once done, register that repository in git-deploy configuration. That is done in operations/puppet.git under manifests/role/deployment.pp.  The deployment would then be done from tin.eqiad.wmnet.


Then, we need a shell script wrapper that would execute the script (deployed somewhere under /srv/deployment/integration/kss ).  https://doc.wikimedia.org/ document root is under /srv/org/wikimedia/doc/  the following sub directories are usually: <project-name> / <branch> / <doc component>.  Example:

 /srv/org/wikimedia/doc/mediawiki-core/REL1_22/js


So I guess you would want to have kss generate the doc to  /srv/org/wikimedia/doc/mediawiki-core/master/css


Once done, we need a new job-template in Jenkins Job Builder configuration, apply it to mediawiki/core project.  The job will need to be added in Zuul configuration (integration/zuul-config.git) in the postmerge pipeline.
Comment 2 Krinkle 2013-12-19 05:28:26 UTC
Target url should indeed me something like one of these this:


https://doc.wikimedia.org/mediawiki-core/master/less/
https://doc.wikimedia.org/mediawiki-core/master/css/
https://doc.wikimedia.org/mediawiki-core/master/style-guide/css/

Preferences, anyone?

(where master can also be REL1_22, and in the future tags like 1.23.0)

With a shortcut from the https://doc.wikimedia.org/ home page, of course.

PS: I'm planning on renaming /mediawiki-core to /mediawiki at some point (with redirects and symlinks of course).
Comment 3 Gerrit Notification Bot 2013-12-21 11:48:25 UTC
Change 103095 had a related patch set uploaded by Spage:
Add integration/kss to deployment repo config

https://gerrit.wikimedia.org/r/103095
Comment 4 Antoine "hashar" Musso (WMF) 2013-12-31 12:08:19 UTC
I have created a .gitreview file for integration/kss.git repository so we can add it in the deployment system.
Comment 5 Gerrit Notification Bot 2013-12-31 12:09:13 UTC
Change 103095 merged by Alexandros Kosiaris:
Add integration/kss to deployment repo config

https://gerrit.wikimedia.org/r/103095
Comment 6 Antoine "hashar" Musso (WMF) 2014-02-24 11:35:08 UTC
Pending upload of kss in integration/kss.git so we can get it deployed on Jenkins slaves.  Then we need some script to generate the doc and move the generated doc under the doc website.
Comment 7 Antoine "hashar" Musso (WMF) 2014-05-02 12:03:21 UTC
Since mss is a node module, we could have it added to the integration/jenkins.git repository which has tools/package.json. It currently provides:

 {
	"name": "wikimedia-integration-jenkins",
	"version": "0.2.5",
	"dependencies": {
		"grunt": "0.4.1",
		"grunt-cli": "0.1.13",
		"grunt-contrib-qunit": "0.4.0",
		"phantomjs": "~1.9.0-1",
		"grunt-contrib-csslint": "0.2.0",
		"jshint": "2.4.4"
	}
 }

So maybe add kss in there and forget about git-deploy and integration/kss.
Comment 8 spage 2014-05-21 21:07:00 UTC
*** Bug 64221 has been marked as a duplicate of this bug. ***
Comment 9 spage 2014-09-18 21:58:13 UTC
In the interim, `ssh tools-login.wmflabs.org; become styleguide` is generating http://tools.wmflabs.org/styleguide/ in a cron job. I don't understand misc.yaml, mediawiki.yaml, zuul-config/layout.yaml enough to work on this.
Comment 10 Matthew Flaschen 2014-09-18 23:35:12 UTC
yardoc is now being used and Jenkins is populating https://doc.wikimedia.org/rubygems/mediawiki-ruby-api/ and https://doc.wikimedia.org/rubygems/mediawiki-selenium/ .  So that's something to study when implementing this.
Comment 11 Antoine "hashar" Musso (WMF) 2014-09-19 14:54:50 UTC
Can you reach out to Timo about it?  I think for Javascript purposes he would like developers to define npm entry points.  So we would simply invoke 'npm doc' or something and publish whatever is generated under a given dir (ex: /doc/).

That would let you define whatever you want to run to build documentation which is much more scalable than having to handle defines in jenkins.
Comment 12 Jon 2014-09-19 18:54:11 UTC
Timo is in the office this week.. Maybe you could grab him S?
Comment 13 Matthew Flaschen 2014-09-20 03:51:12 UTC
(In reply to Antoine "hashar" Musso from comment #11)
> Can you reach out to Timo about it?  I think for Javascript purposes he
> would like developers to define npm entry points.  So we would simply invoke
> 'npm doc' or something and publish whatever is generated under a given dir
> (ex: /doc/).

Do you mean Grunt (which runs on node.js)?  That's the node.js build tool I normally see used.
Comment 14 Antoine "hashar" Musso (WMF) 2014-09-22 07:55:42 UTC
> Do you mean Grunt (which runs on node.js)?  That's the node.js build tool
> I normally see used.

I guess npm as an entry point for jenkins (i.e. npm test) which would then use grunt to run a wide range of different tests :d
Comment 15 Gerrit Notification Bot 2014-09-22 18:05:50 UTC
Change 161998 had a related patch set uploaded by Prtksxna:
kss: Add Gruntfile

https://gerrit.wikimedia.org/r/161998
Comment 16 Matthew Flaschen 2014-09-24 03:55:30 UTC
(In reply to Antoine "hashar" Musso from comment #14)
> > Do you mean Grunt (which runs on node.js)?  That's the node.js build tool
> > I normally see used.
> 
> I guess npm as an entry point for jenkins (i.e. npm test) which would then
> use grunt to run a wide range of different tests :d

Hmm, thanks.  This is not a test though.

While "npm test" exists (https://www.npmjs.org/doc/cli/npm-test.html), "npm doc" does not.  There is apparently a way to have custom scripts (https://www.npmjs.org/doc/misc/npm-scripts.html , https://www.npmjs.org/doc/cli/npm-run-script.html), but we would need to standardize on a name (e.g. npm-run-script doc).

Is there such a convention already?
Comment 17 Antoine "hashar" Musso (WMF) 2014-09-24 15:41:48 UTC
Seems fine: npm-run-script doc

In Jenkins Job Builder, I have generic templates for python tox and ruby bundler:

'{name}-tox-{toxenv}'
'{name}-bundle-{bundlecommand}'  https://gerrit.wikimedia.org/r/#/c/160983/

So we can probably come up with a '{name}-npmrunscript-{npmscript}' command which would be realized as:

- project:
  name: VisualEditor
  npmscript:
   - doc
  jobs:
   - '{name}-npmrunscript-{npmscript}'


And the template would contain:

 npm run-script {npmscript}

Might need to add an 'npm install' before, not sure.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links