From 9669f028261ad5c4036c8fb3d6bf477589536618 Mon Sep 17 00:00:00 2001 From: Danathar <6772335+Danathar@users.noreply.github.com> Date: Tue, 17 Nov 2026 17:21:54 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20contribute:=20an=20unverified=20?= =?UTF-8?q?already-done=20verdict=20no=20longer=20leaves=20the=20label=20o?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The relay applied hive/already-done on reason text alone; the hub then commented that nothing could be verified and the issue is not labelled, but left the relay's label on (projectbluefin/utah-packages#1175). Relay: markIssueAlreadyDone labels only when the reason cites a PR, a PR URL or a commit. Hub: the unverified path removes a hive/already-done the hive added since the task was dispatched; a person's label stays. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 --- bin/contributor-relay.js | 17 +++++ bin/contributor-relay.test.js | 32 ++++++++ .../fixed-relay-already-done-unverified.md | 1 + src/docs/contributor-relay.md | 2 +- src/pkg/dashboard/contribute_ledgers.go | 13 +++- .../contribute_ledgers_reason_test.go | 3 +- .../dashboard/contribute_verdict_settle.go | 43 +++++++++-- ...contribute_verdict_settle_ghclient_test.go | 74 ++++++++++++++++++- src/pkg/github/done_verdict_labels.go | 53 +++++++++++++ 9 files changed, 226 insertions(+), 12 deletions(-) create mode 100644 changelog.d/fixed-relay-already-done-unverified.md diff --git a/bin/contributor-relay.js b/bin/contributor-relay.js index 7a209dbc51..24498b2e4e 100755 --- a/bin/contributor-relay.js +++ b/bin/contributor-relay.js @@ -6985,6 +6985,17 @@ function alreadyDoneVerdictFields(reason) { }; } +// alreadyDoneCitesRef says whether an already-done reason names something the +// hub can verify: the structured evidence (a merged PR or a commit SHA), a +// bare `#N`, or a pull-request URL. "Already resolved" alone cites nothing, +// and the hub then refuses the label ("cited no PR or commit the hive could +// verify"), so the relay must not have applied it (utah-packages#1175). +function alreadyDoneCitesRef(reason) { + const evidence = alreadyDoneVerdictFields(reason).evidence; + if (evidence && (evidence.pr > 0 || evidence.commit)) return true; + return /(?:^|[^\w&])#\d+\b|\/pull\/\d+\b/.test(String(reason || '')); +} + function isAlreadyDoneNoWork(noWork) { if (!noWork || noWork.verdict !== HIVE_VERDICT_NO_WORK) return false; return alreadyDoneVerdictFields(noWork.reason).verdict_reason_kind === ALREADY_DONE_REASON_KIND; @@ -8663,6 +8674,12 @@ function readOpenSubIssues(task, env) { function markIssueAlreadyDone(task, reason) { if (!task || task.kind !== 'issue' || !task.repo || !(task.number > 0) || task.external_id) return; + // The label means verified done. With no PR or commit cited there is + // nothing to verify: the hub comments and books its own hold instead. + if (!alreadyDoneCitesRef(reason)) { + console.log(`Task ${task.task_id}: already-done verdict on ${task.repo}#${task.number} cites no PR or commit — not applying the '${ALREADY_DONE_WORKFLOW_LABEL}' label; the hub verifies a citation before labelling and holds the issue without one`); + return; + } const hub = task._hub || hubs[activeHubIndex]; if (!hubGrantsIssuesWrite(hub)) { console.log(`Task ${task.task_id}: already-done verdict on ${task.repo}#${task.number}, but the task credential does not carry issues:write — leaving the '${ALREADY_DONE_WORKFLOW_LABEL}' label to the hub or a human; the hub's already-done hold suppresses re-offer (#8477)`); diff --git a/bin/contributor-relay.test.js b/bin/contributor-relay.test.js index 4df32ce910..2a6213d740 100644 --- a/bin/contributor-relay.test.js +++ b/bin/contributor-relay.test.js @@ -16797,6 +16797,38 @@ test('already-done label is applied as before when the issue has no sub-issues o } }); +// projectbluefin/utah-packages#1175: "already resolved" with no PR or commit +// is a claim the hub refuses to label, so the relay must not label it either. +test('already-done label is not applied when the reason cites no PR or commit', () => { + const relay = loadRelay({}); + const log = console.log; const logged = []; console.log = (...a) => logged.push(a.join(' ')); + try { + relay.handleMessage(JSON.stringify({ type: 'auth_ok', contributor_id: 'c1', trust_tier: 'contributor', permissions: ['issues:write'] })); + const before = relay.__commands.length; + relay.markIssueAlreadyDone({ task_id: 't', kind: 'issue', repo: 'foo/bar', number: 7 }, 'external mirror outage already resolved (HTTP 200)'); + const after = relay.__commands.slice(before); + assert.strictEqual(after.filter(c => /gh /.test(c)).length, 0, + `no read and no label without a citation: ${JSON.stringify(after)}`); + assert.strictEqual(logged.filter(l => /cites no PR or commit/.test(l) && /not applying the 'hive\/already-done' label/.test(l)).length, 1, + `expected one line saying why, got ${JSON.stringify(logged)}`); + } finally { console.log = log; teardown(relay); } +}); + +test('already-done label is still applied when the reason cites a commit or a merged PR', () => { + for (const reason of ['already fixed by commit e6d3de3', 'merged PR #532 already resolves this', 'already fixed in https://github.com/foo/bar/pull/532']) { + const relay = loadRelay({}); + const log = console.log; console.log = () => {}; + try { + relay.handleMessage(JSON.stringify({ type: 'auth_ok', contributor_id: 'c1', trust_tier: 'contributor', permissions: ['issues:write'] })); + const before = relay.__commands.length; + relay.markIssueAlreadyDone({ task_id: 't', kind: 'issue', repo: 'foo/bar', number: 7 }, reason); + const after = relay.__commands.slice(before); + assert.strictEqual(after.filter(c => /gh issue edit/.test(c) && c.includes('--add-label') && c.includes('hive/already-done')).length, 1, + `${reason} must still label: ${JSON.stringify(after)}`); + } finally { console.log = log; teardown(relay); } + } +}); + test('already-done label is not applied when the sub-issue read fails', () => { const relay = loadRelay({ subIssuesSummary: new Error('Command failed: gh api') }); const log = console.log; const logged = []; console.log = (...a) => logged.push(a.join(' ')); diff --git a/changelog.d/fixed-relay-already-done-unverified.md b/changelog.d/fixed-relay-already-done-unverified.md new file mode 100644 index 0000000000..5b6b4f393e --- /dev/null +++ b/changelog.d/fixed-relay-already-done-unverified.md @@ -0,0 +1 @@ +- **An unverified "already done" verdict no longer leaves `hive/already-done` on the issue.** The contributor relay applied the label on reason text alone ("already resolved"), and seconds later the hub commented that the issue "is not labelled `hive/already-done`" because nothing could be verified, leaving the label on, so the issue dropped out of the offer queue with no maintainer check (projectbluefin/utah-packages#1175). The relay now labels only when the reason cites a PR, a PR URL or a commit, and when the citation does not verify the hub removes a label the hive added since the task was dispatched; a label a person added stays. diff --git a/src/docs/contributor-relay.md b/src/docs/contributor-relay.md index 6f299104bf..49f931df86 100644 --- a/src/docs/contributor-relay.md +++ b/src/docs/contributor-relay.md @@ -1223,7 +1223,7 @@ After a contributor completes an issue, the hub keeps that issue out of the queu |---|---|---| | **Cooldown** | `contribute_cooldown_enabled` | Toggles the post-completion cooldown. Absent (older config) or `true` means enabled; an explicit `false` disables it, so no completed issue is ever excluded for cooldown. Failure quarantine is separate and stays on either way. | | **Cooldown Hours** | `contribute_cooldown_hours` | Length of the with-PR completion cooldown in hours. `0` or unset means the default of `168` (one week); any positive value is clamped to `1`-`8760`. The short no-PR cooldown is fixed and not tuned here; it ends early when the issue's author answers a question the contributor asked during that task (see [The issue author's answer ends the no-PR cooldown](#the-issue-authors-answer-ends-the-no-pr-cooldown)). | -| **Already-done label** | `contribute_already_done_label` | Label applied when a `no_work_needed` verdict is marked `verdict_reason_kind: "already_done"` (or legacy text such as `merged PR #123 already resolves this`) and the cited PR verifies as merged. A verdict with no cited PR/commit, or one that fails verification, never gets this label, and neither does an issue that has open sub-issues: the relay reads the issue's `sub_issues_summary` with the task credential before it labels and skips the label when a sub-issue is open or the read fails, and the hub checks again before it labels or closes. Default `hive/already-done`, which is also in the default contribute skip labels so it stays out of the offer queue until a maintainer removes it. | +| **Already-done label** | `contribute_already_done_label` | Label applied when a `no_work_needed` verdict is marked `verdict_reason_kind: "already_done"` (or legacy text such as `merged PR #123 already resolves this`) and the cited PR verifies as merged. A verdict with no cited PR/commit, or one that fails verification, never gets this label: the relay does not apply it when the reason cites no PR, PR URL or commit, and when verification fails the hub removes one the hive added since the task was dispatched (a label a person added stays). Neither does an issue that has open sub-issues: the relay reads the issue's `sub_issues_summary` with the task credential before it labels and skips the label when a sub-issue is open or the read fails, and the hub checks again before it labels or closes. Default `hive/already-done`, which is also in the default contribute skip labels so it stays out of the offer queue until a maintainer removes it. | | **Close already done** | `contribute_close_already_done` | Deprecated compatibility key; verified already-done PR evidence now runs the normal issue close path without this toggle. Human-filed bug-family issues close by default; add `hive: needs-confirmation` or enable `issues.reporter_confirmation` only when reporter verification is required. | | **Already-done hold** | `contribute_already_done_hold_days` | Days to suppress re-offer when an already-done verdict cites no PR/commit or evidence the hub cannot verify (the hold is the only suppression then; newer issue activity lifts it sooner). Default `30`; valid non-zero values are clamped to `1`-`365`. | diff --git a/src/pkg/dashboard/contribute_ledgers.go b/src/pkg/dashboard/contribute_ledgers.go index afa1890a92..75ccdb03ce 100644 --- a/src/pkg/dashboard/contribute_ledgers.go +++ b/src/pkg/dashboard/contribute_ledgers.go @@ -781,14 +781,21 @@ func (h *ContributeWSHub) markTaskCompletedVerdict(repo string, number int, prUR // evidence; it is a contributor skip label, so on an unverified claim it kept // unfinished work out of the queue until a maintainer noticed // (projectbluefin/chairlift#591, fixed later by chairlift#626). -func (h *ContributeWSHub) markAlreadyDoneUnverified(repo string, number int, reporter, reason string, evidence *VerdictEvidence) { +// +// A contributor relay may already have put the label on with the task +// credential (projectbluefin/utah-packages#1175: labelled at 11:49:55, the +// "not labelled" comment at 11:50:11, the label left on). The hub takes off a +// label the hive added since dispatchedAt; one a person added stays. +func (h *ContributeWSHub) markAlreadyDoneUnverified(repo string, number int, reporter, reason string, evidence *VerdictEvidence, dispatchedAt time.Time) { if h == nil || repo == "" || number <= 0 { return } reason = truncateReasonBytes(reason) hold := h.configuredAlreadyDoneUnverifiedHold() - // The comment goes out before the hold is booked so the hive's own - // comment does not count as newer issue activity that lifts the hold. + // The label removal and the comment go out before the hold is booked so + // the hive's own activity does not count as newer issue activity that + // lifts the hold. + h.removeUnverifiedAlreadyDoneLabel(repo, number, dispatchedAt) if err := h.noteAlreadyDoneUnverified(context.Background(), repo, number, reporter, hold); err != nil && h.logger != nil && err != ghpkg.ErrNoGitHubClient { h.logger.Warn("[contribute-ws] unverified already-done verdict comment failed", "repo", repo, "number", number, "error", err.Error()) diff --git a/src/pkg/dashboard/contribute_ledgers_reason_test.go b/src/pkg/dashboard/contribute_ledgers_reason_test.go index 94f54a5b66..1ed8e4203b 100644 --- a/src/pkg/dashboard/contribute_ledgers_reason_test.go +++ b/src/pkg/dashboard/contribute_ledgers_reason_test.go @@ -4,6 +4,7 @@ import ( "fmt" "strings" "testing" + "time" "unicode/utf8" ) @@ -45,7 +46,7 @@ func TestVerdictLedgerReasonTruncation(t *testing.T) { t.Run(tc.name, func(t *testing.T) { hub := ledgerHub(t.TempDir()) if path == "already_done_unverified" { - hub.markAlreadyDoneUnverified("o/r", 13110, "reporter", tc.in, nil) + hub.markAlreadyDoneUnverified("o/r", 13110, "reporter", tc.in, nil, time.Time{}) } else { hub.markTaskCompletedVerdict("o/r", 13110, "", path, "reporter", tc.in) } diff --git a/src/pkg/dashboard/contribute_verdict_settle.go b/src/pkg/dashboard/contribute_verdict_settle.go index 6e641f8cd1..6b8df2711e 100644 --- a/src/pkg/dashboard/contribute_verdict_settle.go +++ b/src/pkg/dashboard/contribute_verdict_settle.go @@ -74,14 +74,14 @@ func (h *ContributeWSHub) settleIssueFromVerdictWithEvidence(repo string, number } if len(refs) == 0 { if alreadyDone { - h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence) + h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence, dispatchedAt) return verdictDispositionAlreadyDoneUnverified } return "" } if h.server == nil || h.server.deps == nil || h.server.deps.RecordIssueClaim == nil { if alreadyDone { - h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence) + h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence, dispatchedAt) return verdictDispositionAlreadyDoneUnverified } return "" @@ -90,7 +90,7 @@ func (h *ContributeWSHub) settleIssueFromVerdictWithEvidence(repo string, number if verify == nil { if h.server.deps.GHClient == nil { if alreadyDone { - h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence) + h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence, dispatchedAt) return verdictDispositionAlreadyDoneUnverified } return "" @@ -110,7 +110,7 @@ func (h *ContributeWSHub) settleIssueFromVerdictWithEvidence(repo string, number "repo", repo, "number", number, "ref", ref.String(), "reason", res.Reason, "error", err.Error()) if ctx.Err() != nil { if alreadyDone { - h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence) + h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence, dispatchedAt) return verdictDispositionAlreadyDoneUnverified } return "" @@ -181,7 +181,7 @@ func (h *ContributeWSHub) settleIssueFromVerdictWithEvidence(repo string, number return "" } if alreadyDone { - h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence) + h.markAlreadyDoneUnverified(repo, number, reporter, reason, evidence, dispatchedAt) return verdictDispositionAlreadyDoneUnverified } return "" @@ -239,6 +239,39 @@ func (h *ContributeWSHub) markIssuePRClaim(ctx context.Context, repo string, num return h.server.deps.GHClient.AddLabels(ctx, repo, number, []string{label}) } +// removeUnverifiedAlreadyDoneLabel takes the already-done label off an issue +// whose verdict did not verify, when the hive itself added it after the task +// was dispatched (a relay labelling on the task credential). Best-effort: a +// failure is logged and the comment and hold still go out. +func (h *ContributeWSHub) removeUnverifiedAlreadyDoneLabel(repo string, number int, dispatchedAt time.Time) { + if h == nil || h.server == nil || h.server.deps == nil || h.server.deps.GHClient == nil { + return + } + label := config.HubConfig{}.ContributeAlreadyDoneLabelOrDefault() + if h.server.deps.Config != nil { + label = h.server.deps.Config.Hub.ContributeAlreadyDoneLabelOrDefault() + } + ctx := h.server.deps.Ctx + if ctx == nil { + ctx = context.Background() + } + ctx, cancel := context.WithTimeout(ctx, verdictSettleTimeout) + defer cancel() + removed, err := h.server.deps.GHClient.RemoveHiveLabelAddedSince(ctx, repo, number, label, dispatchedAt) + if h.logger == nil { + return + } + if err != nil { + h.logger.Warn("[contribute-ws] removing the relay's unverified already-done label failed", + "repo", repo, "number", number, "label", label, "error", err.Error()) + return + } + if removed { + h.logger.Info("[contribute-ws] removed the already-done label the relay applied to an unverified verdict", + "repo", repo, "number", number, "label", label) + } +} + // noteAlreadyDoneUnverified posts the claim-worded comment for an already-done // verdict with no verifiable evidence. It applies no label: the already-done // label means verified, and hive/likely-done means an API-verified merged PR diff --git a/src/pkg/dashboard/contribute_verdict_settle_ghclient_test.go b/src/pkg/dashboard/contribute_verdict_settle_ghclient_test.go index 0d0820fc9b..484e1c3d9f 100644 --- a/src/pkg/dashboard/contribute_verdict_settle_ghclient_test.go +++ b/src/pkg/dashboard/contribute_verdict_settle_ghclient_test.go @@ -36,6 +36,7 @@ type settleGHFixture struct { commentsListErr bool issueLabels []string labelsRemoved []string + issueEvents []map[string]any } func (f *settleGHFixture) server(t *testing.T) *httptest.Server { @@ -93,6 +94,12 @@ func (f *settleGHFixture) server(t *testing.T) *httptest.Server { "user": map[string]any{"login": "hive-bot", "type": "Bot"}, "labels": labels, }) + case r.Method == http.MethodGet && r.URL.Path == "/repos/o/r/issues/7/events": + events := f.issueEvents + if events == nil { + events = []map[string]any{} + } + _ = json.NewEncoder(w).Encode(events) case r.Method == http.MethodPatch && r.URL.Path == "/repos/o/r/issues/7": var payload struct { State string `json:"state"` @@ -397,7 +404,7 @@ func TestVerdictSettleGH_UnverifiedAlreadyDone_ExistingCommentIsNotReposted(t *t fx := &settleGHFixture{} hub, _ := settleGHHub(t, fx) - hub.markAlreadyDoneUnverified("o/r", 7, "ct", "already fixed upstream", nil) + hub.markAlreadyDoneUnverified("o/r", 7, "ct", "already fixed upstream", nil, time.Time{}) fx.mu.Lock() if len(fx.comments) != 1 { fx.mu.Unlock() @@ -407,7 +414,7 @@ func TestVerdictSettleGH_UnverifiedAlreadyDone_ExistingCommentIsNotReposted(t *t fx.comments = nil fx.mu.Unlock() - hub.markAlreadyDoneUnverified("o/r", 7, "ct", "already fixed upstream", nil) + hub.markAlreadyDoneUnverified("o/r", 7, "ct", "already fixed upstream", nil, time.Time{}) fx.mu.Lock() defer fx.mu.Unlock() if len(fx.comments) != 0 { @@ -547,3 +554,66 @@ func TestVerdictSettleGH_MarkAlreadyDone_RemovesVerifiedOpen(t *testing.T) { t.Fatalf("labels removed = %v, want hive/verified-open", fx.labelsRemoved) } } + +// projectbluefin/utah-packages#1175: the relay labelled the issue +// hive/already-done on "already resolved" alone, then the hub commented "not +// labelled" and left the label on. The unverified path now takes off a label +// the hive added since dispatch, and keeps one a person added or one the hive +// added before this task. +func TestVerdictSettleGH_UnverifiedAlreadyDoneRemovesTheRelayLabel(t *testing.T) { + dispatched := time.Now().Add(-3 * time.Minute) + labeled := func(actor string, at time.Time) map[string]any { + return map[string]any{ + "id": 1, "event": "labeled", "created_at": at.UTC().Format(time.RFC3339), + "actor": map[string]any{"login": actor}, + "label": map[string]any{"name": "hive/already-done"}, + } + } + for _, tc := range []struct { + name string + events []map[string]any + wantRemoved bool + }{ + {name: "hive App label after dispatch is removed", events: []map[string]any{labeled("hive-app[bot]", dispatched.Add(time.Minute))}, wantRemoved: true}, + {name: "a person's label stays", events: []map[string]any{labeled("maintainer", dispatched.Add(time.Minute))}}, + {name: "hive label from before this task stays", events: []map[string]any{labeled("hive-app[bot]", dispatched.Add(-time.Hour))}}, + {name: "a person relabelled after the hive", events: []map[string]any{labeled("hive-app[bot]", dispatched.Add(time.Minute)), labeled("maintainer", dispatched.Add(2*time.Minute))}}, + } { + t.Run(tc.name, func(t *testing.T) { + fx := &settleGHFixture{issueLabels: []string{"kind/bug", "hive/already-done"}, issueEvents: tc.events} + hub, s := settleGHHub(t, fx) + s.deps.GHClient.SetAppBotLogin("hive-app[bot]") + + got := hub.settleIssueFromVerdictWithEvidence("o/r", 7, "external mirror outage already resolved (HTTP 200)", "already_done", nil, dispatched, "kylerankin") + if got != verdictDispositionAlreadyDoneUnverified { + t.Fatalf("disposition = %q, want unverified", got) + } + fx.mu.Lock() + defer fx.mu.Unlock() + removed := len(fx.labelsRemoved) == 1 && fx.labelsRemoved[0] == "hive/already-done" + if removed != tc.wantRemoved { + t.Fatalf("labelsRemoved = %v, want removed=%v", fx.labelsRemoved, tc.wantRemoved) + } + if len(fx.comments) != 1 || !strings.Contains(fx.comments[0], "not labelled `hive/already-done`") { + t.Fatalf("comments = %v, want the unverified comment", fx.comments) + } + if len(fx.labelsAdded) != 0 { + t.Fatalf("unverified claim must not label: %v", fx.labelsAdded) + } + }) + } +} + +// Without a dispatch time the hub cannot tell this task's label from an older +// one, so it reads nothing and removes nothing. +func TestVerdictSettleGH_UnverifiedAlreadyDoneWithoutDispatchTimeKeepsLabel(t *testing.T) { + fx := &settleGHFixture{issueLabels: []string{"hive/already-done"}} + hub, s := settleGHHub(t, fx) + s.deps.GHClient.SetAppBotLogin("hive-app[bot]") + hub.markAlreadyDoneUnverified("o/r", 7, "ct", "already fixed upstream", nil, time.Time{}) + fx.mu.Lock() + defer fx.mu.Unlock() + if len(fx.labelsRemoved) != 0 { + t.Fatalf("labelsRemoved = %v, want none", fx.labelsRemoved) + } +} diff --git a/src/pkg/github/done_verdict_labels.go b/src/pkg/github/done_verdict_labels.go index df3442c299..f1dae2050e 100644 --- a/src/pkg/github/done_verdict_labels.go +++ b/src/pkg/github/done_verdict_labels.go @@ -82,3 +82,56 @@ func (c *Client) latestLabeledAt(ctx context.Context, owner, name string, number opts.Page = resp.NextPage } } + +// RemoveHiveLabelAddedSince takes label off the issue when the hive itself +// (IsHiveAuthorLogin) added it at or after since: the label a contributor +// relay applied on the task credential for the verdict the caller just +// refused. A label a person added, one the hive added before since, or any +// label at all when since is zero or no hive identity is configured, stays. +// It reads the issue's events only when the issue wears the label. Returns +// whether it removed the label. +func (c *Client) RemoveHiveLabelAddedSince(ctx context.Context, repo string, number int, label string, since time.Time) (bool, error) { + if c == nil || c.client == nil || since.IsZero() || strings.TrimSpace(label) == "" { + return false, nil + } + owner, name := c.splitRepo(repo) + issue, _, err := c.client.Issues.Get(ctx, owner, name, number) + if err != nil { + return false, err + } + on := false + for _, l := range issue.Labels { + if strings.EqualFold(l.GetName(), label) { + on = true + break + } + } + if !on { + return false, nil + } + var at time.Time + var actor string + opts := &gh.ListOptions{PerPage: 100} + for { + events, resp, err := c.client.Issues.ListIssueEvents(ctx, owner, name, number, opts) + if err != nil { + return false, err + } + for _, ev := range events { + if ev.GetEvent() == "labeled" && strings.EqualFold(ev.GetLabel().GetName(), label) && !ev.GetCreatedAt().Time.Before(at) { + at, actor = ev.GetCreatedAt().Time, ev.GetActor().GetLogin() + } + } + if resp == nil || resp.NextPage == 0 { + break + } + opts.Page = resp.NextPage + } + if at.IsZero() || at.Before(since) || !c.IsHiveAuthorLogin(actor) { + return false, nil + } + if err := c.RemoveLabelsFresh(ctx, repo, number, label); err != nil { // writeback:solicited the hub refused the contributor's unverified already-done verdict + return false, err + } + return true, nil +}