Skip to content

Conversation

emma2207
Copy link
Collaborator

@emma2207 emma2207 commented May 1, 2025

Problem

For the past ~20 days scrum-lord has been opening multiple issues for each day.
Often 2 issues are opened, but sometimes more than that.

After investigation it seems that issues.totalCount seems to be the problem.
Instead of returning an accurate count of number of total github issues, it often returns 0.
So, scrum-lord thinks that there are no existing daily issues and it creates (another) one.

Solution

I fixed it in a not-so-pretty-but-effective-way, so that scrum-lord checks first whether totalCount is greater than 0 (which means it's probably working correctly) and if that's not the case we try to go on anyway.

It's tricky to test for this kind of problem, because it requires connecting to an actual repo and right now the tests are only set up to test some functions locally. So, none of the tests were failing even when something was broken. It also means you just gotta trust me that this fixes it. 😂

@emma2207 emma2207 changed the title Fix issue with multiple daily scrum issues Fix multiple daily scrums issue May 1, 2025
@emma2207 emma2207 requested review from cgreene and ivichadriana May 1, 2025 19:54
@ivichadriana
Copy link

looks good, approving.
glad the fix seems to be pretty simple (although i'm sure it was NOT simple to find the simple fix lol) thanks emma!

Copy link
Collaborator

@dhimmel dhimmel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember that much about this codebase, but leaving a quick review in case its helpful.

Glad this code is still in use!

@@ -174,7 +174,16 @@ def get_upcoming_workdays(workdays_ahead: int = 2) -> typing.Iterator[datetime.d
# to help ensure the most recent existing e-scrum issue is included even when other
# non e-scrum issues exist
issues = repo.get_issues(state='all', sort='number', direction='desc')
issues = issues[:min(10 + args.workdays_ahead, issues.totalCount)]
# If totalCount is working properly
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding a link to the PR with the bug description or describing it in the comment

Comment on lines +184 to +186
# But if that's not possible, just continue
except:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know more about the error that could occur (i.e. except a specific error) and why it happens?

@emma2207
Copy link
Collaborator Author

emma2207 commented May 2, 2025

There is a known issue that totalCount returns 0 when the result is unknown: PyGithub issue.
The part I don't understand is why it's suddenly having trouble figuring out totalCount. I've read some accounts of people online running into problems with totalCount getting maxed out at 1000 even when there are more than 1000 issues.

So, there are some known issues with totalCount and we're just trying to patch up the buggy behavior. I will let this PR sit until we know whether Casey's PR #13 resolves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants