Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions gittensor/utils/mirror/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class MirrorLinkedIssue:
updated_at: Optional[datetime]
is_transferred: bool
solved_by_pr: Optional[int]
repository_full_name: Optional[str] = None
labels: List[MirrorLabel] = field(default_factory=list)

@classmethod
Expand All @@ -106,6 +107,7 @@ def from_dict(cls, data: dict) -> 'MirrorLinkedIssue':
updated_at=parse_optional_github_iso_to_utc(data.get('updated_at')),
is_transferred=bool(data.get('is_transferred', False)),
solved_by_pr=data.get('solved_by_pr'),
repository_full_name=data.get('repository_full_name'),
labels=[MirrorLabel.from_dict(label) for label in data.get('labels') or []],
)

Expand Down
7 changes: 7 additions & 0 deletions gittensor/validator/oss_contributions/mirror/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,13 @@ def _is_valid_linked_issue(li: MirrorLinkedIssue, pr: MirrorPullRequest) -> bool
bt.logging.warning(f'Skipping linked issue #{li.number} - transferred')
return False

if li.repository_full_name and li.repository_full_name.lower() != pr.repo_full_name.lower():
bt.logging.warning(
f'Skipping linked issue #{li.number} - cross-repo reference '
f'({li.repository_full_name} != {pr.repo_full_name})'
)
return False

if li.author_github_id is None:
bt.logging.warning(f'Skipping linked issue #{li.number} - missing author_github_id')
return False
Expand Down
Loading