[neon-notifications] Changes in repo-metadata

Neon CI noreply at kde.org
Sun May 24 19:46:15 BST 2020


commit 757cad0aa3f5d0c0630ec390e81d37f5f50582a8
Author: Ben Cooksley <bcooksley at kde.org>
Date:   Mon May 25 06:13:13 2020 +1200

    Turns out the Projects API depended on this file, so add it back for now.
    Ideally this would go away sooner rather than later

diff --git a/config/i18n_defaults.json b/config/i18n_defaults.json
new file mode 100644
index 00000000..504113a1
--- /dev/null
+++ b/config/i18n_defaults.json
@@ -0,0 +1,15 @@
+{
+    "frameworks/*" : {
+        "trunk" : "none",
+        "stable" : "none",
+        "trunk_kf5" : "master",
+        "stable_kf5" : "none"
+    },
+
+    "*" : {
+        "trunk" : "none",
+        "stable" : "none",
+        "trunk_kf5" : "none",
+        "stable_kf5" : "none"
+    }
+}

commit cc09215e2c2e2ef5d63f3a065e3a2fc18fd37ea6
Author: Ben Cooksley <bcooksley at kde.org>
Date:   Sun May 24 22:21:13 2020 +1200

    Eliminate legacy projects.kde.org/kde_projects.xml generator

