Closed sladyn98 closed 4 years ago
@sladyn98 The changes you made I think are only valid for gitter as backend. You need to find the ways of mapping usernames for other backends too. Also, you need to use this function while creating the issue.
@abhishalya but I think the issue description mentions issues created only via gitter right?In terms of other backends we would by default have to just make a guess for the username because we won't be absolutely sure that they are the original gitlab/github usernames.
If the issue demands In terms of mattermost we could return gitlab. For slack and other backends,I think github would be the best guess. Thoughts?
@sladyn98 Well then you should not make changes to the backend.py file. Instead I feel the function should be added to the labhub because that is where the issue is being created.
Yeah @abhishalya I totally agree but that wouldn't change much because we would be doing the same things there as well.
I think the functions in the backend.py file are the ones where the output is dependent on the backend used by the corobo. Here since we can only form solution for gitter backend we should not add that function to the backend file. Also, currently the function does nothing, we are not using it. You'll need to form the entire solution and then test it too.
Yeah so for now I think we can add the gitter backend functionality to labhub and test out the functionality,i don't see the point of other backends because we would return only the github profile for that username based on a guess. The other backend we can add is mattermost so I think I'll add a function to labhub and integrate it with create issues and create a PR.
On Thu, Dec 20, 2018, 8:09 PM Abhinav Kaushlya <notifications@github.com wrote:
I think the functions in the backend.py file are the ones where the output is dependent on the backend used by the corobo. Here since we can only form solution for gitter backend we should not add that function to the backend file. Also, currently the function does nothing, we are not using it. You'll need to form the entire solution and then test it too.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/coala/corobo/pull/645#issuecomment-449020164, or mute the thread https://github.com/notifications/unsubscribe-auth/AbgGHv_3vW1TnpRVFQ_klsHhjgm3OtYuks5u66EqgaJpZM4Zb6g- .
We can then test out this functionality,because most of the issues would be created via gitter so this solution should be more than enough
@sladyn98 You'll also have to prepare tests for the changes you make. :)
@abhishalya yeah buddy i will write the tests .Is this PR good till now.
@abhishalya I can't seem to find the tests written for backend.py could you help me a bit
@sladyn98 Test where you use it :wink:
I mean if you are using the function from the backends.py file in labhub then the test will lie in the labhub test file where the function from the backend file will be automatically tested based on the use in the labhub.
Yeah is there a test for the function message_link which is a part of the backend file,because I thought it would give me a sort of example on how to write a test for it.
@sladyn98 git grep message_link
@abhishalya I did a grep search but no such tests popped up.
Also please run coala
before pushing, so as to avoid bunch of comments from the gitmate-bot.
Also please run
coala
before pushing, so as to avoid bunch of comments from the gitmate-bot.
Yeah Im sorry I will run that.
@abhishalya now the tests are passing and the coverage has also gone up.
utils/backends.py has still been changed.
Yeah I will change that when I am sure the tests I have written are good to go.
@Makman2 Kindly review this PR.
This function is created to map github and gitlab usernames. Ensures correct profile links are mapped for both websites.
Fixes https://github.com/coala/corobo/issues/347
Reviewers Checklist
botcmd
andre_botcmd
decorators.