ubiquity-os-marketplace / disqualifier

Follows up on user activities related to task, sends reminders, and unassign inactive users.
0 stars 9 forks source link

Fix issues #22

Open Keyrxng opened 1 week ago

Keyrxng commented 1 week ago

Resolves #21

Below is the activity logged after lastCheck.

old results from 110

[
  {
    event: 'review_requested',
    created_at: '2024-09-15T00:21:13Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'review_requested',
    created_at: '2024-09-14T05:58:45Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'review_requested',
    created_at: '2024-09-14T05:58:44Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'review_requested',
    created_at: '2024-09-14T05:58:44Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'ready_for_review',
    created_at: '2024-09-14T05:57:21Z',
    actor: 'gentlementlegen'
  }
]

new results:

[
  {
    event: 'review_requested',
    created_at: '2024-09-15T00:21:13Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-15T00:16:33Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'review_requested',
    created_at: '2024-09-14T05:58:45Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'review_requested',
    created_at: '2024-09-14T05:58:44Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'review_requested',
    created_at: '2024-09-14T05:58:44Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'ready_for_review',
    created_at: '2024-09-14T05:57:21Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-14T05:55:14Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-14T05:50:43Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-14T05:20:33Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T20:57:37Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T20:48:44Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T19:04:53Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T16:35:06Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T16:12:54Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T16:11:02Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T16:06:00Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T16:00:00Z',
    actor: 'gentlementlegen'
  },
  {
    event: 'committed',
    created_at: '2024-09-13T15:53:56Z',
    actor: 'gentlementlegen'
  }
]
github-actions[bot] commented 1 week ago

Unused types (1)

Filename types
src/types/github-types.ts ListCommentsForIssue
Keyrxng commented 1 week ago

@gentlementlegen tests added and issue resolved

gentlementlegen commented 1 week ago

The configuration is fixed, but I am a bit lost with the current behavior of that plugin after testing it. I do not know if that is introduced by the changes of this pull-request, but look at this run:

Keyrxng commented 1 week ago

So because you used the /start command last month, then just now assigned via UI self-assign, it has taken the deadline from the what I assume is the comment as opposed to your self-assignment event.

{
  "now": "Sep 19, 2024, 3:09 PM",
  "reminder": "Aug 22, 2024, 9:37 AM",
  "deadline": "Aug 22, 2024, 9:38 AM",
  "caller": "updateTaskReminder"
}

So what's the solution? Fix the .sort() usage.

Do we as an org permit contributors to self-assign? It bypasses checks in other plugins.

Keyrxng commented 1 week ago

Likely myself who introduced it @gentlementlegen. Realized sort was backwards, but your example highlighted the fact we should use the timeline over comments if the timeline is later than the lastCheck so I implemented that and updated tests

image

gentlementlegen commented 1 week ago

@Keyrxng I pulled your latest changes and ran again, the behavior was similar

Do we as an org permit contributors to self-assign? It bypasses checks in other plugins.

This applies only to members but we could potentially be un-assigned for no reason the way it is happening to me right now. Can't we only based the checks to use the timeline events and check the last time a user was assigned?

Related run: https://github.com/Meniole/user-activity-watcher/actions/runs/10952491105/job/30411260264#step:5:31

0x4007 commented 5 days ago

Ignore the deadline.

Unassignment only should happen after 7 days of no activity (configurable)

Keyrxng commented 2 days ago

QA: https://github.com/ubq-testing/user-activity-watcher/actions/runs/11016118749/job/30590832730

Can't we only based the checks to use the timeline events and check the last time a user was assigned?

I got rid of the lastCheck and any comment related logic. So we just use the start event and timeline activity.

DeFi-crypto commented 4 hours ago

This looks really interesting. I'm trying to try the plugin currently and it seems to be working fine.