Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Request for feedback: interface to 06perms.txt

11 views
Skip to first unread message

Neil Bowers

unread,
Oct 12, 2012, 4:54:28 AM10/12/12
to module-...@perl.org, mod...@perl.org
I've created an interface to PAUSE's 06perms.txt file, which currently contains two classes:

PAUSE::PermissionsFile
Module::Permissions

Here's example usage:

use PAUSE::PermissionsFile;

$pp = PAUSE::PermissionsFile->new;
$mp = $pp->module_permissions('HTTP::Client');

$owner    = $mp->owner;
@comaints = $mp->co_maintainers;

print "owner   : $owner\n";
print "comaint : @comaints\n", 

Which would print:

owner   : LINC
comaint : NEILB

By default PAUSE::PermissionsFile will mirror (using HTTP::Tiny's mirror) 06perms.txt, and then work off the local copy. You can pass a path to the constructor, if you've got your own local copy anyway. The module_permissions method returns an instance of Module::Permissions for the named module. This lets you get at the individual 'm', 'f', and 'c' entries for the module, but also provides the 'owner' concept ('m' if there is one, otherwise 'f').

I'd be happy to hear any thoughts on:
  • naming
  • design of the interface
  • other features you think this might need
Cheers,
Neil

Shlomi Fish

unread,
Oct 13, 2012, 5:25:11 AM10/13/12
to Neil Bowers, module-...@perl.org, mod...@perl.org
Hi Neil,

thanks for your contribution. See below for my comments.

On Fri, 12 Oct 2012 09:54:28 +0100
Neil Bowers <ne...@bowers.com> wrote:

> I've created an interface to PAUSE's 06perms.txt file, which
> currently contains two classes:
>
> PAUSE::PermissionsFile
> Module::Permissions

Preferably, those two classes should be under the same namespace.

>
> Here's example usage:
>
> use PAUSE::PermissionsFile;
>
> $pp = PAUSE::PermissionsFile->new;
> $mp = $pp->module_permissions('HTTP::Client');
>
> $owner = $mp->owner;
> @comaints = $mp->co_maintainers;
>
> print "owner : $owner\n";
> print "comaint : @comaints\n",
>

It would be a good idea to add "my" to the synposis, so as to make it
"use strict;"/"use warnings;"-compliant.

> Which would print:
>
> owner : LINC
> comaint : NEILB
>
> By default PAUSE::PermissionsFile will mirror (using HTTP::Tiny's
> mirror) 06perms.txt, and then work off the local copy.

I would suggest against contacting remote sites by default, due to
the "Test programs should not connect to Internet resources" item here:

http://www.shlomifish.org/open-source/resources/how-to-contribute-to-my-projects/HACKING.html

Regards,

Shlomi Fish

> You can pass a
> path to the constructor, if you've got your own local copy anyway.
> The module_permissions method returns an instance of
> Module::Permissions for the named module. This lets you get at the
> individual 'm', 'f', and 'c' entries for the module, but also
> provides the 'owner' concept ('m' if there is one, otherwise 'f').
>
> I'd be happy to hear any thoughts on:
> naming
> design of the interface
> other features you think this might need
> Cheers,
> Neil
>



--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
List of Text Editors and IDEs - http://shlom.in/IDEs

Yesterday I asked one of my students if she knew what an encyclopedia is, and
she said: “Is it something like Wikipedia?”.
http://twitter.com/alisonclement/status/8421314259

Please reply to list if it's a mailing list post - http://shlom.in/reply .

David Cantrell

unread,
Oct 15, 2012, 6:59:58 AM10/15/12
to module-...@perl.org
On Sat, Oct 13, 2012 at 11:25:11AM +0200, Shlomi Fish wrote:
> Neil Bowers <ne...@bowers.com> wrote:
> > By default PAUSE::PermissionsFile will mirror (using HTTP::Tiny's
> > mirror) 06perms.txt, and then work off the local copy.
> I would suggest against contacting remote sites by default, due to
> the "Test programs should not connect to Internet resources" item here:
>
> http://www.shlomifish.org/open-source/resources/how-to-contribute-to-my-projects/HACKING.html

Using a remote 06perms.txt is a sensible default, and doesn't mean that
he has to contact the remote host for testing. He presumably has some
way of over-riding the default, so the tests he distributes could use a
file:// URL.

However, I'm a bit lairy of "tests should not contact remote systems at
all".

IMO it's better to fail the tests and not install than to install and
then not behave as documented. But once you've verified that the remote
system still works the way you expect it to work, you should stop
hitting it and use your own copy for the rest of the tests, to avoid
putting undue load on the other system.

--
David Cantrell | top google result for "internet beard fetish club"

Immigration: making Britain great since AD43

Jonathan Yu

unread,
Oct 15, 2012, 8:30:06 AM10/15/12
to David Cantrell, module-...@perl.org
On Mon, Oct 15, 2012 at 6:59 AM, David Cantrell <da...@cantrell.org.uk> wrote:
However, I'm a bit lairy of "tests should not contact remote systems at
all".

For what it's worth, Debian packagers prefer to have an environment variable (i.e. TEST_INTERNET, HAS_INTERNET) be set before running any tests that explicitly require a remote connection. This is because Debian's build servers don't have Internet access; potentially some of the CPAN Testers servers fall under the same category.

I would therefore suggest either disabling those tests unless TEST_INTERNET/HAS_INTERNET is set, or using a shipped copy of that file for tests and only updating the file if TEST_INTERNET/HAS_INTERNET is set.

This also gives developers working on the package to run the full battery of tests (including those requiring Internet access) while also not requiring build servers to have connectivity.

Neil Bowers

unread,
Oct 14, 2012, 4:57:18 AM10/14/12
to Shlomi Fish, module-...@perl.org, mod...@perl.org
Hi Shlomi,

Thanks for your thoughts.

>> PAUSE::PermissionsFile
>> Module::Permissions
>
> Preferably, those two classes should be under the same namespace.

Yeah, I realised that as I continued working on it. They are now.

I'm leaning towards PAUSE::Permissions now, but am waiting to see what Andreas thinks.

> It would be a good idea to add "my" to the synposis, so as to make it
> "use strict;"/"use warnings;"-compliant.

I'm in two minds on that. Generally I think a SYNOPSIS should be as brief and clear as possible, to get across how to use the module, so sprinkling it with 'my' is a distraction. For example, all the reviews I write have SYNOPSIS style code examples, and none of them have 'my'. But the code is all run with strict and warnings, but I just predeclare everything before the section that gets included in the review.

But there's the subliminal "of course you always declare things, and use strict and warnings, right?" effect.

So I've added them :-)

>> By default PAUSE::PermissionsFile will mirror (using HTTP::Tiny's
>> mirror) 06perms.txt, and then work off the local copy.
>
> I would suggest against contacting remote sites by default, due to
> the "Test programs should not connect to Internet resources" item here:

The module mirrors by default, but for my tests I use a local mini 06perms.txt, for exactly the reasons you give.

Cheers,
Neil

0 new messages