Skip to content

KeyError: 'is_trusted_bot' #5783

@suhaibmujahid

Description

@suhaibmujahid

The test failures stem from #5780 being based on an older revision — it didn't account for the changes introduced in #5768.

https://community-tc.services.mozilla.com/tasks/MN7biFK5TO-iiiL0MHFaNw/runs/0/logs/public/logs/live.log:

        Args:
            comments: List of comment objects (sorted by date)
            users_info: Dictionary mapping PHIDs to user info with trust status
    
        Returns:
            Tuple of (sanitized_comments, filtered_count)
        """
        from copy import copy
    
        # Walk backwards to find last trusted comment (from MOCO)
        last_trusted_index = -1
        for i in range(len(comments) - 1, -1, -1):
            comment_is_trusted = users_info.get(comments[i].author_phid, {}).get(
                "is_trusted", False
            )
            if comment_is_trusted:
                last_trusted_index = i
                break
    
        # Process comments and apply filtering
        filtered_count = 0
        sanitized_comments = []
    
        for i, comment in enumerate(comments):
            author = users_info.get(comment.author_phid)
            comment_is_trusted = author and (
>               author["is_trusted"] or author["is_trusted_bot"]
                                        ^^^^^^^^^^^^^^^^^^^^^^^^
            )
E           KeyError: 'is_trusted_bot'
/bugbug/bugbug/tools/core/platforms/phabricator.py:180: KeyError

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions