Repository navigation
Conversation
…as an unconfigured login The un-park sweep only believes a hive:unpark-reply / hive:label-approval marker when the comment's author is one of the hive's own accounts (markerAuthorTrusted, #11313). An App installed under its own slug with no github.app_slug set falls back to the public default slug, so the hive's real <slug>[bot] login was never among those accounts: every sweep saw the command as unanswered and replied again. A live tuna-os hive posted 320+ identical replies on each of four issues (40-58 a day) this way. Record the author GitHub returns when the client creates an un-park reply, notice or label-approval comment. That author is by definition the account the token posts as, so isHiveAccount now matches it through the existing cachedSelfLogin check. A marker pasted by any other account still does not count. Signed-off-by: James Reilly <jreilly1821@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
Mutation testing (advisory)No surviving mutants in changed files (or the run hit its time budget before reporting any). Advisory only; this job never blocks the PR (#17349). |
Summary
/hivecommand on every sweep when the hive posts as a GitHub login its configured identity doesn't name.answeredUnparkCommentIDscounts ahive:unpark-replymarker only whenmarkerAuthorTrustedaccepts the comment's author ([RFC] [v5] Prow compatible mode: let an organisation's acceptance label (triage/accepted) approve work for Hive #11313).github.app_slugset, falls back toDefaultGitHubAppSlug(hivecommons-hive). Because the identity names that slug,knowsOwnAccounts()is true.<slug>[bot]login is never in the identity, so each sweep sees its own reply as untrusted, treats the command as unanswered and replies again.learnSelfLoginrecords the author GitHub returns when the client creates an un-park reply, a notice or a label-approval comment. That author is the account the token posts as.isHiveAccountalready acceptscachedSelfLogin(), so the hive's own markers count from the next sweep on, for every marker reader that goes throughmarkerAuthorTrusted.Evidence from a live hive (tuna-os)
The hive's own replies all carry the same marker,
id=6582313529, which points at the one maintainer comment it keeps answering:On v6 the repeated reply is the
project.ai_authorrefusal (renderUnparkAIAuthorRefusal). The trust check that loops is the same on v5, where/hive helpshows it (see test).Related issues
Refs #11313
Testing
TestSweepIssueUnparkCommandsAnswersOnceWhenPostingAsUnconfiguredLogin:postAuthor) different from the configuredAppLogin; the test runs three sweeps.v5:command 11 answered 3 times over 3 sweeps, want once. Passes with the fix.go test ./pkg/github/... -count=1passes (pkg/github,automerge,requestwatch). The pasted-marker invariants inlabel_approval_test.go(A13) still pass.go build ./...,go vet ./pkg/github/andgofmtare clean.check-changelog-fragment.shreports OK.Limits
GET /appat boot would close that gap; I kept this PR minimal.GET /userfails used to trust markers from any author. Once it has posted, it now trusts only its own markers, which is the [RFC] [v5] Prow compatible mode: let an organisation's acceptance label (triage/accepted) approve work for Hive #11313 intent.v6-topup, since v6 carries the samepostUnparkReplyand trust check.Contributor checklist
changelog.d/fixed-unpark-reply-own-login.mdv5