* [PATCH 6/5] t/v2mirror: check dependencies for legacy test
@ 2021-09-25 3:21 6% ` Eric Wong
0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2021-09-25 3:21 UTC (permalink / raw)
To: meta
We still need Email::MIME to test against old revisions.
We'll also depend on the revision just prior to the
manifest.js.gz introduction to avoid loading Danga::Socket,
since it was getting loaded even with `plackup'.
Finally, we'll disable Inline::C usage with old Spawn.pm
since our old code included alloca.h, which is not
portable to FreeBSD.
---
t/v2mirror.t | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/t/v2mirror.t b/t/v2mirror.t
index a625646d..63d17ebf 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -315,23 +315,26 @@ if ('test read-only epoch dirs') {
}
my $err = '';
-my $v110 = xqx([qw(git rev-parse v1.1.0-pre1)], undef, { 2 => \$err });
+my $oldrev = '0b3e19584c90d958a723ac2d3dec3f84f5513688~1';
+# 3e0e596105198cfa (wwwlisting: allow hiding entries from manifest, 2019-06-09)
+$oldrev = xqx([qw(git rev-parse), $oldrev], undef, { 2 => \$err });
SKIP: {
skip("no detected public-inbox GIT_DIR ($err)", 1) if $?;
+ require_mods('Email::MIME', 1); # for legacy revision
# using plackup to test old PublicInbox::WWW since -httpd from
# back then relied on some packages we no longer depend on
my $plackup = which('plackup') or skip('no plackup in path', 1);
require PublicInbox::Lock;
- chomp $v110;
+ chomp $oldrev;
my ($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!);
- my $wt = "t/data-gen/$base.pre-manifest";
+ my $wt = "t/data-gen/$base.pre-manifest-$oldrev";
my $lk = bless { lock_path => __FILE__ }, 'PublicInbox::Lock';
$lk->lock_acquire;
my $psgi = "$wt/app.psgi";
if (!-f $psgi) { # checkout a pre-manifest.js.gz version
my $t = File::Temp->new(TEMPLATE => 'g-XXXX', TMPDIR => 1);
my $env = { GIT_INDEX_FILE => $t->filename };
- xsys([qw(git read-tree), $v110], $env) and xbail 'read-tree';
+ xsys([qw(git read-tree), $oldrev], $env) and xbail 'read-tree';
xsys([qw(git checkout-index -a), "--prefix=$wt/"], $env)
and xbail 'checkout-index';
my $f = "$wt/app.psgi.tmp.$$";
@@ -353,7 +356,8 @@ EOM
$td->join('TERM');
open $rdr->{2}, '>>', "$tmpdir/plackup.err.log" or xbail "open: $!";
open $rdr->{1}, '>>&', $rdr->{2} or xbail "open: $!";
- $td = start_script($cmd, { PERL5LIB => 'lib' }, $rdr);
+ my $env = { PERL5LIB => 'lib', PERL_INLINE_DIRECTORY => undef };
+ $td = start_script($cmd, $env, $rdr);
# wait for plackup socket()+bind()+listen()
my %opt = ( Proto => 'tcp', Type => Socket::SOCK_STREAM(),
PeerAddr => "$host:$port" );
@@ -363,7 +367,7 @@ EOM
}
my $dst = "$tmpdir/scrape";
@cmd = (qw(-clone -q), "http://$host:$port/v2", $dst);
- run_script(\@cmd, undef, { 2 => \(my $err = '') });
+ run_script(\@cmd, undef, { 2 => \($err = '') });
is($?, 0, 'scraping clone on old PublicInbox::WWW')
or diag $err;
my @g_all = glob("$dst/git/*.git");
^ permalink raw reply related [relevance 6%]
* [PATCH 1/4] wwwlisting: allow hiding entries from manifest
2019-06-09 4:31 5% [PATCH 0/4] grokmirror-compatible manifests Eric Wong (Contractor, The Linux Foundation)
@ 2019-06-09 4:31 7% ` Eric Wong (Contractor, The Linux Foundation)
0 siblings, 0 replies; 3+ results
From: Eric Wong (Contractor, The Linux Foundation) @ 2019-06-09 4:31 UTC (permalink / raw)
To: meta
Since we already have a mechanism for hiding repositories from
the WWW listing, we might as well support another one for hiding
repositories from the upcoming manifest.js.gz generation.
---
lib/PublicInbox/WwwListing.pm | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm
index e1473b3..6d6d301 100644
--- a/lib/PublicInbox/WwwListing.pm
+++ b/lib/PublicInbox/WwwListing.pm
@@ -10,25 +10,27 @@ use PublicInbox::Hval qw(ascii_html);
use PublicInbox::Linkify;
use PublicInbox::View;
-sub list_all ($$) {
- my ($self, undef) = @_;
+sub list_all ($$$) {
+ my ($self, $env, $hide_key) = @_;
my @list;
$self->{pi_config}->each_inbox(sub {
my ($ibx) = @_;
- push @list, $ibx unless $ibx->{-hide}->{www};
+ push @list, $ibx unless $ibx->{-hide}->{$hide_key};
});
\@list;
}
-sub list_match_domain ($$) {
- my ($self, $env) = @_;
+sub list_match_domain ($$$) {
+ my ($self, $env, $hide_key) = @_;
my @list;
my $host = $env->{HTTP_HOST} // $env->{SERVER_NAME};
$host =~ s/:[0-9]+\z//;
my $re = qr!\A(?:https?:)?//\Q$host\E(?::[0-9]+)?/!i;
$self->{pi_config}->each_inbox(sub {
my ($ibx) = @_;
- push @list, $ibx if !$ibx->{-hide}->{www} && $ibx->{url} =~ $re;
+ if (!$ibx->{-hide}->{$hide_key} && $ibx->{url} =~ $re) {
+ push @list, $ibx;
+ }
});
\@list;
}
@@ -78,7 +80,11 @@ sub ibx_entry {
sub call {
my ($self, $env) = @_;
my $h = [ 'Content-Type', 'text/html; charset=UTF-8' ];
- my $list = $self->{list_cb}->($self, $env);
+ my $hide_key = 'www';
+ if ($env->{PATH_INFO} =~ m!/manifest\.js(?:\.gz)\z/!) {
+ $hide_key = 'manifest';
+ }
+ my $list = $self->{list_cb}->($self, $env, $hide_key);
my $code = 404;
my $title = 'public-inbox';
my $out = '';
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] grokmirror-compatible manifests
@ 2019-06-09 4:31 5% Eric Wong (Contractor, The Linux Foundation)
2019-06-09 4:31 7% ` [PATCH 1/4] wwwlisting: allow hiding entries from manifest Eric Wong (Contractor, The Linux Foundation)
0 siblings, 1 reply; 3+ results
From: Eric Wong (Contractor, The Linux Foundation) @ 2019-06-09 4:31 UTC (permalink / raw)
To: meta
Maintaining mirrors is a pain, especially for v2 repos
and multiple epochs. So support both per-domain matching
and per-inbox manifests which can be fed to grok-pull(1)
https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git
Eric Wong (Contractor, The Linux Foundation) (4):
wwwlisting: allow hiding entries from manifest
wwwlisting: generate grokmirror-compatible manifest.js.gz
www: wire up /$INBOX/manifest.js.gz, too
www: support $INBOX/git/$EPOCH.git for v2 cloning
MANIFEST | 1 +
lib/PublicInbox/WWW.pm | 17 +++-
lib/PublicInbox/WwwListing.pm | 174 +++++++++++++++++++++++++++++-----
t/psgi_v2.t | 2 +
t/v2mirror.t | 8 +-
t/www_listing.t | 158 ++++++++++++++++++++++++++++++
6 files changed, 330 insertions(+), 30 deletions(-)
create mode 100644 t/www_listing.t
--
EW
^ permalink raw reply [relevance 5%]
Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-06-09 4:31 5% [PATCH 0/4] grokmirror-compatible manifests Eric Wong (Contractor, The Linux Foundation)
2019-06-09 4:31 7% ` [PATCH 1/4] wwwlisting: allow hiding entries from manifest Eric Wong (Contractor, The Linux Foundation)
2021-09-24 10:56 [PATCH 0/5] clone|fetch: flesh out partial mirror support Eric Wong
2021-09-25 3:21 6% ` [PATCH 6/5] t/v2mirror: check dependencies for legacy test Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).