Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Dist::Zilla-style plugin architecture for actions #6

Closed
pshangov opened this Issue · 3 comments

3 participants

@pshangov

Currently a pinto command executes what has been defined in its corresponding action class. I would like, instead, for Pinto to be able to work with plugins, so that the purpose of an action would be to load all plugins implementing a corresponding role and execute them in turn.

For example:

Pinto::Role::Mirror - role requiring a 'mirror' method
Pinto::Plugin::MyMirror - plugin implementing Pinto::Role::Mirror and providing a custom 'mirror method'
Pinto::Action::Mirror - load all plugins implementing Pinto::Role::Mirror and execute their 'mirror' method.

This is the architectire that Dist::Zilla and Perlanet use.

Most of the current pinto actions would then have corresponding roles, and a plugin will implement one or more of these as necessary. Examples:

Pinto::Role::Mirror - mirror stuff

  • plugin to mirror the latest releases on CPAN
  • plugin to mirror all of CPAN
  • plugin to mirror only specific releases on CPAN (e.g. CPAN::Mini::Devel)
  • plugin to mirror specific releases from BackPAN, from a list in a configuration file

Pinto::Role::Index - update index after new distributions have been added

  • plugin to update 02packages.details.txt.gz
  • plugin to update pinto.db
  • plugin to update other sources, e.g. ElastticSearch for a local MetaCPAN::API, or a CPANIDX index
  • plugin to create a RECENT file
  • plugin to send an email message to all developers that the repo has been updated

Pinto::Role::Clean - a role that allows plugins (e.g. mirroring plugins) to say which files they no longer need
Pinto::Role::Verify - a role that allows plugins to check that whatever files they care about are consistent with the index
Pinto::Role::Initialize - a role that allows plugins to do stuff at repo creation, e.g. to set up pinto.db or other databases

I am willing to work on this feature if you believe it makes sense to implement.

@karenetheridge

Sounds interesting.. it would likely also help eliminate the duplication between the code that describes the command line syntax for commands, and the moose attributes that contain those configs (drawing again on what Dist::Zilla does here), and the duplication between pinto-admin and pinto-remote.

(PS. I've created the #pinto channel on irc.perl.org... currently it's just me there.. but this could be the start of a new community!)

@thaljef
Owner
@thaljef
Owner

I've gotten better at using roles, but I still don't see an opportunity to make Pinto totally pluggable like Dist::Zilla. So I'm gonna stick with this architecture for now. But I'm always open to new ideas if you can show me a better way.

@thaljef thaljef closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.