Add a room version specification
The "Room Specification" (or "Room Version Specification") is the specification that defines which room versions do what and are intended to be documents which speak the truth about how rooms operate under the hood. The approach taken here is a bit different than other specifications. For starters, the specification is versioned in this project instead of relying on the matrix.org repository to track compiled HTML. This is done for a couple reasons, the first being we're still developing the v1 specification while concurrently making a v2 spec and the second being trying to reduce the reliance on matrix.org's repository for specifications. Because the room spec is built into versions, some changes needed to be made. The `targets.yaml` now has a special syntax for indicating what version something is at, and the changelog generator can handle rendering different versions of the same changelog (as parsed from the RST). Some additional work has been put in to the changelog parsing to allow us to reference the v1 room spec as "v1" without having to sacrifice clarity in the changelog headings. Finally, this moves the state resolution algorithms into the versioned spec as a result of MSC1759 (https://github.com/matrix-org/matrix-doc/pull/1759). Note: this does not introduce the concept of versioned schemas (tabs) that I was previously working with. There's currently no use for them, so they are shelved elsewhere.
This commit is contained in:
parent
8f1291a3e7
commit
ffe577371d
14 changed files with 609 additions and 245 deletions
|
@ -17,8 +17,11 @@ from batesian.sections import Sections
|
|||
import inspect
|
||||
import json
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class MatrixSections(Sections):
|
||||
|
||||
# pass through git ver so it'll be dropped in the input file
|
||||
|
@ -28,26 +31,19 @@ class MatrixSections(Sections):
|
|||
def render_git_rev(self):
|
||||
return self.units.get("git_version")["revision"]
|
||||
|
||||
def render_client_server_changelog(self):
|
||||
def render_changelogs(self):
|
||||
rendered = {}
|
||||
changelogs = self.units.get("changelogs")
|
||||
return changelogs["client_server"]
|
||||
|
||||
# TODO: We should make this a generic variable instead of having to add functions all the time.
|
||||
def render_push_gateway_changelog(self):
|
||||
changelogs = self.units.get("changelogs")
|
||||
return changelogs["push_gateway"]
|
||||
|
||||
def render_identity_service_changelog(self):
|
||||
changelogs = self.units.get("changelogs")
|
||||
return changelogs["identity_service"]
|
||||
|
||||
def render_server_server_changelog(self):
|
||||
changelogs = self.units.get("changelogs")
|
||||
return changelogs["server_server"]
|
||||
|
||||
def render_application_service_changelog(self):
|
||||
changelogs = self.units.get("changelogs")
|
||||
return changelogs["application_service"]
|
||||
for spec, versioned in changelogs.items():
|
||||
spec_var = "%s_changelog" % spec
|
||||
logger.info("Rendering changelog for spec: %s" % spec)
|
||||
for version, changelog in versioned.items():
|
||||
version_var = "%s_%s" % (spec_var, version)
|
||||
logger.info("Rendering changelog for %s" % version_var)
|
||||
rendered[version_var] = changelog
|
||||
if version == "unstable":
|
||||
rendered[spec_var] = changelog
|
||||
return rendered
|
||||
|
||||
def _render_events(self, filterFn, sortFn):
|
||||
template = self.env.get_template("events.tmpl")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue