/srv/irclogs.ubuntu.com/2017/07/24/#launchpad-dev.txt

sil2100Morning! Another LP API question - I would like to easily get a count of overall people with main_archive upload rights, possibly counting core-devs, MOTUs and per-package uploaders08:04
sil2100Wanted to use the main_archive.getAllPermissions() for that possibly, but even though I get a set of archive permissions (over 700) those are not accessible for me08:05
sil2100I can't read their contents08:05
sil2100What would be the best and easiest way to achieve that?08:05
wgrantsil2100: What do you mean when you say they are inaccessible?08:14
sil2100wgrant: strange thing, I get a collection, can check its length but if I try to access its individual archive_permission objects it says it's out of bounds, e.g. main_archive.getAllPermissions()[0]08:15
wgrantsil2100: Ah, what if you log in?08:15
sil2100wgrant: is this not available anonymously? Since that would be my requirement08:16
wgrantsil2100: It's very easy to accidentally export something that's available to all authenticated users but not anonymous ones.08:16
wgrantIt's also easy to fix.08:16
sil2100hm, since otherwise it'll be quite hard for me to get the number of all uploaders to Ubuntu, hmm08:17
wgrantSure08:18
wgrantI'm just saying you should do that now to a) verify that it's the problem and b) have a workaround until we can fix it in LP.08:18
sil2100wgrant: confirmed, when logged in it works08:21
wgrantsil2100: Great. Can you file a bug?08:21
sil2100Sure thing08:21
sil2100https://bugs.launchpad.net/launchpadlib/+bug/170599608:26
mupBug #1705996: Unable to access archive_permission for archive when not logged in <launchpadlib :New> <https://launchpad.net/bugs/1705996>08:26
sil2100Thanks!08:26
sil2100wgrant: while thinking about it, can I actually get a real number of *actual* users that have upload rights to an archive?08:32
wgrantsil2100: You'd need to expand all the team participants and exclude robots and such.08:34
sil2100wgrant: thanks08:50
sil2100wgrant: one (hopefully) last question: is there a way I could check a given user's team memberships? I don't see that straight away from the docs - I'd be mostly interested in the data of 'if this user part of canonical', since the ~canonical team seems to be private08:51
sil2100And I can't access it when not logged in08:51
wgrantsil2100: It's deliberately not possible to determine someone's Canonical employment status anonymously.08:55
blahdeblahAnd membership in that team doesn't guarantee Canonical employment, either.08:56
blahdeblah(Most of those are corner cases that usually aren't relevant, though.)08:57
sil2100oh!08:58
sil2100Indeed, I didn't know that when I'm not logged in I can't see my canonical membership08:59
sil2100Ok, today is a day where things that seemed easy just get a bit more complicated ;)08:59
sil2100I'll just have to do some fancy guess-work09:03
skayhey, I was wondering what needs to happen for lp:948857. I don't know how to do that, so I made a junk repo to experiment on. https://code.launchpad.net/~codersquid/+junk/oops-datedir-no-pruning14:41
skayI've not used zope.interface, but when working in Java I've used interfaces and dependency injection. so, I imagine it is a similar principle. I just haven't done it in python before14:46
cjwatsonWell, I mean I guess an abstract interface is the ideally correct way to do it, but that code isn't using zope.interface (or indeed zope.component) more than trivially at the moment so it may not be worth it.  Perhaps just try / except ImportError: instead?14:52
cjwatsonWe'd need to review in a bit more detail but your "hack" doesn't seem obviously wrong.14:53
skaycjwatson: that is what I did in my junk branch. I made a wheel for my own use.14:53
cjwatsonDon't use junk branches when a project already exists though, as they mean you won't be able to propose a merge ...14:53
skayI wasn't sure I'd ever propose one since it is hacky14:54
skaymine is hacky14:54
skayif you want it, I'll make a real branch14:54
cjwatsonDoesn't seem overly hacky :)14:54
cjwatsonYou probably want a bit more effort into telling the user they don't have the right stuff to use that feature.14:55
skaywould you want a separate branch for changing setup.py to use setuptools instead of distutils.core? that part is unrelated to making prune optional.14:58
skayit was just for personal use. seems like I shouldn't mix things if someone's going to review15:00
cjwatsonI don't really know this codebase particularly well, but on general principles I think that ought to be a separate branch15:14
skaycjwatson and anyone, I made https://code.launchpad.net/~codersquid/python-oops-datedir-repo/optional-prune-dependencies/+merge/327978 for making prune optional, but this is not ready to land since I couldn't get tests to run16:40
skaysee my comment. I followed the README bit on development and I'm missing a step somewhere16:41
skayI haven't used testr before, so perhaps I've missed something obvious16:41

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!