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

Add get active installations method #2134

Conversation

xtuchyna
Copy link
Member

@xtuchyna xtuchyna commented Dec 3, 2020

Related Issues and Dependencies

Related to both thoth-station/mi-scheduler#58
and thoth-station/common#1054 (comment)

This introduces a breaking change

  • Yes
  • No

This should yield a new module release

  • Yes
  • No

This Pull Request implements

New def get_kebechet_github_installations_active(self) -> List[str]: method

Description

The method returns the string list of all the repositories that have active kebechet installations

@xtuchyna xtuchyna added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 3, 2020
@sesheta sesheta added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 3, 2020
@xtuchyna
Copy link
Member Author

xtuchyna commented Dec 3, 2020

NOTE: not yet tested, waiting for #2133 to be solved

@xtuchyna
Copy link
Member Author

xtuchyna commented Dec 3, 2020

/hold

@sesheta sesheta added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 3, 2020
thoth/storages/graph/postgres.py Outdated Show resolved Hide resolved
thoth/storages/graph/postgres.py Outdated Show resolved Hide resolved
thoth/storages/graph/postgres.py Show resolved Hide resolved
@sesheta sesheta added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 3, 2020
@xtuchyna xtuchyna requested a review from pacospace December 3, 2020 13:57
@goern
Copy link
Member

goern commented Dec 4, 2020

/label sig/knowledge-graph

thoth/storages/graph/postgres.py Outdated Show resolved Hide resolved
thoth/storages/graph/postgres.py Outdated Show resolved Hide resolved
@pacospace
Copy link
Contributor

please rebase @xtuchyna

@sesheta sesheta added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 8, 2020
@sesheta sesheta removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 10, 2020
@xtuchyna
Copy link
Member Author

done @pacospace

@sesheta
Copy link
Member

sesheta commented Dec 14, 2020

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sesheta sesheta added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2020
@pacospace
Copy link
Contributor

/retest

['repository_foo_fullname', 'repository_bar_fullname', ...]
"""
with self._session_scope() as session:
active_installations = (
Copy link
Contributor

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()
)

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants