-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: properly handle task limits #67
feat: properly handle task limits #67
Conversation
@zugdev perhaps you can help test and review this since you seem the most affected |
sure! @jordan-ae do you have a bot running this fix? |
I'll add a QA link to the issue preview soon. But to test this locally you'll have to set the ubiquity-os-kernel up, clone and setup the command-start-stop repo. Then you can test this locally |
@jordan-ae, this task has been idle for a while. Please provide an update. |
@0x4007 I've added a QA. Looks like everyone is really busy but the changes here are really minimal should be pretty straight forward to review hopefully |
@whilefoo @gentlementlegen @zugdev can you test this |
With your QA you should've demonstrated that if a PR is waiting for review the active issue count of the user is aliviated. That's so he can start more issues while his PRs are pending review. I'll try to QA it myself tomorrow or the day after that. |
What should also be tested is the +1 task available after the threshold for reviews is due. |
@zugdev & @gentlementlegen not sure if I linked it poorly but that's what the QA demonstrates. The user's initial task limit is 2. He self assigns the two task and can't asign himself to task 3 until an approved pr is opened against one of his current task. Once a pr is opened and has an approval +1 task is added to his task limit. |
I tested with your changes and here is what I get:
Finally the assigment gets denied with the following values
It seems the |
@jordan-ae, this task has been idle for a while. Please provide an update. |
@gentlementlegen I've been facing this error on /start when testing. It's trying to check pull request that do not exist I've cleared all existing changes and still get the same error. Do you have any idea what might be causing the error? |
@jordan-ae never happened to me before. Have you changed your code for testing and forgot to revert it? It should be fetching the pull-requests from GitHub API so there cannot be items that do not exist there. |
Thought so too. But I've reverted all the changes, same Issue. So I recloned the repo, same issue still. |
Does this reference a private repository? Otherwise there could be a bug then you should investigate why this repository gets listed if it doesn't exist. |
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 don't think fully implements the specification in which I stated that after the review changes are resolved or the reviewer was requested again, it should be counted as completed
Missed that when reading the spec. Will add Asap |
src/handlers/shared/start.ts
Outdated
const adjustedAssignedIssues = assignedIssues.length - approved.length + changes.length; | ||
|
||
// check for max and enforce max | ||
if (Math.abs(assignedIssues.length - openedPullRequests.length) >= limit) { | ||
if (Math.abs(adjustedAssignedIssues) >= limit) { |
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.
if I have 1 issue and 1 PR with requested changes, it will count as 2 here but it should only count 1
Unused types (1)
|
39577e4
to
fadfb4e
Compare
Feature works now but I'm having a hard time writing a handler for this function to make the test pass |
The first issue in the tests is
make sure a token is provided during the tests for these. |
@jordan-ae, this task has been idle for a while. Please provide an update. |
Resolves #28
This PR updates the conditions for handling task limits