-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Fixed TypeError
when commit is being null.
#464
base: master
Are you sure you want to change the base?
Conversation
TypeError
commit is being null.TypeError
when commit is being null.
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.
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)}")
continue
Thank you @AyushAgnihotri2025!
Merging when? |
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.
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! |
Closes #463
Closes #425