Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

yegor256/datum

Repository files navigation

EO principles respected here DevOps By Rultor.com We recommend RubyMine

rake Hits-of-Code

Information about current project status is kept in XML and text files. This repository contains full list of XSD Schemas for them and rules of usage.

Read our policy, it covers all processes in these XML files.

Any problems you have with Zerocracy please report here. We promise to do our best to resolve them as soon as possible.

Data model

A project has a list of members, with assigned roles to them. Each project member, also known as user is identified by his GitHub name, for example yegor256.

There is only one piece of work, which is called a job. A job can either be in scope or not. If the job is in scope, it is listed in the wbs.xml.

A job, which is in scope, may have an order assigned to it, as a record in orders.xml. An order has a performer. An order may be finished (success) or terminated (failure).

A job, which is in scope, may have an election in elections.xml, which is created by Zerocrat automatically. The election is used as a basis for the decision making of an order assignment.

An order may have an impediment, which is listed in impediments.xml. While the impediment exists, the order won't be terminated by delay.

Upgrades

When we modify XSD schemas here, production XML documents don't catch up automatically. If we introduce a new XML element in, say, wbs.xsd, XML documents wbs.xml in real production projects won't have it. Right after we switch to a new version of Datum, they all will become invalid.

In order to solve this problem we have a collection of "upgrades," which are XSL transformations. When Xocument opens an XML document, it checks the version attribute of its root element. If the version is lower than Xocument.VERSION, it applies all necessary XSL transformations. Right at that moment we have a chance to upgrade XML documents and add necessary elements or attributes (or delete deprecated ones).

Every time you introduce something new to an XSD schema, don't forget to add an upgrade XSL. The name of upgrade XSL file must start with a version, where it has to be applied.

How to contribute?

We keep XSD Schema files in the xsd directory. You can modify them as you wish. However, keep in mind that you need 1) to test them, 2) make sure existing XML files in the projects will be upgraded to your changes, and 3) modify XSL views.

First, in order to test an .xsd file you should create .xml files in the xml directory. You can make as many of them them there as you need. All of them will be tested against the XSD Schema. If the name of the .xml file starts with a dash, it is expected that the validation against the XSD Schema will fail. If it won't fail, the build will break.

Second, every time you introduce some changes to the .xsd file, make sure you add an XSL Transformation to the upgrades directory. Each .xsl file must be named as XXX-name.xsl, where XXX is the version number it upgrades an .xml file to. All versions are here (we're using semantic versioninig).

Third, don't forget to add or modify XSL views in upgrades directory.

After all changes are made, don't forget to run:

$ bundle update
$ bundle exec rake

To make rake working you will need to install:

To install all dependencies for rake run in project directory:

$ bundle install
$ mvn dependency:get -DgroupId=net.sf.saxon -DartifactId=Saxon-HE -Dversion=9.8.0-8