Refs #45216
The object counterpart to `prefer-coerce-array`: `x ?? {}` becomes
`coerceObject(x)`. The rule flags a `??` whose default is a bare `{}`
literal, so a populated default or an asserted `({} as Foo)` still
passes; a `x ?? y ?? {}` chain maps onto `coerceObject(x, y)`.
Every hit across `lib/` converted cleanly, so no disable comments were
needed.
* refactor(linters): add prefer-coerce-array rule
Refs #45217
`x ?? []` and `coerceArray(x)` say the same thing, but only the second
one is searchable and consistent. The rule flags a `??` whose default is
a bare `[]` literal; a non-empty default or an asserted `([] as Foo[])`
still passes.
Applying it across `lib/` surfaced three spots the helper cannot cover,
which keep `?? []` with a disable comment or a narrower fix:
- `package-files.ts` destructures a tuple, which `coerceArray()` widens
- `generate.spec.ts` defaults `matchAll()`, an iterator rather than an array
- `mise/upgradeable-tooling.ts` declares a `Record` return, so its
`?? []` fallback was wrong to begin with and becomes `coerceObject()`
* refactor(platform/github): hoist the GHE version header lookup
`Object.entries(...).find()` returns a tuple, and defaulting it with
`?? []` only to destructure the second element reads as an array
default when it is not one. Name the found entry instead, which drops
the `?? []` rather than routing a tuple through `coerceArray()`.
* test(workers/repository): don't use generic `times(2)` matcher
So it's clearer what we're validating.
Co-authored-by: Claude Opus 4.7 <jamie.tanna+claude-code@mend.io>
* chore(workers/repository): add a summary of dependency updates
As part of future changes, we'll be making further tweaks to how the
onboarding PR is generated, which will introduce a summary of the
dependency updates a given onboarding PR would produce.
As this is valuable information regardless of whether we're in
onboarding/reconfigure mode or not, we can create a new function for
this, and output it after the `branches info extended`.
We can make sure to indicate when there are vulnerability alert updates
in a separate count to the per-`updateType` calculation, and a running
total.
Co-authored-by: Claude Opus 4.7 <jamie.tanna+claude-code@mend.io>
* chore(workers/repository): add manager-specific breakdowns to "Updates summary"
So we can use this information when providing a summary on
Onboarding/Reconfigure PRs.
Co-authored-by: Claude Opus 4.7 <jamie.tanna+claude-code@mend.io>
* fixup! chore(workers/repository): add manager-specific breakdowns to "Updates summary"
---------
Co-authored-by: Claude Opus 4.7 <jamie.tanna+claude-code@mend.io>
* use branchPrefix if multiple base branches expected
* fix test
* fix coverage
* apply suggestions
* apply suggestions
* use utility fn
* refactor tests
* fix test
* major overhaul: use baseBranches field internally
suggested by @secustor
* refactor: cleanup
* test: use better descriptions
* add tests
* fix logic
* fix test
* exclude unlisted versions when finding latestStable
---------
Co-authored-by: Rhys Arkins <rhys@arkins.net>