All of lore.kernel.org
 help / color / mirror / Atom feed
* [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph
@ 2015-10-23 16:31 Ian Jackson
  2015-10-23 16:31 ` [OSSTEST PATCH 1/3] cs-bisection-step: Generate an SVG graph too Ian Jackson
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Ian Jackson @ 2015-10-23 16:31 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell

These three patches contrive to produce (in a rather ugly way) an SVG
version of the revision graph in which the revisions and (most
usefully) the flights are hyperlinks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [OSSTEST PATCH 1/3] cs-bisection-step: Generate an SVG graph too
  2015-10-23 16:31 [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
@ 2015-10-23 16:31 ` Ian Jackson
  2015-10-23 16:31 ` [OSSTEST PATCH 2/3] cs-bisection-step: Make hyperlinks in SVG revision graph Ian Jackson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Ian Jackson @ 2015-10-23 16:31 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

This is going to let us provide a version with hyperlinks.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 cs-bisection-step |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cs-bisection-step b/cs-bisection-step
index 7a97b10..bd5a27e 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -1026,7 +1026,7 @@ END
         or die "$!";
 
     if (eval {
-        foreach my $fmt (qw(ps png)) {
+        foreach my $fmt (qw(ps png svg)) {
             system_checked("dot", "-T$fmt", "-o$graphfile.$fmt",
 			   "$graphfile.dot");
         }
@@ -1045,11 +1045,12 @@ END
 <h2>Revision graph overview</h2>
 <img src="$href.mini.png">
 <h2>Revision graph</h2>
+<a href="$href.svg">SVG</h2><br>
 <a href="$href.ps">PostScript</a><p>
 <img src="$href.png">
 </body></html>
 END
-        print STDERR "Revision graph left in $graphfile.{dot,ps,png,html}.\n";
+        print STDERR "Revision graph left in $graphfile.{dot,ps,png,html,svg}.\n";
     } else {
         my $emsg= encode_entities($@);
         print HTML <<END or die $!;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [OSSTEST PATCH 2/3] cs-bisection-step: Make hyperlinks in SVG revision graph
  2015-10-23 16:31 [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
  2015-10-23 16:31 ` [OSSTEST PATCH 1/3] cs-bisection-step: Generate an SVG graph too Ian Jackson
@ 2015-10-23 16:31 ` Ian Jackson
  2015-10-23 16:31 ` [OSSTEST PATCH 3/3] cs-bisection-step: Mark which revision(s) changed in each node Ian Jackson
  2015-10-23 16:35 ` [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
  3 siblings, 0 replies; 10+ messages in thread
From: Ian Jackson @ 2015-10-23 16:31 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

Make various elements in the output into hyperlinks and hence document
that the SVG version of the graph is best to use.

AFAICT dot does not provide a way to put literal SVG elements into its
output.  So we postprocess it.  Luckily we produced the input to dot
so we know a lot about what the output will look like.

In theory it would be better to feed the SVG into an XML parser and do
this editing at the ESIS level, via XSLT.  However, I don't understand
XSLT, and this regexp-based version will work until the authors of dot
decide to change the output syntax.  If they do, the hyperlinking will
go away, but everything else will still work.  I think this approach
will be less effort overall.  This is particularly true as even using
XSLT would involve us knowing how dot's output is structured, and
changes to the syntax of the dot output are not very likely unless the
dot authors also change the semantics.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 README.bisection  |    5 +++++
 cs-bisection-step |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/README.bisection b/README.bisection
index ca3405c..8ea3d3e 100644
--- a/README.bisection
+++ b/README.bisection
@@ -137,6 +137,11 @@ Revision Graph
 The revision graph page shows the osstest bisector's view of the
 situation.
 
+The SVG version of the graph is best if your browser supports it.  In
+that graph the individual revisions and flight result notations are
+hyperlinks (even though they may not be marked as such in your
+browser).
+
 Each node in the graph corresponds to a tuple of revisions: one
 revision for each of the relevant trees.  Each edge changes the
 revision of one of the trees.  (osstest has constructed this graph by
diff --git a/cs-bisection-step b/cs-bisection-step
index bd5a27e..841a46a 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -1030,6 +1030,42 @@ END
             system_checked("dot", "-T$fmt", "-o$graphfile.$fmt",
 			   "$graphfile.dot");
         }
+	open SVGI, "$graphfile.svg" or die "$graphfile.svg $!";
+	open SVGO, ">", "$graphfile.svg.new" or die "$graphfile.svg.new $!";
+	while (<SVGI>) {
+	    if (m/^\<text/) {
+		if (m/(?<=\>)[0-9a-f]{12}(?:,[0-9a-f]{12})*(?=\<)/) {
+		    my ($l,$r) = ($`,$'); #');
+		    my @commits = split /\,/, $&;
+		    my @ocommits;
+		    for (my $i=0; $i<@commits; $i++) {
+			my $url = "$treeinfos[$i]{Url}#$commits[$i]";
+			push @ocommits, "<a xlink:href=\"".
+			    encode_entities($url).
+			    "\">".
+			    $commits[$i].
+			    "</a>";
+		    }
+		    $_ = $l.(join ",", @ocommits).$r;
+		} elsif (m/(?<=\>)\d+:[-a-z]+(?: \d+:[-a-z]+)*(?=\<)/) {
+		    my ($l,$r) = ($`,$'); #');
+		    my @flights = split / /, $&;
+		    foreach my $f (@flights) {
+			$f =~ m/^\d+(?=:)/;
+			$f = "<a xlink:href=\"".
+			    encode_entities("$c{ReportHtmlPubBaseUrl}/$&").
+			    "\">".
+			    $f."</a>";
+		    }
+		    $_ = $l.(join " ", @flights).$r;
+		}
+	    }
+	    print SVGO or die $!;
+	}
+	close SVGO or die $!;
+	rename "$graphfile.svg.new", "$graphfile.svg"
+	    or die "$graphfile.svg $!";
+
         1;
     }) {
 	my $gsize = $c{BisectionRevisonGraphSize};
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [OSSTEST PATCH 3/3] cs-bisection-step: Mark which revision(s) changed in each node
  2015-10-23 16:31 [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
  2015-10-23 16:31 ` [OSSTEST PATCH 1/3] cs-bisection-step: Generate an SVG graph too Ian Jackson
  2015-10-23 16:31 ` [OSSTEST PATCH 2/3] cs-bisection-step: Make hyperlinks in SVG revision graph Ian Jackson
@ 2015-10-23 16:31 ` Ian Jackson
  2015-10-23 16:35 ` [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
  3 siblings, 0 replies; 10+ messages in thread
From: Ian Jackson @ 2015-10-23 16:31 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

We compare the revision rtuple elements with each of the parents, and
mark changes by surrounding the revision id with *asterisks*.

In the SVG output, we have to strip these when generating the URL, and
we can show this by emboldening the relevant revision instead.  This
involves changing the ther output to be of normal weight by deleting
the emboldening output by dot.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 README.bisection  |    3 +++
 cs-bisection-step |   27 +++++++++++++++++++++------
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/README.bisection b/README.bisection
index 8ea3d3e..ae8a1aa 100644
--- a/README.bisection
+++ b/README.bisection
@@ -159,6 +159,9 @@ revision) or blue (if the attempt with that particular revision tuple
 was inconclusive because the test step being bisected was blocked by
 an earlier failure).
 
+The revision(s) which changed compared to the parent(s) are marked
+with asterisks, or in bold.
+
 The revision being fingered (or, when the bisector is running, the
 next revision to test) is highlighed with a double boundary.
 
diff --git a/cs-bisection-step b/cs-bisection-step
index 841a46a..e51babd 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -928,9 +928,18 @@ END
 sub gnodename ($) {
     my ($n) = @_;
 
-    my $lab= $n->{Rtuple};
-    $lab =~ s/(\S{12})\S+/$1/g;
-    $lab =~ s/ /,/g;
+    my @lab = split / /, $n->{Rtuple};
+    foreach (my $i=0; $i<@lab; $i++) {
+	my $lab = $lab[$i];
+	$lab = substr $lab, 0, 12;
+	$lab = "*$lab*"
+	    if grep {
+		my @ptuple = split / /, $_->{Rtuple};
+		$ptuple[$i] ne $lab[$i];
+	    } @{ $n->{Parents} };
+	$lab[$i] = $lab;
+    }
+    my $lab = join ",", @lab;
 
     my $fs= $n->{Flights};
     if ($fs) {
@@ -1034,18 +1043,24 @@ END
 	open SVGO, ">", "$graphfile.svg.new" or die "$graphfile.svg.new $!";
 	while (<SVGI>) {
 	    if (m/^\<text/) {
-		if (m/(?<=\>)[0-9a-f]{12}(?:,[0-9a-f]{12})*(?=\<)/) {
+		if (m/(?<=\>)\*?[0-9a-f]{12}\*?(?:,\*?[0-9a-f]{12}\*?)*(?=\<)/) {
 		    my ($l,$r) = ($`,$'); #');
 		    my @commits = split /\,/, $&;
 		    my @ocommits;
 		    for (my $i=0; $i<@commits; $i++) {
-			my $url = "$treeinfos[$i]{Url}#$commits[$i]";
+			my $commit = $commits[$i];
+			$commit =~ s#\*##g;
+			my $url = "$treeinfos[$i]{Url}#$commit";
+			my $show = $commits[$i];
+			$show =~ s#^\*#<tspan font-weight="bolder">#;
+			$show =~ s#\*$#</tspan>#;
 			push @ocommits, "<a xlink:href=\"".
 			    encode_entities($url).
 			    "\">".
-			    $commits[$i].
+			    $show.
 			    "</a>";
 		    }
+		    $l =~ s# font-weight="bold" # #;
 		    $_ = $l.(join ",", @ocommits).$r;
 		} elsif (m/(?<=\>)\d+:[-a-z]+(?: \d+:[-a-z]+)*(?=\<)/) {
 		    my ($l,$r) = ($`,$'); #');
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph
  2015-10-23 16:31 [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
                   ` (2 preceding siblings ...)
  2015-10-23 16:31 ` [OSSTEST PATCH 3/3] cs-bisection-step: Mark which revision(s) changed in each node Ian Jackson
@ 2015-10-23 16:35 ` Ian Jackson
  2015-10-23 16:41   ` Andrew Cooper
  3 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2015-10-23 16:35 UTC (permalink / raw)
  To: xen-devel, Ian Campbell

Ian Jackson writes ("[OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph"):
> These three patches contrive to produce (in a rather ugly way) an SVG
> version of the revision graph in which the revisions and (most
> usefully) the flights are hyperlinks.

Example of the output:

http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.html
http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.svg

Ian.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph
  2015-10-23 16:35 ` [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
@ 2015-10-23 16:41   ` Andrew Cooper
  2015-10-23 16:46     ` Ian Jackson
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2015-10-23 16:41 UTC (permalink / raw)
  To: Ian Jackson, xen-devel, Ian Campbell

On 23/10/15 17:35, Ian Jackson wrote:
> Ian Jackson writes ("[OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph"):
>> These three patches contrive to produce (in a rather ugly way) an SVG
>> version of the revision graph in which the revisions and (most
>> usefully) the flights are hyperlinks.
> Example of the output:
>
> http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.html
> http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.svg

I get "The address wasn't understood" from my browser.

It appears that it is using the git:// URLs

e.g. git://xenbits.xen.org/linux-pvops.git#1230ae0e99e0

Shouldn't the HTTP links be used?

~Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph
  2015-10-23 16:41   ` Andrew Cooper
@ 2015-10-23 16:46     ` Ian Jackson
  2015-10-23 16:49       ` Andrew Cooper
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2015-10-23 16:46 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Ian Campbell

Andrew Cooper writes ("Re: [Xen-devel] [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph"):
> On 23/10/15 17:35, Ian Jackson wrote:
> > Example of the output:
> >
> > http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.html
> > http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.svg
> 
> I get "The address wasn't understood" from my browser.
> 
> It appears that it is using the git:// URLs
> e.g. git://xenbits.xen.org/linux-pvops.git#1230ae0e99e0

Yes, indeed.  It appears that your browser is rather poor :-).  (Most
are...)

> Shouldn't the HTTP links be used?

They aren't available.

The information here comes from the flights database, which contains
the URLs used to clone the code, but not any corresponding links
suitable for use in a browser.[1]

In fact, osstest doesn't handle or know of such browseable links for
any of the trees it deals with.  In the general case such browseable
links may not even exist.

[1] It is true that in some cases, for some trees, there are links
that can be used for both; but we prefer to have osstest use git://
urls because they cache well, with our git caching proxy.

Ian.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph
  2015-10-23 16:46     ` Ian Jackson
@ 2015-10-23 16:49       ` Andrew Cooper
  2015-10-23 16:55         ` Ian Jackson
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2015-10-23 16:49 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Ian Campbell

On 23/10/15 17:46, Ian Jackson wrote:
> Andrew Cooper writes ("Re: [Xen-devel] [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph"):
>> On 23/10/15 17:35, Ian Jackson wrote:
>>> Example of the output:
>>>
>>> http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.html
>>> http://xenbits.xen.org/people/iwj/2015/bisection-svg/t.svg
>> I get "The address wasn't understood" from my browser.
>>
>> It appears that it is using the git:// URLs
>> e.g. git://xenbits.xen.org/linux-pvops.git#1230ae0e99e0
> Yes, indeed.  It appears that your browser is rather poor :-).  (Most
> are...)

How is yours configured then, to do something sensible with a git:// uri ?

~Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph
  2015-10-23 16:49       ` Andrew Cooper
@ 2015-10-23 16:55         ` Ian Jackson
  2015-11-02 10:41           ` Ian Campbell
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2015-10-23 16:55 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Ian Campbell

Andrew Cooper writes ("Re: [Xen-devel] [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph"):
> On 23/10/15 17:46, Ian Jackson wrote:
> > Yes, indeed.  It appears that your browser is rather poor :-).  (Most
> > are...)
> 
> How is yours configured then, to do something sensible with a git:// uri ?

I did say most browsers were poor :-).

ISTM that this information is better than nothing.

Ian.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph
  2015-10-23 16:55         ` Ian Jackson
@ 2015-11-02 10:41           ` Ian Campbell
  0 siblings, 0 replies; 10+ messages in thread
From: Ian Campbell @ 2015-11-02 10:41 UTC (permalink / raw)
  To: Ian Jackson, Andrew Cooper; +Cc: xen-devel

On Fri, 2015-10-23 at 17:55 +0100, Ian Jackson wrote:
> Andrew Cooper writes ("Re: [Xen-devel] [OSSTEST PATCH 0/3] cs-bisection
> -step: Linky linky revision graph"):
> > On 23/10/15 17:46, Ian Jackson wrote:
> > > Yes, indeed.  It appears that your browser is rather poor :-).  (Most
> > > are...)
> > 
> > How is yours configured then, to do something sensible with a git://
> > uri ?
> 
> I did say most browsers were poor :-).
> 
> ISTM that this information is better than nothing.

For reasons best known to itself my version of firefox doesn't offer me the
"copy link location" option when right clicking these :-(

Otherwise I would suggest that the correct format would be "<URL>
<REVISION>" such that after copying the URL "git fetch <PASTE>" just does
the right thing(tm).

But the fact I can now highlight and copy the rev from the graph is very
valuable IMHO.

I'd be minded to suggest that the default HTML ought to include the SVG by
default.

Ian.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-02 10:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23 16:31 [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
2015-10-23 16:31 ` [OSSTEST PATCH 1/3] cs-bisection-step: Generate an SVG graph too Ian Jackson
2015-10-23 16:31 ` [OSSTEST PATCH 2/3] cs-bisection-step: Make hyperlinks in SVG revision graph Ian Jackson
2015-10-23 16:31 ` [OSSTEST PATCH 3/3] cs-bisection-step: Mark which revision(s) changed in each node Ian Jackson
2015-10-23 16:35 ` [OSSTEST PATCH 0/3] cs-bisection-step: Linky linky revision graph Ian Jackson
2015-10-23 16:41   ` Andrew Cooper
2015-10-23 16:46     ` Ian Jackson
2015-10-23 16:49       ` Andrew Cooper
2015-10-23 16:55         ` Ian Jackson
2015-11-02 10:41           ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.