Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't tie entire library to ability to log into Bugzilla #26

Open
omaciel opened this issue Sep 23, 2019 · 5 comments
Open

Don't tie entire library to ability to log into Bugzilla #26

omaciel opened this issue Sep 23, 2019 · 5 comments

Comments

@omaciel
Copy link

omaciel commented Sep 23, 2019

All methods that import the config.py module are forcefully tied to the ability to log in to Bugzilla, which in my opinion is not what you want to do. Instead, perhaps have a method that can be called to execute the login method? Simple things such as importing the helpers.py module will fail if you haven't configured your credentials to login to Bugzilla.

@RazTamir
Copy link
Owner

Hi @omaciel ,

Sorry for the long time it took me to reach that.

If you are not logged into Bugzilla, nothing will work.
So in helpers.py which is the core functionality, I'm importing config so it is tied up but it is kind of a prerequisite.

Do you have another approach for not restricting logging into Bugzilla?

@omaciel
Copy link
Author

omaciel commented Oct 28, 2019

I feel that you could warn the user that being logged into Bugzilla is a hard requirement for getting full advantage of the features you're exposing, but perhaps one could still use this tool and get some value out of it? Anyhow, when debugging or working with your code, being restricted to being logged in to even import a module is imho not a good solution. Whatever functionality depending on being logged in could have a decorator that checks this, perhaps?

@RazTamir
Copy link
Owner

RazTamir commented Dec 5, 2019

Hi @omaciel ,
I tried to test a your suggestion and it will not be different that it is now.
Every script requires a login to Bugzilla so adding Decorator (for example) will require adding those to all functions which are kind of not needed if applicable to all.

For now, I will warn the users of this repo that this is a hard requirement

@omaciel
Copy link
Author

omaciel commented Dec 5, 2019

Here's how I created a similar functionality (albeit much simpler):

https://github.com/SatelliteQE/bugwrangler/blob/master/bugwrangler/__init__.py#L22

As you can see, I create a configuration object that can be used by any/all methods that require authentication, and values are read from the environment. You could have it check if the credentials you need are found in a file, and if not, assume None and move on.

@RazTamir
Copy link
Owner

RazTamir commented Dec 5, 2019

I just read this thread again and I just want to make sure about the login statement.
The login will happen with every call for Bugzilla API - not for the full session of the script's execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants