keeping up-to-date

This commit is contained in:
pseusys
2023-02-18 00:03:44 +01:00
2 changed files with 5 additions and 2 deletions

View File

@@ -94,8 +94,10 @@ async def make_commit_day_time_list(time_zone: str) -> str:
for repository in repos:
result = await DM.get_remote_graphql("repo_committed_dates", owner=repository["owner"]["login"], name=repository["name"], id=GHM.USER.node_id)
committed_dates = result["data"]["repository"]["defaultBranchRef"]["target"]["history"]["edges"]
if result["data"]["repository"] is None or result["data"]["repository"]["defaultBranchRef"] is None:
continue
committed_dates = result["data"]["repository"]["defaultBranchRef"]["target"]["history"]["edges"]
for committed_date in committed_dates:
local_date = datetime.strptime(committed_date["node"]["committedDate"], "%Y-%m-%dT%H:%M:%SZ")
date = local_date.replace(tzinfo=utc).astimezone(timezone(time_zone))

View File

@@ -67,10 +67,11 @@ GITHUB_API_QUERIES = {
}
""",
# Query to collect info about user commits to given repository, including: commit date, additions and deletions numbers.
# TODO: increase branch number with pagination
"repo_commit_list": """
{
repository(owner: "$owner", name: "$name") {
refs(refPrefix: "refs/heads/", orderBy: {direction: DESC, field: TAG_COMMIT_DATE}, first: 100) {
refs(refPrefix: "refs/heads/", orderBy: {direction: DESC, field: TAG_COMMIT_DATE}, first: 10) {
edges {
node {
... on Ref {