Files
Michael Kriese f7e8104511 test(workers/repository): close more branch coverage gaps (#46259)
* test(workers/repository): cover five pr body and warning guards

- an upgrade with no release notes of its own, which gets no summary
  title while the branch as a whole has notes
- an upgrade with no homepage, source or dependency url, whose name is
  therefore left unlinked
- an upgrade that defines no pr body columns
- an assignee list that filtering empties out
- a second warned dependency in a package file that is already listed,
  so the file is not recorded twice

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* test(workers/repository): cover four changelog guards

- `massageName` gets a describe of its own: it is exported but was only
  ever reached through a release that carried a tag, so the no-version
  path and the empty-result path went untaken
- a lone in-range release with no earlier one to prepend
- a bitbucket tree holding exactly one changelog candidate, so nothing is
  logged about choosing between several
- a bitbucket-server source url that parses but matches neither the git
  nor the web repository pattern

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* test(workers/repository): cover both extract failure paths

- a manager whose `extractAllPackageFiles` returns null, so there is
  nothing to massage dep names in
- a file whose `extractPackageFile` returns nothing, so it contributes no
  package file

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* ci: ratchet the branch coverage threshold

A full run on this branch reports 100% statements (49491/49491), 100%
functions (7384/7384), 100% lines (48981/48981) and 99.86% branches
(25726/25761), up from 99.82% on the branch below. The threshold moves to
99.84, keeping the same rounding-down margin as before.

Statements, functions and lines are already pinned at 100 and stay
there.

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* test(workers/repository): cover four process guards

- a libyear update released before the version currently in use, which
  yields a negative age and is therefore not counted
- a pr that is closed, and one raised from the onboarding branch, neither
  of which counts towards the concurrent pr limit
- a second base branch whose package files do not displace the first
  one's, on a platform that cannot sync a fork with its upstream

The fork case redefines `syncForkWithUpstream` rather than deleting it,
the same way the migration branch spec handles `refreshPr`.

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* test(workers/repository): cover the extract cache guards

- a cached extract whose manager fingerprints all still match, so the
  cache is reusable; the test reads the expected fingerprint out of
  `hashMap` rather than hard-coding a hash that regenerates
- an extract that is told not to overwrite the cache
- a cached scan for a branch that is still a configured base branch, so
  it survives the clean-up that drops the others

With these, `lib/workers/repository/process` is fully covered.

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* test(workers/repository): cover the branchPrefixOld miss

`prAlreadyExisted` retries the lookup under the old branch prefix, but
every test either hit on the first lookup or on the second, so the case
where both miss went untaken.

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* ci: ratchet the branch coverage threshold to 99.87

The tests added after the earlier bump in this branch close eight more
branches. A full run now reports 100% statements (49491/49491), 100%
functions (7384/7384), 100% lines (48981/48981) and 99.89% branches
(25734/25761). The threshold moves from 99.84 to 99.87, keeping the same
rounding-down margin as before.

Statements, functions and lines are already pinned at 100 and stay
there.

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

* test(workers/repository): cover three changelog embedding guards

The pr worker copies release notes off each upgrade's changelog result.
Three of its guards were never taken because every test supplied a
complete result for a distinct repository:

- a changelog with no project, so no repo name is recorded
- a changelog with a project but no versions, so no releases are copied
- a second upgrade for a repository whose notes were already committed,
  which is skipped rather than repeated

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>

---------

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>
2026-09-17 07:08:46 +00:00
..