diff --git a/config/common.json b/config/common.json
deleted file mode 100644
index fd1c504f..00000000
--- a/config/common.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "repostore" : "/srv/git/"
-}
diff --git a/config/i18n_defaults.json b/config/i18n_defaults.json
deleted file mode 100644
index 504113a1..00000000
--- a/config/i18n_defaults.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "frameworks/*" : {
-        "trunk" : "none",
-        "stable" : "none",
-        "trunk_kf5" : "master",
-        "stable_kf5" : "none"
-    },
-
-    "*" : {
-        "trunk" : "none",
-        "stable" : "none",
-        "trunk_kf5" : "none",
-        "stable_kf5" : "none"
-    }
-}
diff --git a/config/urls_gitrepo.json b/config/urls_gitrepo.json
deleted file mode 100644
index 5913508e..00000000
--- a/config/urls_gitrepo.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-    "git" : { "access" : "read-only", "url" : "git://anongit.kde.org/{0}" },
-    "http" : { "access" : "read-only", "url" : "https://anongit.kde.org/{0}" },
-    "ssh" : { "access" : "read+write", "url" : "git at git.kde.org:{0}" },
-    "tarball" : { "access" : "read-only", "url" : "https://anongit.kde.org/{0}/{0}-latest.tar.gz" }
-}
diff --git a/config/urls_webaccess.json b/config/urls_webaccess.json
deleted file mode 100644
index 7109ab84..00000000
--- a/config/urls_webaccess.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "gitweb" : "https://cgit.kde.org/{0}.git"
-}
diff --git a/output/.gitignore b/output/.gitignore
deleted file mode 100644
index 5e7d2734..00000000
--- a/output/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore
diff --git a/refreshxml.sh b/refreshxml.sh
deleted file mode 100755
index 738ccaec..00000000
--- a/refreshxml.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-# Copyright 2016 Boudhayan Gupta <bgupta at kde.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of KDE e.V. (or its successor approved by the
-#    membership of KDE e.V.) nor the names of its contributors may be used
-#    to endorse or promote products derived from this software without
-#    specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-XMLDEST="/srv/www/projects.kde.org/"
-VENVDIR="py3env"
-
-# Change into the directory we live in it
-cd $(dirname $0)
-
-# update the repo
-git fetch -q
-git rebase -q
-
-# build and activate the python3 virtualenv
-if [ ! -d $VENVDIR ]
-then
-    virtualenv --system-site-packages -p python3 py3env
-    . py3env/bin/activate
-    pip install gitpython
-    deactivate
-fi
-
-# build the xml and indices
-. py3env/bin/activate
-python scripts/BuildXML.py
-python scripts/BuildRepoIndex.py
-deactivate
-
-# copy it to the correct place
-cp output/kde_projects.xml $XMLDEST
diff --git a/scripts/BuildRepoIndex.py b/scripts/BuildRepoIndex.py
deleted file mode 100755
index 7f9465dc..00000000
--- a/scripts/BuildRepoIndex.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/python3
-# Copyright 2016 Boudhayan Gupta <bgupta at kde.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of KDE e.V. (or its successor approved by the
-#    membership of KDE e.V.) nor the names of its contributors may be used
-#    to endorse or promote products derived from this software without
-#    specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import yaml
-
-try:
-    import simplejson as json
-except ImportError:
-    import json
-
-try:
-    from scandir import scandir
-except ImportError:
-    from os import scandir
-
-def getRepoName(metadir):
-    metafile = os.path.join(metadir, "metadata.yaml")
-    if not os.path.isfile(metafile):
-        return None
-
-    with open(metafile) as f:
-        meta = yaml.load(f)
-
-    if not meta["hasrepo"]:
-        return None
-    return meta["repopath"]
-
-def indexByRepo(root, base):
-    repomap = {}
-    for entry in scandir(root):
-        if entry.is_dir():
-            reponame = getRepoName(entry.path)
-            if reponame:
-                repomap[reponame] = entry.path[len(base) + 1:]
-            subdirmap = indexByRepo(os.path.join(root, entry.name), base)
-            if subdirmap:
-                repomap.update(subdirmap)
-    return repomap
-
-if __name__ == "__main__":
-
-    base = os.path.abspath("projects")
-    index = indexByRepo(base, base)
-
-    with open("output/repoindex.json", "w") as f:
-        json.dump(index, f)
diff --git a/scripts/BuildTree.py b/scripts/BuildTree.py
deleted file mode 100755
index b408d478..00000000
--- a/scripts/BuildTree.py
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/usr/bin/python3
-# Copyright 2016 Boudhayan Gupta <bgupta at kde.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of KDE e.V. (or its successor approved by the
-#    membership of KDE e.V.) nor the names of its contributors may be used
-#    to endorse or promote products derived from this software without
-#    specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import yaml
-import lxml.etree
-
-try:
-    import simplejson as json
-except ImportError:
-    import json
-
-def ProcessRepo(el):
-    repoActive = False
-    repoPath = None
-
-    for child in el:
-        tag = child.tag.lower()
-        if tag == "url" and child.attrib["protocol"] ==  "ssh":
-            repoPath = child.text.strip().split(":")[1]
-        elif tag == "active" and child.text.strip().lower() == "true":
-            repoActive = True
-
-    return (repoActive, repoPath)
-
-def ProcessI18NBranches(el):
-    branches = []
-    for child in el:
-        if child.tag.lower() == "branch":
-            try:
-                branches.append((child.attrib["i18n"], child.text.strip()))
-            except:
-                continue
-    branches = dict(branches)
-    return json.dumps(branches)
-
-def ProcessMetadata(el):
-    metaData = {
-        "type" : el.tag.lower(),
-        "name" : None,
-        "description" : None,
-        "projectpath" : None,
-        "hasrepo" : False,
-        "repopath" : None,
-        "repoactive" : False,
-        "icon" : None,
-        "members" : []
-    }
-
-    for child in el:
-        tag = child.tag.lower()
-
-        if tag == "name":
-            try:
-                metaData["name"] = child.text.strip()
-            except:
-                continue
-        elif tag == "description":
-            try:
-                metaData["description"] = child.text.strip()
-            except:
-                continue
-        elif tag == "path":
-            try:
-                metaData["projectpath"] = child.text.strip().lower()
-            except:
-                continue
-        elif tag == "icon":
-            try:
-                metaData["icon"] = child.text.strip().lower()
-            except:
-                continue
-        elif tag == "member":
-            data = { "username" : child.attrib["username"], "displayname" : child.text.strip() }
-            metaData["members"].append(data)
-        elif tag == "repo":
-            metaData["hasrepo"] = True
-            metaData["repoactive"], metaData["repopath"] = ProcessRepo(child)
-
-    return yaml.dump(metaData, default_flow_style = False)
-
-def RecursiveVisit(el):
-    for child in el:
-        tag = child.tag.lower()
-
-        if tag in ("component", "module", "project"):
-            name = child.attrib["identifier"]
-            if not os.path.isdir(name):
-                os.mkdir(name)
-            os.chdir(name)
-
-            with open("metadata.yaml", "w") as f:
-                f.write(ProcessMetadata(child))
-            RecursiveVisit(child)
-
-            os.chdir("..")
-        elif tag == "repo":
-            with open("i18n.json", "w") as f:
-                f.write(ProcessI18NBranches(child))
-
-if __name__ == "__main__":
-    root = lxml.etree.ElementTree().parse("masters/kde_projects.xml")
-    os.chdir("projects")
-    RecursiveVisit(root)
-    os.chdir("..")
diff --git a/scripts/BuildXML.py b/scripts/BuildXML.py
deleted file mode 100755
index 997d338e..00000000
--- a/scripts/BuildXML.py
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/python3
-# Copyright 2016 Boudhayan Gupta <bgupta at kde.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of KDE e.V. (or its successor approved by the
-#    membership of KDE e.V.) nor the names of its contributors may be used
-#    to endorse or promote products derived from this software without
-#    specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import yaml
-import git
-import copy
-import collections
-import fnmatch
-import lxml.etree
-
-try:
-    import simplejson as json
-except ImportError:
-    import json
-
-# load all configuration data
-
-COMMONCFG = None
-with open("config/common.json") as f:
-    COMMONCFG = json.load(f)
-
-I18NDEFAULTS = None
-with open("config/i18n_defaults.json") as f:
-    I18NDEFAULTS = json.load(f, object_pairs_hook = collections.OrderedDict)
-
-UGITREPO = None
-with open("config/urls_gitrepo.json") as f:
-    UGITREPO = json.load(f)
-
-UWEBACCESS = None
-with open("config/urls_webaccess.json") as f:
-    UWEBACCESS = json.load(f)
-
-# done loading configuration data
-
-def GetI18NRules(path):
-    for k in I18NDEFAULTS.keys():
-        if (fnmatch.fnmatch(path, k)):
-            return copy.deepcopy(I18NDEFAULTS[k])
-    return { "trunk" : "none", "stable" : "none", "trunk_kf5" : "none", "stable_kf5" : "none" }
-
-def ProcessDirectory(el, path):
-    # enter the directory and start processing
-    os.chdir(path)
-
-    # process metadata first
-    projectpath = None
-    repopath = None
-
-    if os.path.isfile("metadata.yaml"):
-        meta = None
-        with open("metadata.yaml") as f:
-            meta = yaml.load(f)
-
-        # read in the project and repository paths
-        projectpath = meta["projectpath"]
-        if meta["hasrepo"]:
-            repopath = meta["repopath"]
-
-        elem = lxml.etree.SubElement(el, meta["type"])
-        elem.set("identifier", path)
-
-        # build the metadata part of the xml
-        name = lxml.etree.SubElement(elem, "name")
-        name.text = meta["name"]
-        desc = lxml.etree.SubElement(elem, "description")
-        desc.text = meta["description"]
-        icon = lxml.etree.SubElement(elem, "icon")
-        icon.text = meta["icon"]
-        path = lxml.etree.SubElement(elem, "path")
-        path.text = meta["projectpath"]
-
-        web = lxml.etree.SubElement(elem, "web")
-        if repopath:
-            web.text = UWEBACCESS["gitweb"].format(repopath)
-
-        for member in meta["members"]:
-            mel = lxml.etree.SubElement(elem, "member")
-            mel.set("username", member["username"])
-            mel.text = member["displayname"]
-
-        # process repository data next
-        if meta["hasrepo"]:
-            repoel = lxml.etree.SubElement(elem, "repo")
-
-            active = lxml.etree.SubElement(repoel, "active")
-            active.text = str(meta["repoactive"]).lower()
-
-            for k in UWEBACCESS.keys():
-                wel = lxml.etree.SubElement(repoel, "web")
-                wel.set("type", k)
-                wel.text = UWEBACCESS[k].format(repopath)
-
-            for k in UGITREPO.keys():
-                uel = lxml.etree.SubElement(repoel, "url")
-                uel.set("protocol", k)
-                uel.set("access", UGITREPO[k]["access"])
-                uel.text = UGITREPO[k]["url"].format(repopath)
-
-            gitrepopath = os.path.join(COMMONCFG["repostore"], repopath) + ".git"
-            try:
-                gitrepo = git.Repo(gitrepopath)
-                for branch in gitrepo.branches:
-                    bel = lxml.etree.SubElement(repoel, "branch")
-                    bel.text = branch.name
-            except Exception as exc:
-                print("error: no git repository at {0}. unable to get branches. exception {1}".format(gitrepopath, exc))
-
-            # add in the i18n rules
-            i18n_rules = GetI18NRules(projectpath)
-
-            # get the i18n overrides
-            i18n_ovr = {}
-            if os.path.isfile("i18n.json"):
-                with open("i18n.json") as f:
-                    i18n_ovr = json.load(f)
-
-            for k in i18n_ovr.keys():
-                i18n_rules[k] = i18n_ovr[k]
-
-            # write the i18n branches
-            for b in i18n_rules.keys():
-                bel = lxml.etree.SubElement(repoel, "branch")
-                bel.set("i18n", b)
-                bel.text = i18n_rules[b]
-
-    # recurse into subdirectories
-    for entry in os.listdir("."):
-        if os.path.isdir(entry):
-            ProcessDirectory(elem, entry)
-
-    # done
-    os.chdir("..")
-
-if __name__ == "__main__":
-
-    # build the root element
-    root = lxml.etree.Element("kdeprojects")
-    root.set("version", "1")
-
-    # walk through the project hierarchy
-    os.chdir("projects")
-    for entry in os.listdir("."):
-        ProcessDirectory(root, entry)
-    os.chdir("..")
-
-    # write it to a file
-    fname = "output/kde_projects.xml"
-    tree = lxml.etree.ElementTree(root)
-    tree.write(fname, pretty_print = True, xml_declaration = True, encoding = "utf-8")

commit 116152d72226795525ac5902d534029dd8327321
Author: Ben Cooksley <bcooksley at kde.org>
Date:   Sun May 24 09:06:29 2020 +1200

    Archive user-manager repository as requested.
    
    Ref T13188

diff --git a/projects-invent/plasma/user-manager/metadata.yaml b/projects-invent/plasma/user-manager/metadata.yaml
index 1b79443f..e7801fac 100644
--- a/projects-invent/plasma/user-manager/metadata.yaml
+++ b/projects-invent/plasma/user-manager/metadata.yaml
@@ -3,5 +3,5 @@ hasrepo: true
 identifier: user-manager
 name: user-manager
 projectpath: kde/workspace/user-manager
-repoactive: true
+repoactive: false
 repopath: plasma/user-manager



More information about the neon-notifications mailing list