Merge lp:~jml/launchpad/what-is-in-the-web-ui into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: no longer in the source branch.
Merged at revision: 12574
Proposed branch: lp:~jml/launchpad/what-is-in-the-web-ui
Merge into: lp:launchpad
Diff against target: 0 lines
To merge this branch: bzr merge lp:~jml/launchpad/what-is-in-the-web-ui
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+52594@code.launchpad.net

Commit message

Add a list-pages script that lists all the pages in Launchpad

Description of the change

I'd like to figure exactly what is in the web UI. We need to clean it up a fair bit, but there's so much there it's hard to tell where to start or what needs to be done.

One approach is to get a list of what "pages" we have, pages like the one you are looking at now. These pages can then be tied, perhaps, to features in the feature checklist or things in the strategy & scope document.

This script is my first attempt at an automated way of gathering that data.

Problem is, I don't really know anything about Zope, and I'm not really sure how pageids work, and well, I don't really know what I'm doing.

Pages like:
  https://code.launchpad.net/ubuntu/+source/openssh
are interesting,

Pages like:
  https://code.launchpad.net/ubuntu/+source/openssh/+count-summary
are not.

I guess I probably want to know what facets (remind me what they are again?) / subdomains a page is valid for.

Anyway, I'd appreciate any help in making this script useful / better / more correct. The XXX comments are a good starting place.

Thanks!
jml

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

canonical url is a launchpad-ism that has seemed very custom in its implementation when I've looked at in the past. I'd be swimming through code here like you.

For the view walk about, you could perhaps limit what you are looking through by only looking for things that adapt (anything, IRequest) but that's just an optimization, not an improvement of the sort you are looking for. If you are interested, let me know and I'll dig it up.

If we register our views and our portlet views identically, as I suspect we do, then there's not much we can distinguish on. We would need to change our registrations systematically to be able to do something like this.

Revision history for this message
Jonathan Lange (jml) wrote :

I've tweaked it to look at page titles, added some docs, and probably done a bunch of other things. It's ready for review.

Here's the (sorted) output: http://paste.ubuntu.com/578252/

(Also, I really wish Canonical had a standard, good, command-line UI abstraction)

Revision history for this message
Jonathan Lange (jml) wrote :

More tweaks:
 * now includes a URL
 * more documentation

./utilities/list-pages will it. Output is in CSV because that can be put in a spreadsheet & sorted. Willing to take suggestions for more human output formats.

Revision history for this message
Gavin Panella (allenap) wrote :

In a freshly built branch I get:

    ZopeXMLConfigurationError: File
        ".../zcml/override-configure.zcml", line 10.4-10.45
    IOError: [Errno 2] No such file or directory:
        '.../zcml/+config-overrides.zcml'

`make run` gets past that, but now I get a ConfigurationConflictError
about zcml/override-includes/salesforce-configure-testing.zcml about
the registration of TestSalesforceVoucherProxy as a secured utility.

Ah ha, changing load_zcml() to default to zopeless=True gets some
interesting output.

I wonder how the OOPS reports get page IDs?

Do you want to land this, or is this something you want to build on?
Personally I think it's okay to land, if it can be made to work out of
the box, but I'm wary of it being anything more than a "curiousity"
for now, mainly because it's not tested. It's interesting code though.

review: Approve
Revision history for this message
Jonathan Lange (jml) wrote :

Yeah, I'm planning on landing this. We really need a way of figuring out what exactly is in Launchpad so we can plan changes to the UI.

It's a developer script, so for me at least the testing requirements are lower. It's also hacky by nature – Zope really doesn't make this easy.

I had a crappy local workaround for the config-overrides/zcml problem. Fixed in the latest push.

The OOPS reports get page IDs the way I get them, except they have real objects to play with. All I have in this script are interfaces, so if I want to get page IDs, I have to do it in this hacky way.

Revision history for this message
Gavin Panella (allenap) wrote :

The canonical_url() stuff is very cool!

[1]

+ if template:
+ template = template[len(ROOT)+1:]

In my never-ending quest for the trivial, I can point out that Python
2.6 (maybe earlier) has a convenience function to do this:

    if template:
        template = relpath(template, ROOT)

[2]

+ def __str__(self):
+ return '<%s>' % (self.__dict__['_name'],)

Just self._name should be fine with __getattr__().

Revision history for this message
Jonathan Lange (jml) wrote :

On Thu, Mar 10, 2011 at 2:56 PM, Gavin Panella
<email address hidden> wrote:
> The canonical_url() stuff is very cool!
>

That would be one way of putting it. Very evil would be another.

>
> [1]
>
> +    if template:
> +        template = template[len(ROOT)+1:]
>
> In my never-ending quest for the trivial, I can point out that Python
> 2.6 (maybe earlier) has a convenience function to do this:
>
>    if template:
>        template = relpath(template, ROOT)
>

Ahh yes. It's 2.6 and later. Thanks for the pointer.

>
> [2]
>
> +    def __str__(self):
> +        return '<%s>' % (self.__dict__['_name'],)
>
> Just self._name should be fine with __getattr__().
>

Oops. Fixed. Thanks.

jml

Preview Diff

Empty