bin/check-implementer-notes.py |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

New commits:
commit 3daa966b6e256cabe9633386d67ce99387af2830
Author:     Thorsten Behrens <thorsten.behr...@cib.de>
AuthorDate: Thu Apr 30 02:55:13 2020 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Wed May 6 22:57:40 2020 +0200

    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.st...@cib.de>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Tested-by: Jenkins

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)
+
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to