Skip to content

Commit

Permalink
Add a script to generate a release checklist from the RMG
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Dec 21, 2011
1 parent 99d49b3 commit da571fa
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 9 deletions.
109 changes: 109 additions & 0 deletions Porting/make-rmg-checklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!perl
use strict;
use warnings;
use autodie;

use Getopt::Long;
use Markdent::Simple::Document;

sub main {
my ( $help, $type );
GetOptions(
'type:s' => \$type,
'help' => \$help,
);

if ($help) {
print <<'EOF';
make-rmg-checklist [--type TYPE]
This script creates a release checklist as a simple HTML document. It accepts
the following arguments:
--type The release type for the checklist. This can be BLEAD-FINAL,
BLEAD-POINT, MAINT, or RC. This defaults to BLEAD-POINT.
EOF

exit;
}

$type = _validate_type($type);
my @heads = _parse_rmg($type);
_print_html(@heads);
}

sub _validate_type {
my $type = shift || 'BLEAD-POINT';

my @valid = qw( BLEAD-FINAL BLEAD-POINT MAINT RC );
my %valid = map { $_ => 1 } @valid;

unless ( $valid{ uc $type } ) {
my $err
= "The type you provided ($type) is not a valid release type. It must be one of ";
$err .= join ', ', @valid;
$err .= "\n";

die $err;
}

return $type;
}

sub _parse_rmg {
my $type = shift;

open my $fh, '<', 'Porting/release_managers_guide.pod';

my @heads;
my $include = 0;
my %skip;

while (<$fh>) {
if (/^=for checklist begin/) {
$include = 1;
next;
}

next unless $include;

last if /^=for checklist end/;

if (/^=for checklist skip (.+)/) {
%skip = map { $_ => 1 } split / /, $1;
next;
}

if (/^=head(\d) (.+)/) {
unless ( keys %skip && $skip{$type} ) {
push @heads, [ $1, $2 ];
}

%skip = ();
}
}

return @heads;
}

sub _print_html {
my @heads = @_;
my $markdown = q{};
for my $head (@heads) {
my $indent = ( $head->[0] - 2 ) * 4;

my $text = $head->[1];
$text =~ s/C<([^>]+)>/`$1`/g;

$markdown .= q{ } x $indent;
$markdown .= '* ' . $text . "\n";
}

print Markdent::Simple::Document->new()->markdown_to_html(
title => 'Perl Release Checklist',
markdown => $markdown,
);
}

main();
39 changes: 30 additions & 9 deletions Porting/release_managers_guide.pod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This document both helps as a check-list for the release engineer
and is a base for ideas on how the various tasks could be automated
or distributed.

The outline of a typical release cycle is as follows:
The checklist of a typical release cycle is as follows:

(5.10.1 is released, and post-release actions have been done)

Expand Down Expand Up @@ -98,15 +98,14 @@ with a whole bunch of extra post-release steps, even more than for MAINT.

=back

=for checklist begin

=head2 Prerequisites

Before you can make an official release of perl, there are a few
hoops you need to jump through:

=over 4

=item PAUSE account
=head3 PAUSE account

Make sure you have a PAUSE account suitable for uploading a perl release.
If you don't have a PAUSE account, then request one:
Expand All @@ -121,19 +120,19 @@ Andreas' email address at:

https://pause.perl.org/pause/query?ACTION=pause_04imprint

=item search.cpan.org
=head3 search.cpan.org

Make sure that search.cpan.org knows that you're allowed to upload
perl distros. Contact Graham Barr to make sure that you're on the right
list.

=item CPAN mirror
=head3 CPAN mirror

Some release engineering steps require a full mirror of the CPAN.
Work to fall back to using a remote mirror via HTTP is incomplete
but ongoing. (No, a minicpan mirror is not sufficient)

=item git checkout and commit bit
=head3 git checkout and commit bit

You will need a working C<git> installation, checkout of the perl
git repository and perl commit bit. For information about working
Expand All @@ -144,17 +143,18 @@ release. Have a chat with whichever evil perl porter tried to talk
you into the idea in the first place to figure out the best way to
resolve the issue.

