fix: add PR context to mirror linked-issue skip warnings#838
Open
polyjeff529 wants to merge 1 commit intoentrius:testfrom
Open
fix: add PR context to mirror linked-issue skip warnings#838polyjeff529 wants to merge 1 commit intoentrius:testfrom
polyjeff529 wants to merge 1 commit intoentrius:testfrom
Conversation
polyjeff529
commented
Apr 28, 2026
The eight ``bt.logging.warning`` calls in ``_is_valid_linked_issue`` (``gittensor/validator/oss_contributions/mirror/scoring.py``) log only the issue number when an issue is skipped from the multiplier calculation. In a noisy multi-miner round dozens of issues from unrelated PRs may all skip on the same condition (e.g. ``self-issue`` or ``closed too far from merge``), making it impossible to trace a single skip back to its PR without grepping the surrounding ``_calculate_issue_multiplier`` log line and reconstructing the order. Same observability shape as the recently merged PR entrius#711 ("fix: add PR number context to file-content fetch failure warning"): extend each warning with ``PR #{pr_number} in {repo_full_name}`` context derived once at function entry. No behaviour change — the gate decisions and return values are identical, only the log surface gains the context. Adds ``TestLinkedIssueSkipWarningsCarryPRContext`` covering three of the eight skip paths (transferred, self-issue, close-window) with a shared helper that asserts both the PR number and repo are present. The remaining five paths share the same ``pr_ctx`` string format, so covering them all would be redundant. The legacy ``is_valid_issue`` in ``gittensor/validator/oss_contributions/scoring.py`` has the same observability gap; not bundled here so the diff stays narrowly scoped to the mirror addition introduced in PR entrius#796 — happy to follow up with a parity PR if the team wants both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.