feat(miner): exclude discover candidates assigned to the repo owner - #7042
Merged
Conversation
Closes #7040, a follow-up to #6798/#7024: that PR candidly scoped out assignee-exclusion (candidate objects flowing through discover carried label names but not assignees, and threading them through was flagged as "a genuine second shared-file change"). This does that threading and adds the check. Extends RawCandidateIssue with `assignees` (already present in the same GitHub list/search payload discover already fetches -- no extra request), and adds a new `excluded_assignee` reason to contribution-profile-filter.js for a candidate assigned to its own repo's owner login. Unlike the three label-based rules, this check is structural and always-on -- per the schema (ContributionAssigneeRuntimeCheck), assignee-exclusion is deliberately not a profile field, so it runs ahead of (and independent of) the existing eligibilityLabels.confidence === "explicit" safe-default gate that the label rules are conditioned on. It applies regardless of whether the repo has a trustworthy ContributionProfile at all.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7042 +/- ##
=======================================
Coverage 93.74% 93.75%
=======================================
Files 692 692
Lines 68740 68752 +12
Branches 18768 18768
=======================================
+ Hits 64443 64455 +12
Misses 3302 3302
Partials 995 995
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Summary
assigneesthrough the fan-out was "a genuine second shared-file change." This does that threading and adds the check.RawCandidateIssuewithassignees— already present in the same GitHub list/search payloaddiscoveralready fetches, no extra request.excluded_assigneereason tocontribution-profile-filter.jsfor a candidate assigned to its own repo's owner login.Design note
Unlike the three label-based rules, this check is structural and always-on — per the schema (
ContributionAssigneeRuntimeCheck), assignee-exclusion is deliberately not a profile field, so it runs ahead of (and independent of) the existingeligibilityLabels.confidence === "explicit"safe-default gate the label rules are conditioned on. It applies regardless of whether the repo has a trustworthyContributionProfileat all — tested explicitly (a candidate assigned to the repo owner is excluded even with no profile in the map).Test plan
npm run typecheck— clean.npm run test:coverage(full, unsharded) — 979 files / 18322 tests passed, 0 failures.contribution-profile-filter.test.ts(excludes owner-assigned, case-insensitive match, doesn't exclude other assignees, applies with no profile, applies with low-confidence profile, tolerates missing owner/assignees, ignores malformed assignee entries) + 2 integration tests inminer-discover-cli.test.ts(excluded from ranking/enqueueing end-to-end, applies without a profile).contribution-profile-filter.test.tstests pass unchanged (the new check is purely additive; candidates withoutowner/assigneesare never affected).