commit:     49c22943ba73c948023881452525420fe61210bf
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 15 23:41:27 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Jan 16 11:07:39 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=49c22943

OutdatedBlocker: update from 2 years -> 4 years

2 years is too aggressive IMHO. See de65ca7b4a3f3a68b65b56e2dcaf6e511d3a3443
for a recent example of this in ::gentoo but there's been plenty of such
cases in #gentoo on IRC where we got users upgrading fine but they became
unstuck by a removed blocker.

Such blockers are really cheap and the purpose of the warning is really
to remove ancient cruft rather than actually obstruct people upgrading
systems where it's viable.

Note that it's especially problematic because of the current behaviour
of python-exec where emerge won't be able to resume if python-exec got
updated but portage hasn't yet been rebuilt w/ new PYTHON_TARGETS.

(... because if any interruption occurs, it can be fatal.)

Bug: https://bugs.gentoo.org/916498
Signed-off-by: Sam James <sam <AT> gentoo.org>

 src/pkgcheck/checks/metadata.py | 4 ++--
 tests/checks/test_metadata.py   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/pkgcheck/checks/metadata.py b/src/pkgcheck/checks/metadata.py
index 3c3b4bf9..c81c5b09 100644
--- a/src/pkgcheck/checks/metadata.py
+++ b/src/pkgcheck/checks/metadata.py
@@ -995,7 +995,7 @@ class DependencyCheck(Check):
 
 
 class OutdatedBlocker(results.VersionResult, results.Info):
-    """Blocker dependency removed at least two years ago from the tree.
+    """Blocker dependency removed at least four years ago from the tree.
 
     Note that this ignores slot/subslot deps and USE deps in blocker atoms.
     """
@@ -1061,7 +1061,7 @@ class OutdatedBlockersCheck(Check):
                         removal = max(x.time for x in matches)
                         removal = datetime.fromtimestamp(removal)
                         years = (self.today - removal).days / 365
-                        if years >= 2:
+                        if years >= 4:
                             outdated_blockers[attr].add((atom, round(years, 
2)))
                     else:
                         nonexistent_blockers[attr].add(atom)

diff --git a/tests/checks/test_metadata.py b/tests/checks/test_metadata.py
index be5ae182..55825307 100644
--- a/tests/checks/test_metadata.py
+++ b/tests/checks/test_metadata.py
@@ -1098,8 +1098,8 @@ class TestOutdatedBlockersCheck(misc.ReportTestCase):
             self.init_check(future=days)
             self.assertNoReport(self.check, self.source)
 
-        # blocker was removed at least 2 years ago
-        for days, years in ((730, 2), (1825, 5)):
+        # blocker was removed at least 4 years ago
+        for days, years in ((1460, 4), (1825, 5)):
             self.init_check(future=days)
             r = self.assertReport(self.check, self.source)
             expected = metadata.OutdatedBlocker(

Reply via email to