-
Notifications
You must be signed in to change notification settings - Fork 15
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
Time "Top Up" Limits #51
Comments
Note The following contributors may be suitable for this task: Keyrxng
ishowvel |
@0x4007 Wouldn't it be simpler to use a "quota" or "credits" for reminders? Based on what you describe:
So basically you would be allowed to get Maybe I didn't understand properly, but given the specification, consider the following example:
Is this correct? |
Yes. In practice the good talent gets their reviews processed pretty quickly. The ones who aren't cut out for the job end up being much slower from reviewers losing patience with them. But perhaps your proposal might be more fair. The concept of "credits" seem to imply that storage is required. My strategy is just a calculation based on elapsed time. You might be able to parse the entire timeline every time to see if there are exceptions to the timing though, like for slow reviews and such, but it makes the logic more complex. |
I think your idea makes more sense because with mine, a
However wouldn't this mean that it would also be the case with your spec? I know the deadlines are not meant to be strictly exact, but the gap between a week and a month seems too big. Maybe we could make it as simple as one reminder allowed only? Would that be too harsh? If we handle slow reviews I think it would help us keeping deadline tighter. |
Of course in an ideal world everybody processes their tasks with utmost priority and speed. But the reality is that even our core team members spend several weeks on, for example, a one week task. After monitoring these behaviors for some years I confidently came up with this design for the specification. I think it's an acceptable starting point and we can iterate from there to try and coax better performance out of the team. However the main business problem I want to solve with this implementation is to disqualify the outside contributors who fall under this category:
|
Yes I understand the problem you are trying to solve. The one I am thinking of is when users take a 1h task, and they keep pushing for many days, so no reminder or blame is sent although that task should have been finished quite quickly. I've seen 15 minutes tasks take a week. Let's try implementing your idea and see how it goes, it just feels like more pressure is put on high priority tasks which are currently mostly handled by the core team, when I think what you're targeting are low level priority tasks done by outside contributors. |
I would like to try the current proposed strategy first but we can potentially have a static amount of top ups too with an alternative configuration (for example, 5 for every priority level) which would make things easier for the higher priority tasks. |
/ask based on the specification please provide some typescript code for the developer to start this implementation with |
1 similar comment
/ask based on the specification please provide some typescript code for the developer to start this implementation with |
Based on the specification, here's a TypeScript code snippet to help you start implementing the contribution scanning and top-up management system. This implementation leverages Octokit for interacting with GitHub APIs, integrates with the UbiquityOS SDK and Logger for ecosystem compatibility, manages environment variables using dotenv, and utilizes Luxon for date and time manipulation. Additionally, ensure that your project is set up with ESLint and Prettier for code quality and formatting standards. // src/handlers/manageTopUps.ts
import { Octokit } from "@octokit/rest";
import { DateTime } from "luxon";
import { config } from "dotenv";
import { UbiquityOS, Logger } from "ubiquity-os-sdk";
// Load environment variables from .env file
config();
// Initialize Octokit with GitHub token
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
});
// Initialize UbiquityOS SDK and logger
const ubiquity = new UbiquityOS();
const logger = new Logger("TopUpManager");
// Define priority to top-up mapping
const priorityTopUps: Record<number, number> = {
1: 5,
2: 4,
3: 3,
4: 2,
5: 1,
};
// Define base timer in days
const BASE_TIMER_DAYS = 14;
// Interface for Issue Labels
interface Label {
name: string;
}
// Function to determine priority based on labels
function getPriority(labels: Label[]): number | null {
for (const label of labels) {
const match = label.name.match(/Priority\s+(\d)/i);
if (match) {
return parseInt(match[1], 10);
}
}
return null;
}
// Function to manage top-ups and disqualify assignees if necessary
export async function manageTopUps(owner: string, repo: string, issueNumber: number): Promise<void> {
try {
// Fetch issue details to get labels and assignee
const { data: issue } = await octokit.issues.get({
owner,
repo,
issue_number: issueNumber,
});
// Determine the priority of the issue
const priority = getPriority(issue.labels as Label[]);
if (priority === null || !(priority in priorityTopUps)) {
logger.error(`Issue #${issueNumber} does not have a valid priority label.`);
return;
}
const totalTopUps = priorityTopUps[priority];
const assignee = issue.assignee?.login;
if (!assignee) {
logger.warn(`Issue #${issueNumber} does not have an assignee.`);
return;
}
// Fetch issue timeline events
const events = await octokit.issues.listEventsForTimeline({
owner,
repo,
issue_number: issueNumber,
per_page: 100,
});
// Get the assignment timestamp
const assignmentEvent = events.data.find(event => event.event === "assigned" && event.assignee?.login === assignee);
const assignmentDate = assignmentEvent ? DateTime.fromJSDate(new Date(assignmentEvent.created_at)) : DateTime.fromJSDate(new Date(issue.created_at));
// Calculate elapsed time in days
const now = DateTime.now();
const elapsedDays = now.diff(assignmentDate, 'days').days;
const elapsedTimers = Math.floor(elapsedDays / BASE_TIMER_DAYS);
// Determine used top-ups
const usedTopUps = Math.min(elapsedTimers, totalTopUps);
if (usedTopUps >= totalTopUps) {
// Disqualify the assignee
await ubiquity.disqualifyAssignee(owner, repo, issueNumber, assignee);
logger.info(`Assignee @${assignee} for issue #${issueNumber} has been disqualified due to exceeding top-ups.`);
} else {
// Notify the assignee about remaining top-ups
const remainingTopUps = totalTopUps - usedTopUps;
await ubiquity.notifyAssignee(owner, repo, issueNumber, assignee, remainingTopUps);
logger.info(`Assignee @${assignee} for issue #${issueNumber} has ${remainingTopUps} top-ups remaining.`);
}
} catch (error) {
logger.error(`Error managing top-ups for issue #${issueNumber}:`, { error });
throw error;
}
} Explanation
Next Steps
Example UsageAssuming you have set up the necessary methods in the UbiquityOS SDK, you can invoke the import { manageTopUps } from "./handlers/manageTopUps";
// Example: Manage top-ups for issue #51 in the 'ubiquity-os-marketplace/daemon-disqualifier' repository
manageTopUps("ubiquity-os-marketplace", "daemon-disqualifier", 51)
.then(() => {
console.log("Top-up management completed successfully.");
})
.catch((error) => {
console.error("An error occurred during top-up management:", error);
}); This setup provides a robust foundation for managing top-ups based on issue priorities and elapsed time, ensuring that assignees are fairly evaluated and managed within the UbiquityOS ecosystem. |
I am convinced that the top-up calculation can be made much simpler, because in the end it is just a multiplier for the deadline, no need to calculate all the in-between steps, more likely just the "final final" deadline, |
What about the reminders? If that is handled by another set of logic then okay! |
This comment has been minimized.
This comment has been minimized.
|
Caution You are not assigned to this task |
/start |
Tip
|
Important
|
@0x4007 Currently, if a reminder is sent, we do not send anymore reminders until the final deadline, or if user activity has happened in between. I guess this should be change to remind many times due to the top-up system? |
Yeah I think each top up should incur a reminder of sorts. I'm wondering if it's annoying to interject and say something like "You used 3 of 5 top ups!" Etc |
Currently I just mention it in the reminder "Top ups remaining: 3" but that can be tweaked. |
I think there is value in saying both numbers to take advantage of the psychological principle of loss aversion. |
A quick idea that can use improvement:
Assignee can restart the disqualification timer by continuing to try. There's many clear examples of the task not being the right fit for the assignee and they try i.e. for months on projects that should be doable in a day.
We could consider doing limits on time limit "top ups." So for example:
I suspect that priority 5 tasks will border on eliminating most even capable assignees but once the task is complete even if just slightly after deadline we can always retroactively assign credit.
I foresee a bit of complexity around the logic related to dealing with the "time limits" for follow up/disqualify and the top up counter.
14 / 5 = 2.8
days.35/14=2.5
meaning we are still at top up number 2.Example Context
Logic:
Remarks:
I wonder if the original time that we grant should be based on the
Time:
label because I see problems with tasks that are set toTime: <1 Week
andPriority: 5 (Emergency)
they would only be able to get 5.6 days to work on it.The text was updated successfully, but these errors were encountered: