Skip to content

πŸ› dupsweep: a bot series is the same job, not just the same bot and files - #18837

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/dupsweep-bot-series-same-job
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/dupsweep-bot-series-same-job

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

The duplicate-PR sweep treated any two open PRs by one bot that touch the same files as a "Superseded regeneration series". A dependency bot opens one PR per dependency, and they all edit package.json and its lockfile. So the sweep told maintainers the older bumps were "superseded by construction", even though each one updates a different dependency.

With this change a bot series has to be the same job run again:

  • the titles match once versions, dates and hashes are set aside; or
  • the patches are byte-identical.

One bot's separate jobs that merely share a file form no cluster and get no comment.

What happened

Seen on projectbluefin/website. The bot is mergeraptor[bot], which is Renovate running as an App. Times are Eastern.

Every one of those comments then ends with "Here the patches DIFFER … dependency-bump PRs that edit one shared manifest … land in it". So the hive contradicts itself and invites a maintainer to close real updates. The branches (renovate/antfu-eslint-config-10.x, renovate/js-yaml-5.x, …) show they are separate updates.

Cause

What changed

All in src/pkg/dupsweep:

  • sameJob. Titles are compared after jobTitle normalises them:

    • lower-cased, whitespace collapsed;
    • hashes (7+ hex characters containing a digit) and versions, dates and counters replaced by #;
    • digits inside a name (web3, python3) kept.

    So "chore: regenerate X (2026-11-16)" and "(2026-11-17)" match, while "update dependency vue-tsc to v3.3.14" and "update dependency js-yaml to v5" don't.

  • Same author is necessary, not sufficient. isBotSeries becomes sameBotAuthor. A cluster is a bot series when it has the same bot author and either sameJob matches or the confidence is identical-diff.

  • One bot's different jobs are dropped. A cluster where every member is the same bot, that is not a series, and is graded below finding-identity forms no cluster. Without this, the fix would only swap "superseded" for a "Possible duplicate" comment on each bump.

  • Unchanged:

    • human and mixed-author clusters;
    • the identical-diff tier;
    • the finding-identity tier (one bot's PRs with the same finding identity become an ordinary cluster);
    • the PR-side duplicate guard, which calls Find without authors.
  • Head branch not used. Bots never share a head branch between two open PRs, whether they are reruns or separate bumps, so a branch cannot tell the two cases apart. The title is the name the bot gives its job, and PR.Title was already on the struct, so no new field was needed.

  • Docs: docs/duplicate-sweep.md (survivor selection). Plus a changelog fragment.

Comments already posted

The sweep edits only the comment of a cluster it still finds (keyed by MarkerFor). It never withdraws a comment once the cluster is gone, which is also what happens today when a member PR merges. So the comments already on projectbluefin/website#1023, #1024, #1037 and #1044 stay as they are, and the sweep posts nothing new there. Withdrawing stale suggestions would mean scanning the comments of every un-clustered PR on each pass, so I left it out of this PR.

Not in this PR

Tests

  • dupsweep_test.go:
    • the website bumps (different dependencies, same manifest, different patches) form no cluster, with known or unknown diff hashes;
    • regeneration titles that differ only by date stay a series, and the newest survives;
    • byte-identical patches from one bot are still an identical-diff series;
    • one bot's PRs with a shared finding identity are still an ordinary finding-identity cluster;
    • a mixed bot and human pair is unchanged;
    • a jobTitle table of same-job and different-job pairs.
  • duplicate_sweep_test.go: an end-to-end sweep over three mergeraptor[bot] bumps, with posting on, produces no cluster, no comment and no GitHub write.
  • The existing bot-series, different-bots, human-author and bot_authors tests are unchanged and still describe the behaviour.

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); CI runs the tests. The normalisation patterns were also checked by hand against the titles above.

No open issue covers this. The searches for "regeneration series", isBotSeries, dupsweep, "bot series" and "superseded by construction" found only the closed #7469 and the merged #7512.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

isBotSeries counted any two open PRs by one bot that touch the same
files as a regeneration series, so a dependency bot's separate bumps
sharing package.json were called superseded by construction. A series
now also needs the same job: titles equal once versions, dates and
hashes are set aside, or byte-identical patches. One bot's different
jobs form no cluster; finding-identity clusters are kept.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 17, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 972949f into hivecommons:v6 Nov 17, 2026
81 of 82 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#18837e0029ba` sha256:24a943db4a6e514f1a84c9fd9eb179a267ae0ec5c9f2417e96884d30e64c9aba β€” download from the dashboard or `hivectl review evidence #18837`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at e0029ba.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant