-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use contributioncollection type in gql to fetch data in weekly intervals for a given user. Tabulate the various contribution types by week, separate table for each user Add new options for team and user Add option for output table format, default to fancy_grid
- Loading branch information
Showing
6 changed files
with
391 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,21 @@ author-email = '[email protected]' | |
url='https://gitlab.cee.redhat.com/mshriver/qe-pr-metrics' | ||
|
||
[options] | ||
python_requires = >=3.8 | ||
packages = find: | ||
setup_requires = setuptools_scm>=3.0.0 | ||
install_requires = | ||
attrs | ||
attrdict | ||
python-box | ||
cached-property | ||
click | ||
dynaconf>=3.0 | ||
gql | ||
dynaconf | ||
gql>=3.0.0rc0 | ||
logzero | ||
PyGithub | ||
python-dateutil | ||
requests | ||
requests-toolbelt # gql 3.0 http transport | ||
tabulate | ||
|
||
[options.extras_require] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Importable string for GQL query | ||
|
||
org_team_members_query = """query orgTeamMembers($organization: String!, $team: String!) { | ||
organization(login:$organization) { | ||
team(slug:$team) { | ||
name | ||
members{ | ||
nodes { | ||
login | ||
name | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" # noqa: E501 | ||
|
||
contributions_counts_by_user_query = """query getContributions($user: String! $from_date: DateTime!, $to_date: DateTime!) { | ||
user(login:$user) { | ||
contributionsCollection (from:$from_date, to: $to_date) { | ||
pullRequestContributionsByRepository { | ||
repository {name} | ||
contributions { totalCount } | ||
} | ||
pullRequestReviewContributionsByRepository { | ||
repository {name} | ||
contributions { totalCount } | ||
} | ||
issueContributionsByRepository { | ||
repository {name} | ||
contributions {totalCount} | ||
} | ||
commitContributionsByRepository { | ||
repository {name} | ||
contributions {totalCount} | ||
} | ||
} | ||
} | ||
} | ||
""" # noqa: E501 | ||
|
||
contributions_by_org_members_query = """query getContributions ($organization: String!, $team: String!, $from_date: DateTime!, $to_date: DateTime!) { | ||
organization(login:$organization) { | ||
team(slug:$team) { | ||
name | ||
members { | ||
nodes { | ||
login | ||
contributionsCollection (from: $from_date, to: $to_date) { | ||
pullRequestContributionsByRepository (maxRepositories:10) { | ||
repository {name} | ||
contributions (last:10){ | ||
nodes { | ||
pullRequest { | ||
number | ||
changedFiles | ||
deletions | ||
additions | ||
} | ||
occurredAt | ||
} | ||
} | ||
} | ||
pullRequestReviewContributionsByRepository (maxRepositories: 10) { | ||
repository {name} | ||
contributions (last:50) { | ||
nodes { | ||
occurredAt | ||
pullRequest { number } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" # noqa: E501 | ||
|
||
contributions_counts_by_org_members_query = """ | ||
query contributions_counts_by_org_members_query ($organization: String!, $team: String!, $from_date: DateTime!, $to_date: DateTime!) { | ||
organization(login: $organization) { | ||
team(slug: $team) { | ||
name | ||
members { | ||
nodes { | ||
login | ||
contributionsCollection (from: $from_date, to: $to_date) { | ||
pullRequestContributionsByRepository { | ||
repository {name} | ||
contributions { totalCount } | ||
} | ||
pullRequestReviewContributionsByRepository { | ||
repository {name} | ||
contributions { totalCount } | ||
} | ||
issueContributionsByRepository { | ||
repository {name} | ||
contributions {totalCount} | ||
} | ||
commitContributionsByRepository { | ||
repository {name} | ||
contributions {totalCount} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" # noqa: E501 |
Oops, something went wrong.