Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

feat: follow up with reviewer #783

Closed
wants to merge 14 commits into from
Closed

feat: follow up with reviewer #783

wants to merge 14 commits into from

Conversation

EtherealGlow
Copy link
Contributor

@EtherealGlow EtherealGlow commented Sep 19, 2023

Resolves #324

Quality Assurance:

@netlify
Copy link

netlify bot commented Sep 19, 2023

Deploy Preview for ubiquibot-staging ready!

Name Link
🔨 Latest commit 4d09c74
🔍 Latest deploy log https://app.netlify.com/sites/ubiquibot-staging/deploys/6533b687a585a100083f9cc8
😎 Deploy Preview https://deploy-preview-783--ubiquibot-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@EtherealGlow
Copy link
Contributor Author

same logic as this #708

@EtherealGlow
Copy link
Contributor Author

just it follows up with the reviewer/reviewers now instead of doing nothing

Copy link
Contributor

@wannacfuture wannacfuture left a comment

Choose a reason for hiding this comment

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

You need to check the pending time duration.

  • The bot should follow up the reviewer who has been delayed for some days(maybe 3 or 5) after being requested for the review.

  • Also the delay duration should be configuratble.

@EtherealGlow

@EtherealGlow
Copy link
Contributor Author

EtherealGlow commented Sep 21, 2023

doesnt this execute whenever the bot tries to follow up with reviewer?
it only gets the reviewer which have pending reviews it doesnt get the reviewers who have already reviewed

@0x4007
Copy link
Member

0x4007 commented Sep 23, 2023

QA should always be posted thats why its part of the pull request template.

@EtherealGlow
Copy link
Contributor Author

how would i even qa this?

@0x4007
Copy link
Member

0x4007 commented Sep 25, 2023

Just post proof that it works on your fork

@0xcodercrane
Copy link
Contributor

how would i even qa this?

Please refer to the README.md

@EtherealGlow
Copy link
Contributor Author

qa
idk why the bot requested the review twice

@EtherealGlow
Copy link
Contributor Author

Now that I see it's prob because it's followed up a second time, as it was like 30s to follow up and 5mins to disqualify

@wannacfuture
Copy link
Contributor

Please read this again. @EtherealGlow

#783 (review)

@EtherealGlow
Copy link
Contributor Author

@wannacfuture is there something in github api which provides the timestamps for the requested reviewers

@wannacfuture
Copy link
Contributor

@wannacfuture is there something in github api which provides the timestamps for the requested reviewers

https://docs.github.com/en/rest/pulls/review-requests?apiVersion=2022-11-28#get-all-requested-reviewers-for-a-pull-request

you can use octokit. There is createdAt field representing the timestamp or review request for certain reviewers.
I think there is already a function for that: getReviewRequests

@EtherealGlow
Copy link
Contributor Author

{
  "users": [
    {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://api.github.com/users/octocat/followers",
      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
      "organizations_url": "https://api.github.com/users/octocat/orgs",
      "repos_url": "https://api.github.com/users/octocat/repos",
      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
      "received_events_url": "https://api.github.com/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    }
  ],
  "teams": [
    {
      "id": 1,
      "node_id": "MDQ6VGVhbTE=",
      "url": "https://api.github.com/teams/1",
      "html_url": "https://github.com/orgs/github/teams/justice-league",
      "name": "Justice League",
      "slug": "justice-league",
      "description": "A great team.",
      "privacy": "closed",
      "notification_setting": "notifications_enabled",
      "permission": "admin",
      "members_url": "https://api.github.com/teams/1/members{/member}",
      "repositories_url": "https://api.github.com/teams/1/repos",
      "parent": null
    }
  ]
}

In this example response I couldnt find a createdAt field

@wannacfuture
Copy link
Contributor

wannacfuture commented Oct 9, 2023

@EtherealGlow
Please take a look at the link I have provided again.

/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers
image

@EtherealGlow
Copy link
Contributor Author

i am not following something because i think thats for requesting reviews not for getting all requested reviews
i could not find a created at in this
https://api.github.com/repos/EtherealGlow/ubiquibot/pulls/25/requested_reviewers

@whilefoo
Copy link
Collaborator

whilefoo commented Oct 10, 2023

@wannacfuture your API call is to request a reviewer not listing them like @EtherealGlow said. Instead of requested reviewers API, I think we can use events API, it includes review_requested event and has a timestamp.

@EtherealGlow
Copy link
Contributor Author

Ohhh that makes it easy

src/helpers/issue.ts Outdated Show resolved Hide resolved
src/utils/private.ts Outdated Show resolved Hide resolved
src/helpers/issue.ts Outdated Show resolved Hide resolved
src/helpers/issue.ts Outdated Show resolved Hide resolved
src/helpers/issue.ts Outdated Show resolved Hide resolved
src/handlers/wildcard/unassign.ts Outdated Show resolved Hide resolved
src/handlers/wildcard/unassign.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@wannacfuture wannacfuture left a comment

Choose a reason for hiding this comment

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

@EtherealGlow

Please make sure if the code runs successfully for the related issue. Not so sure but seems you are hardcoding - not trying to run the bot and test it.

You will be needed to post a QA for every PRs.

EtherealGlow and others added 2 commits October 12, 2023 15:52
Co-authored-by: whilefoo <139262667+whilefoo@users.noreply.github.com>
@EtherealGlow
Copy link
Contributor Author

i am tired of this bot 😢
UbiquiBot Error: Invalid repo config: data must NOT have additional properties. Unnecessary properties: evmNetworkId undefined error ubiquibot EtherealGlow 1761727853 25

@EtherealGlow
Copy link
Contributor Author

src/helpers/issue.ts Outdated Show resolved Hide resolved
@EtherealGlow
Copy link
Contributor Author

Any idea why the bot might not be working, the config is right

@whilefoo
Copy link
Collaborator

@EtherealGlow can you link me your config?

@EtherealGlow
Copy link
Contributor Author

@whilefoo
Copy link
Collaborator

can you try running the bot with latest development branch and check if the issue is still present?

@EtherealGlow
Copy link
Contributor Author

EtherealGlow commented Oct 20, 2023

wait just a day or two this is almost done

@EtherealGlow
Copy link
Contributor Author

uhhh what

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants