[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: feedback on review-update-needed --lts --unclaim (Re: november report)



On 2018-11-20 16:06:53, Holger Levsen wrote:
> hi,
>
> this reply is mostly about using the tool itself, see below. I will now write
> another mail about the results from using it...
>

[...]

> So, third, what did "./bin/review-update-needed --unclaim --lts" do? Too
> much, so I ran (in a sid schroot where I have python3-humanfriendly
> installed) this: "schroot -- ./bin/review-update-needed --lts --unclaim 3w"
> and got:
>
> [output and]
> Traceback (most recent call last):
>   File "./bin/review-update-needed", line 129, in <module>
>     args.quiet or print("Claimed-By: {}".format(entry['claimed-by']))
> UnicodeEncodeError: 'ascii' codec can't encode character '\xe1' in position 24: ordinal not in range(128)
>
> (This only happens if I run ./bin/review-update-needed in schroot.)

Strange. I can't reproduce this in buster! It's especially strange that
this occurs in that segment, which I haven't really touched... I only
addded that "args.quiet or" there, but the "Claimed-by" has been there
for a while...

> However no changes were made.

Yeah, that's a total, typical, python unicode crash. :p Could you give
me more information on your locale? It looks like you don't have a UTF-8
locale, which will, naturally, cause problems when trying to display
non-ASCII characters in Python. There are workarounds for this, but I'm
not sure we should go through that trouble considering we control that
environment pretty well and it's fair to assume utf8...

> Fourth, the order of entries in the output and in data/dla-needed.txt is
> different, which is confusing and makes it harder to find entries, could
> that be fixed?

the list is sorted according to the `--sort-by`. We could add a
"unsorted" argument to that (or make that the default). What do you
prefer?

> Fifth, if a package is unclaimed, it would be good to include this in
> the package related output (and not just in the summary in the end), so 
> instead of for example:
>
> Package: icecast2
> Claimed-By: Abhijith PA
> Claimed-Date: 2018-11-04 11:25 (16 days ago)
> Last-Update: 2018-11-06 09:46 (14 days ago)
>
> it would be nicer if the output were
>
> Package: icecast2
> Claimed-By: Abhijith PA
> Claimed-Date: 2018-11-04 11:25 (16 days ago)
> Last-Update: 2018-11-06 09:46 (14 days ago)
> Unclaimed because last update was more than $timespan ago.

That's totally doable though. How does that look for you?

diff --git i/bin/review-update-needed w/bin/review-update-needed
index 976c0e9c82..fe4103b0d1 100755
--- i/bin/review-update-needed
+++ w/bin/review-update-needed
@@ -133,6 +133,7 @@ for entry in all_entries:
             date_to_format = datetime.utcfromtimestamp(entry['claimed-date'])
             if datetime.utcnow() - date_to_format > unclaim_delta:
                 unclaim_pkgs.append(entry['pkg'])
+                args.quiet or print("Unclaimed: idle for more than {}: {}".format(unclaim_delta, datetime.utcnow() - date_to_format))
     else:
         args.quiet or print("Unclaimed-Since: {}".format(format_date(entry['claimed-date'])))
     if entry['last-update'] > entry['claimed-date']:
@@ -149,7 +150,7 @@ for entry in all_entries:
         print("")
 
 if args.unclaim:
-    args.quiet or print("Packages to unclaim: {}".format(", ".join(unclaim_pkgs)))
+    args.quiet or print("Editing file to unclaim: {}".format(", ".join(unclaim_pkgs)))
     in_preamble = True
     with open(dsa_dla_needed) as orig, open(dsa_dla_needed + '.new', 'w') as new:
         for line in orig:

> Six, I ran "./bin/review-update-needed --lts --unclaim 1814400" on
> stretch and got useful output which I will summarize in another mail,
> so that we have one thread about improving the tool and another about
> unclaiming specific packages.

Awesome.

I'm surprised you're not getting the unicode error there though. Maybe
it's because UTF-8 locales are not setup in the schroot?

A.
-- 
Isn't man but a blossom taken by the wind, and only the mountains and
the sea and the stars and this Land of the Gods real and everlasting?
                       - James Clavell, Shōgun


Reply to: