changing service roots to symbols will break clients

Bug #719144 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
launchpadlib
Invalid
Critical
Unassigned

Bug Description

In the discussion of bug 714043, leonardr says

> In 1.9.5, which is about to go into Ubuntu, the symbol for LPNET_SERVICE_ROOT is the string 'production'.

If that's true, I think it would be an unfortunate client API break, and as far as I can see an unnecessary one. I'm happy about adding a token-type name for 'production' rather than a URL, and also about adding a variable that points to the string. But please add a new one rather than changing the meaning of an existing interface.

However in the tip of lp:launchpadlib, which claims to be 1.9.6, this change hasn't actually been made as far as I can see.

I'm marking this critical because it would be better not to release natty with this broken.

Revision history for this message
Martin Pool (mbp) wrote :

OK, so I think Leonard was just saying in bug 714043 that he could hypothetically change this, not that he actually has or will. If that's true, this is invalid.

Changed in launchpadlib:
status: Triaged → Invalid
Revision history for this message
Leonard Richardson (leonardr) wrote :

Not so fast. In 1.9.6, with the branch https://code.launchpad.net/~leonardr/launchpadlib/fake-edge, I changed launchpadlib.EDGE_SERVICE_ROOT from "https://api.edge.launchpad.net/" to "edge". I did this because it was the easiest way to detect people using EDGE_SERVICE_ROOT and issue a deprecation warning.

If this is catastrophic, I'll change it back, but I'll have to replace it with a complex object that gives the appearance of a string but gives a deprecation warning when it's used. Otherwise I'll never be able to get rid of EDGE_SERVICE_ROOT because no one will ever know it's deprecated. (It's already been deprecated for more than a year.)

Revision history for this message
Leonard Richardson (leonardr) wrote :

Just to be clear, I am talking throughout about launchpadlib.EDGE_SERVICE_ROOT, which was deprecated over a year ago in favor of launchpad.uris.EDGE_SERVICE_ROOT. But it was deprecated in a code comment, so no one noticed.

Revision history for this message
Leonard Richardson (leonardr) wrote :

Argh. I can't talk correctly about this.

launchpadlib.launchpad.EDGE_SERVICE_ROOT was deprecated in favor of the literal string "edge", over a year ago.

However, if you need a URL, you can get it from launchpadlib.uris.EDGE_SERVICE_ROOT.

However, you shouldn't be using launchpadlib.launchpad.EDGE_SERVICE_ROOT, *or* launchpadlib.uris.EDGE_SERVICE_ROOT, *or* the literal string "edge". Because the edge server *itself* is deprecated and one day it will stop working (as it stopped working yesterday, but permanently).

In the meantime, I am doing what I can to make launchpadlib.launchpad.EDGE_SERVICE_ROOT, launchpadlib.uris.EDGE_SERVICE_ROOT, and the literal string "edge" actually refer to the production server.

Revision history for this message
Leonard Richardson (leonardr) wrote :

I had a better idea but it was easier to JFDI than explain it:

https://code.launchpad.net/~leonardr/launchpadlib/silently-replace-edge-with-production/+merge/49794

I don't think this will actually save anyone's code if they do URL manipulation on EDGE_SERVICE_ROOT, but there's a chance it'll work.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 719144] Re: changing service roots to symbols will break clients

That looks good to me.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.