=for checklist skip RC

=item Quotation for release announcement epigraph
=head3 Quotation for release announcement epigraph

I<SKIP this step for RC>

For all except an RC release of perl, you will need a quotation
to use as an epigraph to your release announcement.


=back

=for checklist

=head2 Building a release - advance actions

Expand Down Expand Up @@ -382,6 +382,8 @@ Another good HTML preview option is http://search.cpan.org/pod2html

If you make changes, be sure to commit them.

=for checklist skip BLEAD-POINT MAINT RC

=head3 remove stale perldeltas

For the first RC release that is ONLY for a BLEAD-FINAL, the perldeltas
Expand Down Expand Up @@ -472,6 +474,8 @@ Check that file over carefully:

$ git diff dist/Module-CoreList/lib/Module/CoreList.pm

=head4 Bump C<$Module::CoreList::VERSION>

If necessary, bump C<$VERSION> (there's no need to do this for
every RC; in RC1, bump the version to a new clean number that will
appear in the final release, and leave as-is for the later RCs and final).
Expand All @@ -487,6 +491,10 @@ file.

Add a perldelta entry for the new Module::CoreList version.

=for checklist skip RC

=head4 Update C<%Module::CoreList::release> and C<CAVEATS>

In addition, if this is a final release (rather than a release candidate):

=over 4
Expand All @@ -507,6 +515,7 @@ cherry-pick it back).

$ git commit -m 'Update Module::CoreList for 5.x.y' dist/Module-CoreList/lib/Module/CoreList.pm

=for checklist skip RC

=head3 update perlhist.pod

Expand All @@ -525,6 +534,7 @@ Be sure to commit your changes:

$ git commit -m 'add new release to perlhist' pod/perlhist.pod

=for checklist skip BLEAD-POINT

=head3 update patchlevel.h

Expand Down Expand Up @@ -756,6 +766,7 @@ report. Check that it shows up, then remember to close it!

=back

=for checklist skip BLEAD-POINT

=head3 monitor smokes

Expand Down Expand Up @@ -817,6 +828,7 @@ time to publish the tag you created earlier to the public git repo (e.g.):

$ git push origin tag v5.11.0

=for checklist skip BLEAD-POINT

=head3 disarm patchlevel.h

Expand Down Expand Up @@ -854,13 +866,16 @@ release announcement yet.
If you have a blog, please consider writing an entry in your blog explaining
why you chose that particular quote for your epigraph.

=for checklist skip RC

=head3 Module::CoreList nagging

I<You MUST SKIP this step for RC>

Remind the current maintainer of C<Module::CoreList> to push a new release
to CPAN.

=for checklist skip RC

=head3 new perldelta

Expand Down Expand Up @@ -904,6 +919,7 @@ At this point you may want to compare the commit with a previous bump to
see if they look similar. See commit e3c71926d3 for an example of a
previous version bump.

=for checklist skip BLEAD-POINT MAINT RC

=head3 bump version

Expand Down Expand Up @@ -959,6 +975,7 @@ Finally, push any commits done above.

$ git push origin ....

=for checklist skip BLEAD-POINT MAINT RC

=head3 create maint branch

Expand All @@ -974,6 +991,8 @@ Assuming you're using git 1.7.x or newer:
$ git push origin -u maint-5.12


=for checklist skip BLEAD-POINT MAINT RC

=head3 make the maint branch available in the APC

Clone the new branch into /srv/gitcommon/branches on camel so the APC will
Expand All @@ -985,6 +1004,7 @@ receive its changes.

And nag the sysadmins to make this directory available via rsync.

=for checklist skip BLEAD-POINT RC

=head3 copy perldelta.pod to other branches

Expand Down Expand Up @@ -1087,6 +1107,7 @@ I<This step ONLY for BLEAD-FINAL and MAINT>

Ask Leo Lapworth to update L<http://dev.perl.org/perl5/>.

=for checklist end

=head1 SOURCE

Expand Down

0 comments on commit da571fa

Please sign in to comment.