summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham+renesas@ideasonboard.com>2018-11-01 11:48:03 +0000
committerKieran Bingham <kieran.bingham+renesas@ideasonboard.com>2018-12-07 11:27:59 +0000
commit286cf9ae26bb9545bfaf82730355863e38fdbe4a (patch)
tree02da8a59ebc529a0c8cc5f6a1bb5b5d2e6d52fb0
parentf3e0f5d843a4a7266019e1b47de6537eb5aa33cc (diff)
periject: YAML Validation
Utilise pykwalify to provide a YAML schema for our data files. Define an initial project schema under projects/ to define our data layout. An example task data file is provided to demonstrate how the data could be presented in text form. A validator is provided which currently simply calls pykwalify. This is just an initial demonstration of the validation process and can be expanded upon later to provide automa{t,g}ic commit title processing, and further business logic can be added with extra tools. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
-rw-r--r--README.md17
-rw-r--r--projects/linux/testtask.yaml24
-rw-r--r--projects/project.schema.yaml82
-rwxr-xr-xscripts/validator15
4 files changed, 138 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..46e2483
--- /dev/null
+++ b/README.md
@@ -0,0 +1,17 @@
+# PeriJect: A git-backed task management system
+
+Data is stored through a folder hierarchy in yaml data files. Data can be
+edited by hand and validated using the provided schema files or tools can be
+developed to aid the creation and manipulation of the data sources.
+
+## Project Dependancies:
+
+ - pykwalify:
+
+ Documentation: https://pykwalify.readthedocs.io/
+ Installation: pip3 install pykwalify
+
+ Custom validation is possible with pykwalify which may assist with complex
+ use cases in the future. See:
+
+ - https://pykwalify.readthedocs.io/en/unstable/extensions.html#how-custom-validation-works
diff --git a/projects/linux/testtask.yaml b/projects/linux/testtask.yaml
new file mode 100644
index 0000000..959ed6a
--- /dev/null
+++ b/projects/linux/testtask.yaml
@@ -0,0 +1,24 @@
+title: How to make a task
+team: MM
+key: fedd3f9c-dc85-11e8-bfeb-834cd5092819
+assignee: Kieran
+status: New
+
+bsp-commits:
+ - e0868bcfd529997cf98da1dd14bab8cb8175eda7
+ # arm64: dts: r8a77990: Support IPMMU(MMU mode) for IPMMU-VP0 and IPMMU-VC0
+ - 6d9666fb78526a7728cc4954ec1da4c2b416753d
+ # arm64: dts: r8a77965: Support IPMMU(MMU mode) for IPMMU-VP0 and IPMMU-VC0
+
+upstream-commits:
+ - torvalds:
+ - 84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d # Linux 4.19
+ - 6d9666fb78526a7728cc4954ec1da4c2b416753d # arm64: Alternative: Multiline automagic commit title population
+ - linux-next:
+ - e0868bcfd529997cf98da1dd14bab8cb8175eda7 # <automagically filled in text here>
+
+comments:
+ - Added a new thing
+ - New widget fixed
+ With this as a multiline?
+ - And then a new one
diff --git a/projects/project.schema.yaml b/projects/project.schema.yaml
new file mode 100644
index 0000000..52a7b80
--- /dev/null
+++ b/projects/project.schema.yaml
@@ -0,0 +1,82 @@
+---
+
+## See https://pykwalify.readthedocs.io/en/unstable/validation-rules.html
+
+schema;gitcommit:
+ desc: SHA1 in the form \b[0-9a-f]{12,40}\b.*
+ type: str
+ pattern: \b[0-9a-f]{12,40}\b.*
+
+schema;uuid:
+ desc: Unique key defining items and relationship links.
+ Generated by the application 'uuid'
+ type: str
+ pattern: \b[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}\b
+
+
+###
+### Our main schema
+###
+
+type: map
+mapping:
+ title:
+ type: str
+ required: True
+
+ team:
+ type: str
+ required: True
+ enum: ['Core', 'IO', 'MM']
+
+ assignee:
+ type: str
+ required: True
+
+ key:
+ include: uuid
+ required: True
+
+ status:
+ type: str
+ required: True
+ enum: ['New', 'Active', 'Blocked', 'Paused', 'Done', 'Abandoned']
+
+# Optional Fields
+ assigneee:
+ type: str
+
+ bsp-commits:
+ desc: A sequence / list of related BSP commits
+ https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=
+ sequence:
+ - include: gitcommit
+
+ upstream-commits:
+ desc: References to upstream commits
+ sequence:
+ - mapping:
+ torvalds:
+ desc: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=
+ sequence:
+ - include: gitcommit
+ linux-next:
+ desc: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=
+ sequence:
+ - include: gitcommit
+
+ parent:
+ desc: A reference to another topic key which must already exist
+ include: uuid
+
+ dependencies:
+ sequence:
+ - include: uuid
+ unique: True
+
+ target-date:
+ type: date
+
+ comments:
+ sequence:
+ - type: str
diff --git a/scripts/validator b/scripts/validator
new file mode 100755
index 0000000..0913e93
--- /dev/null
+++ b/scripts/validator
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+#
+# Task file validator
+#
+# Currently, just calls pykwalify, however we could later anticipate
+# expanding to perform SHA1 commit title expansion and more complex
+# validation rules.
+# At that point, this could potentially become a python script and pull
+# in the pykwalify libraries to check internally.
+#
+
+TASKFILE=$1
+
+pykwalify -s projects/project.schema.yaml -d $TASKFILE