Skip to content

add more tests, change one index case - #597

Merged
rjbs merged 9 commits into
andk:masterfrom
rjbs:more-tests-and-reject-weird-provides
Oct 12, 2026
Merged

rjbs merged 9 commits into
andk:masterfrom
rjbs:more-tests-and-reject-weird-provides

Conversation

@rjbs

@rjbs rjbs commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

This is adding tests for things I touch in #405 so that it can be reviewed with more confidence.

It also changes one thing:

  • when provides has malformed package names, the whole dist is taken to be broken and rejected

provides is there to say "I know better than the indexer". If you fail too hard at the fundamentals, we just ask you to work it out yourself.

rjbs and others added 8 commits October 11, 2026 13:01
ExtUtils::MakeMaker writes "no_index: { directory: [t, inc] }" into META
by default, so nearly every real upload has a no_index entry.  Our fakes
didn't, which meant PAUSE::pmfile::filter_ppps always took its early "no
no_index, keep everything" exit, and its real logic went untested.

upload_author_fake now adds that default.  A test can pass its own
no_index, or no_index => undef to get none.

Co-Authored-By: Claude <[email protected]>
These dists have no "provides", so they're indexed by scanning files,
which is where PAUSE::pmfile::filter_ppps applies no_index rules.
Nothing tested those rules before.

Co-Authored-By: Claude <[email protected]>
These were clobbering the caller's $_.  Sometimes, the caller had $_
aliased to a r/o value, which led to a crash.  So: localize but also add
a test that a readonly $_ doesn't break the indexer generally.

Co-Authored-By: Claude <[email protected]>
PAUSE has skipped dists whose META says distribution_type is "script"
since 2007.  This just provides test coverage.

Co-Authored-By: Claude <[email protected]>
Trial releases, files that aren't dists, and perl-like tarballs from
non-pumpkings are never indexed.  These tests record that none of them
currently sends the uploader a report.

Co-Authored-By: Claude <[email protected]>
Log::Dispatchouli's to_file argument is going away, but we use it both
for showing the logfile to the public *and* for testing.

Just reimplement it in PAUSE::Logger::_Logger, easy.
When a dist was skipped for a reason without its own special text, like
an unstable release_status, mail_summary printed the reason, then fell
through to its "nothing was indexed" cases.  So the report went on to
say that no indexable packages were found, or that META said the dist
provided no packages, neither of which was why it was skipped.

Now, when there's a skip reason, the report just gives that.

Co-Authored-By: Claude <[email protected]>
Previously, a malformed package name in "provides" was skipped when its
package came up for indexing, and the dist's other packages were indexed.
If "provides" is wrong about package names, though, we have no reason to
trust the rest of it, and indexing part of a dist is worse than indexing
none of it.

Now we check every name in "provides" before indexing anything, and
reject the whole dist with a failure report if any is malformed.  The
name check moves into PAUSE::package->name_is_insane so it can be used
without a package object.

This is a change in behavior.  The new t/bad-package-names.t checks that
such a dist is rejected, and that other dists in the same run are still
indexed.

Co-Authored-By: Claude <[email protected]>
Comment thread lib/PAUSE/Logger.pm
@rjbs
rjbs merged commit 9852e56 into andk:master Oct 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants