Page MenuHomePhabricator

Don't reference git masters in package.json
Closed, ResolvedPublic

Description;86354b89eda66e37e37f29769e9de3585d6f3b05$70 brings in the dependency

"kartotherian-core": "git+",

Although I'm sure it worked when it was written, it's now broken because that repository [contains @kartotherian/core, not kartotherian-core](

This causes a fresh install to fail with

[2017-09-28T19:59:40.968Z] FATAL: kartotherian/18321 on pippin: Cannot find module 'kartotherian-core'

Event Timeline

Looking through an install log, the following are pulling from git and have a commit. These are probably referencing master, but need checking

+-- xmldoc@0.3.1  (git+
+-- wikimedia-mapdata@0.3.0  (git+
+-- postgis-vt-util@0.3.0  (git+
+-- osm-bright-fonts@1.0.3  (git+
+-- kad@1.3.6  (git+

PRs in for postgis-vt-util, osm-bright-fonts. I can't find kad used, so wonder if it's coming from service-runner. Opened T184431: Move kartotherian to xmldoc 1.x for xmldoc.

Still need to do wikimedia-mapdata after breakfast.

wikimedia-mapdata is referencing a specific commit, so it's okay.

PRs merged, new versions of everything uploaded, but I don't have access to publish to for kartotherian or tilerator.

ping @Yurik about getting access to the kartotherian and tilerator projects on npmjs.

@Pnorman, I have added you to the kartotherian npmjs project a week ago. Were you not able to publish?

PRs in for postgis-vt-util, osm-bright-fonts. I can't find kad used, so wonder if it's coming from service-runner.

Yes, kad is a service-runner thing.

gerritbot added subscribers: Unknown Object (User), gerritbot.Jul 3 2018, 7:53 PM

Change 443682 had a related patch set uploaded (by Mholloway; owner: Mholloway):
[mediawiki/extensions/Kartographer@master] Use published version of @wikimedia/mapdata

Change 443682 merged by jenkins-bot:
[mediawiki/extensions/Kartographer@master] Use published version of @wikimedia/mapdata

Change 444009 had a related patch set uploaded (by Mholloway; owner: Mholloway):
[mediawiki/extensions/Kartographer@master] Use published wikimedia fork of Leaflet.Sleep

Mholloway edited projects, added Maps; removed Maps (Kartotherian).

Moving columns because this applies to both Karotherian and Kartographer.

Change 444009 merged by jenkins-bot:
[mediawiki/extensions/Kartographer@master] Use published wikimedia fork of Leaflet.Sleep

xmldoc (a dependency of @kartotherian/module-loader) is going to be tricky to update, and here's why:

The *Loader classes in module-loader expose an update method meant to allow updating the internal representation of a parsed XML or YAML file and returning the result as an XML or YAML string. xmldoc, which the XmlLoader class uses to parse XML docs, doesn't appear to be designed for manipulating parsed XML, but only for reading it, and its XMLDocument and XMLElement classes don't provide any public interface for updating their contents. This is currently worked around by manipulating the val property of xmldoc XMLElement objects of interest.[1] As of a later commit adding typed nodes, this approach will no longer work, as for at least some node types the XMLElement's toString function ignores the val value in favor of other internal properties.[2]

I think it's a mistake to rely on xmldoc's internal representation of an XML element as we're currently doing. As the current example shows, this ties us to a specific version of xmldoc essentially forever. We can't take advantage of the CDATA handling later added upstream, which was the original reason for forking, or any other updates.

Since xmldoc doesn't expose a public API for updating parsed XML contents, I think we have the wrong tool for the job. I'd recommend switching to a more full-featured library; libxmljs is the go-to in this area, and appears to provide the functionality we're looking for.


Has splitting the module-loader module into separate XML and YAML loaders (module-loader-xml and module-loader-yaml) been considered?

Maybe a better question is this: Do we want kartotherian and tilerator to be able to continue to support XML definition files, or is it reasonable these days only to support YAML? What's the state of the art these days?

If we're ready to drop XML support, then we can split up module-loader, use only module-loader-yaml in kartotherian and tilerator (via core), and the xmldoc stuff mentioned above falls in priority to the point where we don't really have to worry about it anymore, though it would be a welcome volunteer contribution. If dropping XML support is too drastic a move, then we'll have to get to the xmldoc stuff soon.

xml is only needed to configure Mapnik - so if it is possible to use some standard component to convert yml->xml for it, it would work. I think the issue here is that Mapnik is doing some non-standard xml parsing - hence all the problems. @Pnorman would know this better.

I'd rather not drop XML support, because it's still used by some people to develop tiles, and very important for writing testcases.

For the styles we have, there's no need to have XML at rest and the conversion to XML is handled within tilelive-tmsource and tilelive-tmstyle

PR to switch to libxmljs:

I believe that's the last git master reference at issue here. (As noted above there's also kad coming from service-runner, which I'll have to bug the services team about sometime, but that seems out of scope.)