-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add get active installations method #2134
Add get active installations method #2134
Conversation
NOTE: not yet tested, waiting for #2133 to be solved |
/hold |
/label sig/knowledge-graph |
please rebase @xtuchyna |
done @pacospace |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pacospace The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
['repository_foo_fullname', 'repository_bar_fullname', ...] | ||
""" | ||
with self._session_scope() as session: | ||
active_installations = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xtuchyna you can also use directly with_entities
to receive directly the specific parameter.
active_installations_repos = (
session.query(KebechetGithubAppInstallations)
.filter(KebechetGithubAppInstallations.is_active.is_(True))
.with_entities(KebechetGithubAppInstallations.slug)
.all()
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better to do on the database side to avoid unnecessary serialization, rather than in python code.
Related Issues and Dependencies
Related to both thoth-station/mi-scheduler#58
and thoth-station/common#1054 (comment)
This introduces a breaking change
This should yield a new module release
This Pull Request implements
New
def get_kebechet_github_installations_active(self) -> List[str]:
methodDescription
The method returns the string list of all the repositories that have active kebechet installations