Closed tcrowe closed 4 years ago
https://github.com/lab132/buildbot-gitea/issues/4
I'm unsure how to incorporate it into setup.py
or if it needs to be. Any changes you need I'll be happy to make. You will not hurt my feelings in any way if you say I am wrong or need a change.
I forgot to add the tests. I will have to study how that works before I can add it.
The tests for oauth can be quite tricky, see https://github.com/buildbot/buildbot/blob/master/master/buildbot/test/unit/test_www_oauth.py for example. I would not set-up an end 2 end (E2E) unit test for this, but you may derive a unittest for Gitea from the OAuth2Auth
class in there.
The current CI fail is not because of your code, but buildbot changed something regarding the regular git step
so don't worry about it.
RE: Tests - I'm following that file
RE: Avatar - I'm looking at the classes for that, like Gravatar.
RE: Roles, teams, groups - I'm seeing how this interacts with Authz
class
I tried the above talked about things for a while but my knowledge is lacking. My time is short as well but I also don't want your team to have to pick up the slack because I don't have the python skill yet. Should we close it out and maybe me or someone can pick up the thread later?
I tried the above talked about things for a while but my knowledge is lacking. My time is short as well but I also don't want your team to have to pick up the slack because I don't have the python skill yet. Should we close it out and maybe me or someone can pick up the thread later?
You effort is greatly appreciated, thank you! I will see if I can continue this implementation. The unit tests from buildbot are not easy to understand, I have struggled myself multiple days to get them working. Please don't feel sorry for implicitly putting a task upon us, we want to develop this plugin further as well!
Thanks again for your contribution! I will probably incorporate this PR into a branch and close it in the next few days.
Thank you as well
@tcrowe I've finished the implementation now and added minimal unittests. Feel free to take a look at the changes.
What does it do?
It adds a class to the project that allows users to authenticate over OAuth2.
How to test
I'm unsure the proper way to test with python but this is how I've configured it.
./master.cfg
Demo screens
At buildbot home page
When logging in the title comes from this class. With
faIcon
property I don't see it but I copied the other classes, like GitHub, or GitLab, which reference anfaIcon = '?'
. It's from FontAwesome icons.Login at your Gitea
Authorize buildbot. The title and naming comes from how the user configures it.
The user is logged in