RE: Simple redirect to correct a URL

2017-01-06 Thread Kari Cowan
Thanks – I will move any followup questions over to the misc list.  That’s a 
great article – just wanted to say.


From: Guillaume Quintard [mailto:guilla...@varnish-software.com]
Sent: Friday, January 06, 2017 12:15 AM
To: Kari Cowan 
Cc: Varnish Development 
Subject: Re: Simple redirect to correct a URL

Not to beat my own drum, but I blogged about this recently: 
https://info.varnish-software.com/blog/rewriting-urls-with-varnish-redirection

TL;DR: you need a 30X return code, and to put the new URL in the correct header 
(location).

On Jan 6, 2017 02:06, "Kari Cowan" > 
wrote:
I’m sure I must be doing something hair-brained … shouldn’t this work in V5?

if (req.url~ "^/type/news?$") {
   return (synth (750,"http://; + req.http.Host + "/news/"));
}

___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Re: Varnish code coverage results online

2017-01-06 Thread Poul-Henning Kamp

In message 

Re: Varnish code coverage results online

2017-01-06 Thread Dridi Boukelmoune
On Fri, Jan 6, 2017 at 12:36 PM, Poul-Henning Kamp  wrote:
> 
> In message 
> 

Re: Varnish code coverage results online

2017-01-06 Thread Dridi Boukelmoune
On Fri, Jan 6, 2017 at 12:05 PM, Poul-Henning Kamp  wrote:
> 
> In message 
> , Dridi 
> Boukelmoune
> writes:
>
>>> I have also, at the same time raised the official project goal to
>>> "90%+ of *all* executable code tested automatically".
>>
>>Only line coverage? Nothing for branches?
>>
>>90% branch coverage is even a bigger challenge ;)
>
> That's probably impossible, given the number of asserts we have.

Yes, my approach is to run the test suite with assertions, and disable
them for coverage.

>>Another thing: if we want proper code coverage reports, [...]
>
> Are my my l33t HTML skills not proper ?!
>
> Seriously:  This is good enough to tell us which bits of our
> code isn't covered by "make check", which is the important part.
>
> Merging in data from other runs would not be a problem, my scripts
> already has support for merging because some sourcefiles drop .gcda

Cool, I had no idea!

> in multiple directories already.  We'd just need to set up a client
> to run "make check" and submit a condensed version of the raw data.

And here comes tools/vcov.sh :p

> If you feel like running a Linux (or other) client, let me know and
> we can get it set up, I think my current plan is to run this only
> once per night.

If we come up with something, Travis CI could do that for us for each
push (so some work needs to be done to match the nightly scheduling).
We'd just need to set up a new job, and I think it would even run as
root and skip less tests.

Dridi

___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


Re: Varnish code coverage results online

2017-01-06 Thread Poul-Henning Kamp

In message 
, Dridi 
Boukelmoune 
writes:

>> I have also, at the same time raised the official project goal to
>> "90%+ of *all* executable code tested automatically".
>
>Only line coverage? Nothing for branches?
>
>90% branch coverage is even a bigger challenge ;)

That's probably impossible, given the number of asserts we have.

>Another thing: if we want proper code coverage reports, [...]

Are my my l33t HTML skills not proper ?!

Seriously:  This is good enough to tell us which bits of our
code isn't covered by "make check", which is the important part.

Merging in data from other runs would not be a problem, my scripts
already has support for merging because some sourcefiles drop .gcda
in multiple directories already.  We'd just need to set up a client
to run "make check" and submit a condensed version of the raw data.

If you feel like running a Linux (or other) client, let me know and
we can get it set up, I think my current plan is to run this only
once per night.

Poul-Henning

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


Re: Simple redirect to correct a URL

2017-01-06 Thread Guillaume Quintard
And I just noticed, please use varnish-misc for this kind of requests,
varnish-dev is for dev topics only.

On Jan 6, 2017 09:14, "Guillaume Quintard" 
wrote:

> Not to beat my own drum, but I blogged about this recently: https://info.
> varnish-software.com/blog/rewriting-urls-with-varnish-redirection
>
> TL;DR: you need a 30X return code, and to put the new URL in the correct
> header (location).
>
> On Jan 6, 2017 02:06, "Kari Cowan"  wrote:
>
>> I’m sure I must be doing something hair-brained … shouldn’t this work in
>> V5?
>>
>>
>>
>> if (req.url~ "^/type/news?$") {
>>
>>return (synth (750,"http://; + req.http.Host + "/news/"));
>>
>> }
>>
>> ___
>> varnish-dev mailing list
>> varnish-dev@varnish-cache.org
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>>
>
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Re: Simple redirect to correct a URL

2017-01-06 Thread Guillaume Quintard
Not to beat my own drum, but I blogged about this recently:
https://info.varnish-software.com/blog/rewriting-urls-with-varnish-redirection

TL;DR: you need a 30X return code, and to put the new URL in the correct
header (location).

On Jan 6, 2017 02:06, "Kari Cowan"  wrote:

> I’m sure I must be doing something hair-brained … shouldn’t this work in
> V5?
>
>
>
> if (req.url~ "^/type/news?$") {
>
>return (synth (750,"http://; + req.http.Host + "/news/"));
>
> }
>
> ___
> varnish-dev mailing list
> varnish-dev@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev