Skip to content

Commit 7621107

Browse files
committed
Add an orphaned filter to display unmaintained packages
Use is as simple as `opam ci status -f orphaned`. We use a heuristic to determine if the package has no maintainers; please submit more to A.is_unmaintained if you spot more packages that could benefit. Closes #19 Signed-off-by: Anil Madhavapeddy <[email protected]>
1 parent 90b9f3c commit 7621107

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/opam-ci/main.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ let filter_t =
6363
will show failures for just the flambda, release-candidate or \
6464
safe-string tests respectively. $(i,lagging) will show the packages \
6565
whose latest release is uninstallable against the latest version of \
66-
the compiler. $(i,all) will show all known results for all versions \
67-
including successes."
66+
the compiler. $(i,orphaned) will list all the packages that do not \
67+
have an active maintainer, and so are looking for community help to \
68+
take care of them. $(i,all) will show all known results for all \
69+
versions including successes."
6870
in
6971
let open Arg in
7072
let term =
@@ -73,6 +75,7 @@ let filter_t =
7375
; ("failures", `Failures)
7476
; ("recent", `Recent)
7577
; ("lagging", `Lagging)
78+
; ("orphaned", `Orphaned)
7679
; ("variants:ss", `Variants `SS)
7780
; ("variants:fl", `Variants `Flambda)
7881
; ("variants:rc", `Variants `RC) ]

src/opam-ci/user.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ module A = struct
151151
match (ss, uss) with
152152
| (`Ok | `Unknown | `Uninstallable), `Uninstallable -> true
153153
| _ -> false
154+
155+
let is_unmaintained pkg =
156+
pkg.maintainers = []
157+
|| List.mem "https://github.com/ocaml/opam-repository/issues"
158+
pkg.maintainers
159+
|| List.mem "[email protected]" pkg.maintainers
154160
end
155161

156162
module S = struct
@@ -233,6 +239,7 @@ type filters =
233239
| `Failures
234240
| `Recent
235241
| `Lagging
242+
| `Orphaned
236243
| `Variants of [`Flambda | `RC | `SS] ] }
237244

238245
type params = {distro: D.t option; ov: OV.t option; arch: OV.arch option}
@@ -302,6 +309,9 @@ let render_package ppf ~filters pkg =
302309
| `Lagging ->
303310
if A.is_lagging pkg.versions then
304311
render_packages ppf pkg.name [A.latest_version pkg.versions]
312+
| `Orphaned ->
313+
if A.is_unmaintained pkg then
314+
render_packages ppf pkg.name [A.latest_version pkg.versions]
305315
| `Failures ->
306316
List.filter (fun (_, m) -> A.has_fails m) pkg.versions
307317
|> render_packages ppf pkg.name

0 commit comments

Comments
 (0)