TravisCI-Telegam-Bot icon indicating copy to clipboard operation
TravisCI-Telegam-Bot copied to clipboard

Add support for multiple repositories per user

Open cmccandless opened this issue 7 years ago • 7 comments

Currently, this bot has the following limitation:

Currently i can watch only one repository from each user.

cmccandless avatar Dec 08 '17 14:12 cmccandless

Hi @cmccandless, thank you for your issue.

Currently, this repository is not under active development, and I'm not going to soon start working on it, but all PR's are welcome

artemgurzhii avatar Dec 08 '17 15:12 artemgurzhii

I think I have an idea on how to implement this. What database does the backend use (MySQL?)?

cmccandless avatar Dec 19 '17 16:12 cmccandless

@cmccandless Postgresql

artemgurzhii avatar Dec 19 '17 17:12 artemgurzhii

@artemgurzhii My idea is to replace the existing table with the following:

CREATE TABLE(
    id SERIAL NOT NULL,
    url VARCHAR(100) NOT NULL,
    json VARCHAR(120),
    watching BOOLEAN,
    build VARCHAR(9),
    watchonlyfailing BOOLEAN,
    PRIMARY KEY(id, url)
);

Commands would also need modified to allow selective or universal stop/start watching, or toggle failed builds only per repo.

I one thing I'm not sure I'd be able to do myself is migrate the existing DB to the new table. There is likely a way to include a conditional migration in a PGSQL query, but as this would only need to be a one-time migration it would be better not to include that migration code in the source code. Would you be willing/able to do the appropriate migration if I created a PR with all of the necessary code changes?

cmccandless avatar Dec 19 '17 17:12 cmccandless

@cmccandless Yes!

artemgurzhii avatar Dec 19 '17 19:12 artemgurzhii

@cmccandless Thank you very much for your help!

artemgurzhii avatar Dec 19 '17 19:12 artemgurzhii

It will take me some time, maybe not before the New Year.

cmccandless avatar Dec 19 '17 19:12 cmccandless