rust-excuses: distinguish between temp and permanent fails
Ximin Luo
2 years ago
60 | 60 | BG_NOT_IN_DEBIAN = "#cc0000" |
61 | 61 | BG_OLD_IN_DEBIAN = "#ffcc66" |
62 | 62 | BG_TOO_NEW = "#66ff99" |
63 | BG_MISC_WAIT = "#ffcc99" | |
63 | 64 | BG_MISC_FAIL = "#ff6666" |
64 | 65 | BG_SOURCEONLY = "#9999ff" |
66 | VERDICT_FAIL = ("REJECTED_CANNOT_DETERMINE_IF_PERMANENT", "REJECTED_NEEDS_APPROVAL", "REJECTED_PERMANENTLY") | |
65 | 67 | |
66 | 68 | def traverse(name, arch="", d=0): |
67 | 69 | if name in already_seen: |
106 | 108 | traverse(dep, arch, d + 1) |
107 | 109 | |
108 | 110 | policy = excuses.get(name, {}).get("policy_info", {}) |
109 | failed = [k for (k, v) in policy.items() if v.get("verdict", "") != "PASS"] | |
111 | failed = {k: v["verdict"] for (k, v) in policy.items() if v.get("verdict", "") != "PASS"} | |
110 | 112 | attrs = {"shape": "box"} |
111 | 113 | if "age" in failed: |
112 | failed.remove("age") | |
114 | del failed["age"] | |
113 | 115 | attrs.update({ "fillcolor": BG_TOO_NEW, "style": "filled" }) |
114 | 116 | if "autopkgtest" in failed: |
115 | 117 | for k, v in policy["autopkgtest"].items(): |
120 | 122 | if u and u.startswith("https://ci.debian.net/data/autopkgtest/testing"): |
121 | 123 | print(u, file=rust_regressions) |
122 | 124 | if failed: |
123 | attrs.update({ "label": "\\N\\nfailed: %s" % ",".join(failed) }) | |
124 | bg = BG_SOURCEONLY if failed == ["builtonbuildd"] else BG_MISC_FAIL | |
125 | if list(failed.keys()) == ["builtonbuildd"]: | |
126 | bg = BG_SOURCEONLY | |
127 | attrs.update({ "label": "\\N\\nneeds source-only upload" }) | |
128 | elif any(v in VERDICT_FAIL for v in failed.values()): | |
129 | bg = BG_MISC_FAIL | |
130 | attrs.update({ "label": "\\N\\nfailed: %s" % ",".join(failed.keys()) }) | |
131 | else: | |
132 | bg = BG_MISC_WAIT | |
133 | attrs.update({ "label": "\\N\\nwaiting: %s" % ",".join(failed.keys()) }) | |
125 | 134 | attrs.update({ "fillcolor": bg, "style": "filled" }) |
126 | 135 | print_all('"%s" [%s]' % (name, ",".join("%s=\"%s\"" % p for p in attrs.items()))) |
127 | 136 |