Fixed TypeError when commit is being null.#464
Fixed TypeError when commit is being null.#464AyushAgnihotri2025 wants to merge 1 commit intoanmol098:masterfrom
TypeError when commit is being null.#464Conversation
TypeError commit is being null.TypeError when commit is being null.
There was a problem hiding this comment.
I can't really test this right now, but looks like it should fix that issue.
BUT, if it doesn't, the code below should do the job for sure.
for commit in commit_data["data"]["repository"]["ref"]["target"]["history"]["nodes"]:
try:
if commit and commit["committedDate"]:
date = search(r"\d+-\d+-\d+", commit["committedDate"]).group()
curr_year = datetime.fromisoformat(date).year
quarter = (datetime.fromisoformat(date).month - 1) // 3 + 1
if repo_details["name"] not in date_data:
date_data[repo_details["name"]] = dict()
if branch["name"] not in date_data[repo_details["name"]]:
date_data[repo_details["name"]][branch["name"]] = dict()
date_data[repo_details["name"]][branch["name"]][commit["oid"]] = commit["committedDate"]
if repo_details["primaryLanguage"] is not None:
if curr_year not in yearly_data:
yearly_data[curr_year] = dict()
if quarter not in yearly_data[curr_year]:
yearly_data[curr_year][quarter] = dict()
if repo_details["primaryLanguage"]["name"] not in yearly_data[curr_year][quarter]:
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]] = {"add": 0, "del": 0}
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]]["add"] += commit["additions"]
yearly_data[curr_year][quarter][repo_details["primaryLanguage"]["name"]]["del"] += commit["deletions"]
except Exception as error:
DBM.p(f"A exception ocurred while getting the commit history! {str(error)}")
continueThank you @AyushAgnihotri2025!
|
Merging when? |
thenithinbalaji
left a comment
There was a problem hiding this comment.
Can you merge it asap?
|
I personally can't merge the PR until the CI workflow runs successfully and I also can't launch the workflow. I think, it should be triggered on push. @AyushAgnihotri2025, @willnaoosmith, could you please make sure the workflow runs successfully and, if not, investigate logs and fix errors? P.S. also, if it's not a big deal, I would prefer |
|
@pseusys it finally did run correctly again! |
See #553 |
|
@AyushAgnihotri2025 could you resolve conflicts? |
|
@pseusys Is this PR still valid now, code has undergone a lot of changes which may/may not have fixed the issues being addressed by the PR. |
Closes #463
Closes #425