]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
daily job: check debian autoremovals 12115/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 21 Oct 2022 09:14:41 +0000 (11:14 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 21 Oct 2022 22:53:15 +0000 (00:53 +0200)
.github/workflows/misc-dailies.yml
build-scripts/check-debian-autoremovals.py [new file with mode: 0755]

index c3986dbc3733ef4e09d6be8cd57a116037eeedb7..04771121c44f779ee77c235fcede35d4893a35a7 100644 (file)
@@ -19,3 +19,14 @@ jobs:
           echo "::notice ::No newer devtoolset exists (good)"
           exit 0
         fi
+
+  check-debian-autoremovals:
+    runs-on: ubuntu-22.04
+    steps:
+    - uses: actions/checkout@v3.1.0
+      with:
+        fetch-depth: 5
+        submodules: recursive
+
+    - name: Check if Debian is about to toss us off a balcony
+      run: ./build-scripts/check-debian-autoremovals.py
diff --git a/build-scripts/check-debian-autoremovals.py b/build-scripts/check-debian-autoremovals.py
new file mode 100755 (executable)
index 0000000..583c4fd
--- /dev/null
@@ -0,0 +1,57 @@
+#!/usr/bin/python3
+import yaml
+import requests
+import sys
+import re
+
+def getTitleForBugs(bugs):
+    ret = []
+    title_regex = re.compile(r'<title>(.*) - Debian Bug report logs</title>')
+    for bug in bugs:
+        bug_r = requests.get('https://bugs.debian.org/cgi-bin/bugreport.cgi', params={'bug':bug})
+        lines = bug_r.text.split('\n')
+        for line in lines:
+            match = title_regex.search(line)
+            if match:
+                ret.append(match.group(1))
+                break
+    return ret
+
+
+r = requests.get('https://udd.debian.org/cgi-bin/autoremovals.yaml.cgi')
+data = yaml.load(r.text, Loader=yaml.SafeLoader)
+msg = ''
+
+keys = ['pdns', 'pdns-recursor', 'dnsdist']
+
+removals = []
+
+for key in keys:
+    if not key in data.keys():
+        continue
+    removals.append(key)
+    msg += "::warning ::%s slated for removal from Debian on %s (https://tracker.debian.org/pkg/%s) " % (key, data[key]['removal_date'], key)
+    if data[key]['dependencies_only']:
+        msg += "because there are bugged dependencies.\n\n"
+    else:
+        msg += "because of a bug in PowerDNS!\n\n"
+
+    bugs = getTitleForBugs(data[key].get('bugs_dependencies', []))
+    if len(bugs):
+        msg += "This is caused by the following dependency bug%s:\n  " % ('s' if len(bugs) > 1 else '')
+        msg += '\n  '.join(bugs)
+
+    bugs = getTitleForBugs(data[key]['bugs'])
+    if len(bugs):
+        msg += "This is caused by the following bug%s in PowerDNS:\n  " % ('s' if len(bugs) > 1 else '')
+        msg += '\n  '.join(bugs)
+
+    msg += "\n"
+
+    print(msg)
+
+if removals:
+    sys.exit(1)
+else:
+    print("::notice ::No packages marked for autoremoval from Debian (yay!)")
+    sys.exit(0)