Skip to content
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

Fix checking maintainers for teams #1932

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,24 @@ def run_conda_forge_specific(meta, recipe_dir, lints, hints):
# Check if all maintainers have either commented or are the PR author
Copy link
Member

@jaimergp jaimergp May 17, 2024

Choose a reason for hiding this comment

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

Seeing this code now, I wonder if we should also get the emoji reactions in the comments Sometimes folks just leave a 👍 as the confirmation.

I think this could work (for the block above):

commenters.update(
    {
        reaction.user.login 
        for comment in issue_comments
        for reaction in issue.get_reactions()
        if reaction.content in ("+1", "heart", "rocket", "hooray")
    }
)

Refs:

Copy link
Member

Choose a reason for hiding this comment

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

I think that's a good idea! My memory is a little vague but I think the problem during implementation was that these features weren't available yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jaimergp do you mind sending a PR?

non_participating_maintainers = set()
for maintainer in maintainers:
if maintainer not in commenters and maintainer != pr_author:
if "/" in maintainer:
team_org, team_name = maintainer.split("/")
if team_org == "conda-forge":
team_maintainers = list(
gh.get_organization(team_org)
.get_team_by_slug(team_name)
.get_members()
)
if any(
team_maintainer in commenters
or team_maintainer == pr_author
for team_maintainer in team_maintainers
):
continue
non_participating_maintainers.add(maintainer)
else:
if maintainer not in commenters and maintainer != pr_author:
non_participating_maintainers.add(maintainer)

# Add a lint message if there are any non-participating maintainers
if non_participating_maintainers:
Expand Down
Loading