fedora-infra / supybot-fedora

Fedora plugin for Supybot
20 stars 23 forks source link

plugin hard codes admin.fedoraproject.org in a few places #51

Open nirik opened 8 years ago

nirik commented 8 years ago

For downloading package owners:

    self.log.info("Downloading package owners cache")
    data = requests.get(
        'https://admin.fedoraproject.org/pkgdb/api/bugzilla?format=json',
        verify=True).json()

and getting the current release:

def get_current_release(self):
    url = 'https://admin.fedoraproject.org/pkgdb/api/collections/'
    query = {
        'clt_status': 'Active',
        'pattern': 'f*',
    }
    response = requests.get(url, params=query)

the url is hard coded, even tho there is a config for fas.url.

This makes this plugin not work in stg (as we need to point to admin.stg.fedoraproject.org

XakV commented 8 years ago

Hey nirik - would you want to change the fasurl for package owners, current release, and accounts all at once or would you want to use a separate url for staging for the release, and bus, but not fas?

I can think of two ways of doing this, taking an argument for get_current_release and refresh individually, or adding it to the config so that package owners, current release, and accounts all configured together to be either prod or stage.

Thanks, Zach (#aikidouke)

nirik commented 8 years ago

Well, either would work I think since it's the same base host/url.. and if you are in stg you are likely to want to change it for all of them. So, one place is fine.

ryanlerch commented 2 years ago

Now FAS2 is not more, and pkdb2 is gone too, the only hard-coded admin.fp.o URL is mirrormanger:

https://github.com/fedora-infra/supybot-fedora/blob/develop/supybot_fedora/plugin.py#L1155

we should be able to put that into a supybot / limnoria config variable pretty easily