Skip to content

Commit e70e71e

Browse files
committed
indexer: a big refactor to change how we abort indexing
We replace $dist->{SKIP} with $ctx->dist_errors. This accumulates a list of reasons to stop indexing the whole dist (although usually only one can show up). $dist->{REASON_TO_SKIP} is also replaced by dist_errors. Previously, SKIP (a bool) meant to skip and REASON_TO_SKIP meant "and tell the user this". Now, there is always a reason, and the error contains a separate flag indicating whether to send it to the user. Previously, some skip reasons were REASON_TO_SKIP, but others were other properties on the $dist object, like HAS_BLIB or HAS_MULTIPLE_ROOT. These are now dist errors, so there's a uniform handling of their description, and they can abort processing in a uniform way. Code that wants to abort can $ctx->abort_indexing, which adds a dist_error uses an exception to stop processing the dist further. I deleted a bunch of code managing the "you don't have permissions on the distribution-name package", which is the thing that asserts you must have permission on Foo::Bar to upload Foo-Bar. Previously, this code still summarized each pmfile scanned, and then fixed up the results to act like passing modules failed. Now, this error is simply displayed as a total dist failure. I think it should be possible to show the package indexing summary again in the future, but for now the code was overly complex and didn't really add much value. I broke out two hunks of email content generating code, done just to reduce the total size of the mail_summary subroutine.
1 parent 322485f commit e70e71e

4 files changed

Lines changed: 173 additions & 287 deletions

File tree

0 commit comments

Comments
 (0)