summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2020-04-30 02:55:13 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-05-06 22:57:40 +0200
commit3daa966b6e256cabe9633386d67ce99387af2830 (patch)
tree08bbbb175971c7dab5309516488fd314c31fbe50 /bin
parent40bc11d4d6232c7acb94a3ae9efb5827f39eb64e (diff)
add cross-checking script for ODF implementer notes
- commits below schema/ need to be reflected by a correponding entry at https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes - ideally this script runs as part of major releases - sadly running it via CI is not possible, as commit hashes still change then Change-Id: I992c50d6bc6b869f6f57acc50d4d5c0a623b04ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93237 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Jenkins
Diffstat (limited to 'bin')
-rwxr-xr-xbin/check-implementer-notes.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/check-implementer-notes.py b/bin/check-implementer-notes.py
new file mode 100755
index 000000000000..378c16a6e933
--- /dev/null
+++ b/bin/check-implementer-notes.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+import json, re, subprocess, sys, urllib3
+
+http = urllib3.PoolManager()
+
+# TDF implementer notes pages for LibreOffice
+wiki_pages = [
+ 'https://wiki.documentfoundation.org/api.php?action=parse&format=json&page=Development/ODF_Implementer_Notes/List_of_LibreOffice_ODF_Extensions&prop=wikitext',
+ 'https://wiki.documentfoundation.org/api.php?action=parse&format=json&page=Development/ODF_Implementer_Notes/List_of_LibreOffice_OpenFormula_Extensions&prop=wikitext']
+
+# get all commit hashes mentioned in implementer notes
+wiki_commit_hashes = {}
+query = re.compile('\{\{commit\|(\\w+).*\}\}', re.IGNORECASE)
+for page in wiki_pages:
+ r = http.request('GET', page)
+ data = json.loads(r.data.decode('utf-8'))
+ for line in data['parse']['wikitext']['*'].split('\n'):
+ for res in query.finditer(line):
+ wiki_commit_hashes[res.group(1)] = ''
+
+# get all commits that change core/schema/* - and are _not_ mentioned
+# in the wiki page
+# Cut-off is Jan 1st 2020, when we started cleaning this up
+for commit in subprocess.check_output(
+ ['git', '--no-pager', '-C', sys.path[0]+'/..', 'log',
+ '--since=2020-01-01', '--format=%H', '--', 'schema/'],
+ stderr=subprocess.STDOUT).decode("utf-8").split("\n"):
+ if commit != '' and commit not in wiki_commit_hashes:
+ print('missing commit: %s' % commit)
+