ADAMK::Repository finally gains repository reporting

Alias on 2009-04-19T08:08:11

After a massive internal refactoring over the Easter Weekend that moved much of the main functionality into roles, my repository modelling efforts are now starting to hit critical mass.

The main model has managed to achieve a reasonable level of completeness, so I can deal with repositories and releases without having to think about them.

For any distribution or release, I can act on them at a file level via the main trunk checkout, or via a fresh temporary checkout, a fresh temporary export, or inside the release tarballs.

I've also added support for simple command line report generation using Text::Table.

As a result, some of the first repository-wide scanning and reporting tasks are working the way I had hoped. The goal of these reports is to help me be a better release manager, and deal with the increased number of commits coming into the repository from people other than me.

Here's an example of one of the new reports, which uses additions to the distribution Changes file to identify new work.

sub report_changed_versions {
	my $self = shift;
	my $repo = $self->repository;
	my @rows = ();
	$self->trace("Scanning distributions...\n");
	foreach my $dist ( $repo->distributions_released ) {
		# Untar the most recent release
		my $extract = $dist->latest->extract;

# Ignore anything weird that doesn't have Changes files next unless -f $dist->changes_file; next unless -f $extract->changes_file;

my $name = $dist->name; my $trunk = $dist->changes->current->version; my $release = $extract->changes->current->version; if ( $trunk eq $release ) { # No new significant changes next; } push @rows, [ $name, $trunk, $release, $dist->svn_author ]; }

# Generate the table print ADAMK::Util::table( [ 'Name', 'Trunk', 'Release', 'Last Commit By' ], @rows, ); }


This results in the followout command line output.
D:\cpan\trunk\ADAMK-Repository>adamk report_changed_versions
Preloading releases...
Preloading distributions...
Scanning distributions...

|---------------------------|---------|----------|-------------------| | Name | Trunk | Release | Last Commit By | |---------------------------|---------|----------|-------------------| | ADAMK-Repository | 0.10 | 0.09 | adamk@cpan.org | | Acme-BadExample | 1.01 | 1.01_01 | adamk@cpan.org | | CGI-Capture | 1.12 | 1.11 | adamk@cpan.org | | CPAN-WWW-Top100-Generator | 0.03 | 0.02 | adamk@cpan.org | | CSS-Tiny | 1.16 | 1.15 | adamk@cpan.org | | Class-Autouse | 1.99_03 | 1.99_02 | adamk@cpan.org | | Class-Inspector | 1.24 | 1.23 | adamk@cpan.org | | DBD-SQLite | 1.22_09 | 1.22_08 | corion@cpan.org | | Data-JavaScript-Anon | 1.03 | 1.01 | adamk@cpan.org | | Date-Tiny | 1.04 | 1.03 | adamk@cpan.org | | DateTime-Tiny | 1.04 | 1.03 | adamk@cpan.org | | Email-Stuff | 2.08 | 2.06 | chorny@cpan.org | | File-BLOB | 1.07 | 1.06 | adamk@cpan.org | | File-IgnoreReadonly | 0.02 | 0.01 | adamk@cpan.org | | File-Remove | 1.43 | 1.42 | miyagawa@cpan.org | | HTTP-Client-Parallel | 0.03 | 0.02 | adamk@cpan.org | | JSAN-Client | 0.17 | 0.16 | adamk@cpan.org | | JSAN-Shell | 2.00_06 | 2.00_05 | adamk@cpan.org | | Net-IP-Resolver | 0.03 | 0.02 | adamk@cpan.org | | PITA-Image | 0.41 | 0.40 | adamk@cpan.org | | PPI | 1. | 1.204_01 | smueller@cpan.org | | PPI-Tester | 0.14 | 0.06 | adamk@cpan.org | | Params-Util | 0.39 | 0.38 | adamk@cpan.org | | Parse-CPAN-Meta | 0.05 | 0.03 | smueller@cpan.org | | Parse-CSV | 1.01 | 1.00 | adamk@cpan.org | | Perl-Dist | 1.13 | 1.12 | adamk@cpan.org | | Perl-Dist-Strawberry | 1.10 | 1.09 | adamk@cpan.org | | Perl-Dist-WiX | 0.171 | 0.170 | adamk@cpan.org | | Portable | 0.13 | 0.12 | adamk@cpan.org | | Task-CatInABox | 0.02 | 0.01 | zarquon@cpan.org | | Template-Plugin-NakedBody | 0.03 | 1.03 | adamk@cpan.org | | TinyAuth | 0.99 | 0.98 | adamk@cpan.org | | Win32-Env-Path | 0.02 | 0.01 | adamk@cpan.org | | Win32-TieRegistry | 0.26 | 0.24 | szabgab@gmail.com | | pip | 0.14 | 0.13 | adamk@cpan.org | | prefork | 1.03 | 1.02 | adamk@cpan.org | |---------------------------|---------|----------|-------------------|


This level of information is one step beyond anything I've had to work with before, because it specifically identifies all the modules where I'm holding up other people's work.

There's a ton more fields I could put into the report that I'm leaving out at the moment. Some ability to filter the reports by command line flag would be helpful as well, as I have to create each new report from scratch at the moment.

The other piece of work that's next on my to do list is the "make test" integration, so I can tell not just which distributions have changed, but which have changed AND pass their tests.

This then becomes more of a "What work am I holding up, that I could fix right this instant".

For example, I hadn't realised before there were any external commits on Win32::TieRegistry. So I've been able to go and make a release of Win32::TieRegistry now. One less piece of work I'm not a bottleneck on any more.


You might want to widen out the table a little bit

DiamondInTheRough on 2009-04-19T14:26:34

Or does it auto-widen as needed?

Because the version numbers on one of my modules are... well, let's say the current version is 0.305217 (they map to the version of an external program, so I'm kinda stuck.)

Re:You might want to widen out the table a little

Alias on 2009-04-19T23:54:00

Text::Table deals with all the auto-widening stuff for me.

Re:You might want to widen out the table a little

DiamondInTheRough on 2009-04-20T02:32:43

Text::Table deals with all the auto-widening stuff for me.

Good. :)