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

Reuse gitlab session for issue creation #71

Open
fritterhoff opened this issue Jul 19, 2021 · 0 comments
Open

Reuse gitlab session for issue creation #71

fritterhoff opened this issue Jul 19, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request Pusher Pusher related issue
Milestone

Comments

@fritterhoff
Copy link
Collaborator

Instead of creating a new gitlab session by calling the create_issues method in the pusher we should reuse the passed gitlab session.

create_issues( gitlabserver=GITLAB_SERVER,
token=GITLAB_TOKEN,
repository=GITLAB_REPO_NAME,
servicename=SERVICENAME,
title=report_name,
description="A report has been submitted. The name of the branch is: {}.".format(report_name))

gprojects = get_project_handle(gitlabserver, token, repository, servicename)

if (gitlab_instance := gitlab.Gitlab(gitlabserver, token, ssl_verify=GITLAB_CERT_VERIFY)) is not None:
if (projectid := get_projectid_by_name(gitlab_instance, repository, servicename)) is not None:
gprojects = gitlab_instance.projects.get(projectid)

@fritterhoff fritterhoff added enhancement New feature or request Pusher Pusher related issue labels Jul 19, 2021
@fritterhoff fritterhoff added this to the 0.1.2 milestone Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Pusher Pusher related issue
Projects
None yet
Development

No branches or pull requests

3 participants