Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#709411: PTS: add a codesearch.d.n input field

0 views
Skip to first unread message

Paul Wise

unread,
May 23, 2013, 1:30:02 AM5/23/13
to
Package: qa.debian.org
Severity: wishlist
User: qa.deb...@packages.debian.org
Usertags: pts

It would be interesting to have an input field on PTS pages that points
people at the Debian Code Search website for the package:

http://codesearch.debian.net/search?q=package:foo+bar

--
bye,
pabs

http://wiki.debian.org/PaulWise
signature.asc

Paul Wise

unread,
May 23, 2013, 1:50:01 AM5/23/13
to
On Thu, 2013-05-23 at 13:25 +0800, Paul Wise wrote:

> It would be interesting to have an input field on PTS pages that points
> people at the Debian Code Search website for the package:
>
> http://codesearch.debian.net/search?q=package:foo+bar

Unfortunately I realised that this isn't easy because there is only one
query parameter for the search URL and I think having package:foo in the
search box on the PTS would use too much space. Michael, would it be
possible for us to have a hidden field containing the package name that
would be passed as a separate parameter but get merged into the query on
the DCS site? Something like this should result in "package:foo bar"
being the search query and being present in the DCS search box.

http://codesearch.debian.net/search?package=foo&q=bar

Michael, which PTS pages should the search box be on? Are all source
packages in Debian indexed? All source packages in unstable? How long
does it usually take to index a new or updated source package?
signature.asc

Michael Stapelberg

unread,
May 25, 2013, 3:10:02 PM5/25/13
to
Hi Paul,

Paul Wise <pa...@debian.org> writes:
> Unfortunately I realised that this isn't easy because there is only one
> query parameter for the search URL and I think having package:foo in the
> search box on the PTS would use too much space. Michael, would it be
> possible for us to have a hidden field containing the package name that
> would be passed as a separate parameter but get merged into the query on
> the DCS site? Something like this should result in "package:foo bar"
> being the search query and being present in the DCS search box.
I thought about this a little bit and the preferred way to implement
this is to have a redirect which would then just prepend (or append,
doesn’t matter) package:foo to the search term. That way, there is only
one interface to DCS to document/take care of.

Furthermore, it would be good to make this redirect automatic using a
tiny bit of JavaScript, i.e. having something like:
<form>
<input type="hidden" name="package" value="foo">
<input type="text" name="q" placeholder="search term">
<input type="submit">
</form>

…and having a bit of JavaScript code which would delete the package
field before submitting and adding package:foo to the q input field.

This saves a redirect which is moderately costly on good internet
connections but hugely painful on mobile connections. Also, it decreases
load on the server which performs the actual redirect.

As for which server to use, I’d vote for the PTS code handling the
redirect, since the PTS is the one who needs the feature :). If for some
reason this is super-complicated within the PTS, I am not dead set on
this, but I would like to hear a decent reason if I should implement
that code within DCS.

> Michael, which PTS pages should the search box be on? Are all source
> packages in Debian indexed? All source packages in unstable? How long
> does it usually take to index a new or updated source package?
See http://codesearch.debian.net/faq — all sid source packages are
indexed. Due to quite a bit of CPU time required for this, the index is
only updated once a week, typically on friday. This currently is a
manual process, but I intend to automate it real soon.

--
Best regards,
Michael


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Paul Wise

unread,
May 25, 2013, 9:40:01 PM5/25/13
to
On Sat, 2013-05-25 at 21:08 +0200, Michael Stapelberg wrote:

> I thought about this a little bit and the preferred way to implement
> this is to have a redirect which would then just prepend (or append,
> doesn’t matter) package:foo to the search term. That way, there is only
> one interface to DCS to document/take care of.

I hadn't though about a redirect, thanks for the idea.

> Furthermore, it would be good to make this redirect automatic using a
> tiny bit of JavaScript, i.e. having something like:
...
> …and having a bit of JavaScript code which would delete the package
> field before submitting and adding package:foo to the q input field.
>
> This saves a redirect which is moderately costly on good internet
> connections but hugely painful on mobile connections. Also, it decreases
> load on the server which performs the actual redirect.

That is a good idea, though the redirect will still be needed for non-JS
clients and for folks who turn off JS in their browser.

> As for which server to use, I’d vote for the PTS code handling the
> redirect, since the PTS is the one who needs the feature :). If for some
> reason this is super-complicated within the PTS, I am not dead set on
> this, but I would like to hear a decent reason if I should implement
> that code within DCS.

I'll implement that on the PTS side, there are already some CGIs there.

> See http://codesearch.debian.net/faq — all sid source packages are
> indexed. Due to quite a bit of CPU time required for this, the index is
> only updated once a week, typically on friday. This currently is a
> manual process, but I intend to automate it real soon.

Ok, so I will only put the search box on packages that are in sid.
Please let us know if this expands to other suites.

What do you think of the idea in general?

Will you be able to handle the (possibly) increased search traffic?

Any other thoughts?
signature.asc

Debian Bug Tracking System

unread,
May 26, 2013, 2:40:02 AM5/26/13
to
Your message dated Sun, 26 May 2013 14:29:33 +0800
with message-id <CAKTje6F1ADng2iTJdtdRQzfFQD4-KQ77yA6J=UxbKfX...@mail.gmail.com>
and subject line Re: Bug#709411: Debian Code Search: PTS integration
has caused the Debian Bug report #709411,
regarding PTS: add a codesearch.d.n input field
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


--
709411: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=709411
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
signature.asc

Michael Stapelberg

unread,
May 26, 2013, 4:00:08 AM5/26/13
to
Hi Paul,

Paul Wise <pa...@debian.org> writes:
> What do you think of the idea in general?
I am uncertain how useful it is. Presumably it will at least make people
more aware of DCS, which should be a good thing :-).

> Will you be able to handle the (possibly) increased search traffic?
I suppose so. After the initial spike during the announcement, traffic
is pretty low. In case it gets too high and we cannot handle it with our
infrastructure, we can always remove that box.

Debian Bug Tracking System

unread,
May 26, 2013, 4:40:03 PM5/26/13
to
Your message dated Sun, 26 May 2013 04:12:59 +0000
with message-id <E1UgSKJ-...@vasks.debian.org>
and subject line qa.debian.org bug fixed in revision 3000
signature.asc
0 new messages