alejandro5042 / azdo-userscripts

A collection of userscripts to improve the Azure DevOps UI
https://alejandro5042.github.io/azdo-userscripts/
MIT License
40 stars 23 forks source link

Generated dashboard tags for PR group assignment status #178

Open gregr-ni opened 2 years ago

gregr-ni commented 2 years ago

Problem

The Required tag on the PR dashboard works great for individuals. It would be great to have similar functionality for the group case. When a group is assigned as a reviewer, I can create a dashboard section to show PRs assigned to that group. The problem is that the section does not distinguish between PRs that have already been approved by someone in the group and PRs that have not. As a representative of the group, I can’t tell which ones still need action from me and which ones don’t.

Proposed solution

Generate a "Required" tag when a PR requires a group that the user is in and no one in that group has approved.

alejandro5042 commented 2 years ago

Thank you for this suggestion! The problem and proposed solution make total sense.

The implementation wouldn't be too hard, yet would require at least one API call to determine if the user is in a group that hasn't voted, per group. Since groups can contain other groups, it could be many more. This could make the page really slow, especially if you are in a network starved location. Or maybe not -- it depends on how many PRs/groups/sections you have. Not against doing it though to find out. And we can also cache calls for a short time.

Since you noted to me internally that you are waiting to see if it is a problem, once you confirm it would be useful, I'll put it on the docket to implement next.

gregr-ni commented 2 years ago

I think it is likely to be a problem.

We don't necessarily need to know membership if we can know the group in a different way. What I care about is sections configured to show PRs assigned to a specific group. I don't see any easy way from the info in the page to detect that. Is there a straightforward way to get that?

If we can't deduce it, we could require the user to help by using a specific format for the section title. We could define a format like "Assigned to Group Name" or "{Group Name}" in the title to provide the group name. Then we could ignore membership and just generate a tag based on whether that group is satisfied or not. To make this distinct from the "Required" tag we could use the group name as the tag. It could be red for still needed and green or not present if already satisfied.