Commit Graph

82 Commits

Author SHA1 Message Date
Jamie Tanna b62fe59594 fix: remove references to "bot" (#39305)
We dropped the "bot" from our terminology long ago, but it looks like
we've got some outdated docs + code that reference it.

We should remove this to keep things consistent.

A `fix`, as we're changing the commit author's name, and log lines.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-09-02 08:56:20 +00:00
Sebastian Poxhofer 97327c3d28 refactor(linters): add prefer-coerce-array rule (#45492)
* 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()`.
2026-08-28 09:27:58 +00:00
Sebastian Poxhofer 91e068f1fd test(linters): add linting rule to enforce v8 ignore reason declaration (#44726)
* ci(linter): add renovate/v8-ignore-reason rule

Flag coverage-ignore comments ("v8 ignore") that carry no justification.
Accepted forms: "-- reason" / "--- reason" (recommended) and the legacy
colon form "v8 ignore <kind>[ <count>]: reason", which is already
widespread in the codebase (29 sites). Bare "v8 ignore stop" markers are
exempt because the justification lives on the paired "start" marker. The
"v8 ignore next <N>" count form remains allowed; this rule only requires
a justification.

Registered as "warn" instead of "error": the repo currently has 119
reason-less v8 ignore comments, too many to fix mechanically in one PR,
so existing sites are left untouched and can be fixed incrementally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(linter): promote renovate/v8-ignore-reason to error

Record the empirical verdict on the contested "v8 ignore next <N>" count
semantics in the rule doc: verified against vitest 4 with
ast-v8-to-istanbul that the count is not honored - the ignore hint always
exempts exactly the next AST node regardless of N. Counts are therefore
inert and stay allowed; the rule keeps requiring only a justification.

Promoting to error so all remaining reason-less coverage-ignore comments
must be fixed; the burndown follows in subsequent commits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RxHFNsSworLcv23xXk9Hk

* refactor: add justifications to coverage-ignore comments (batch 1)

Give every reason-less "v8 ignore" comment outside the large platform
index files a site-specific justification explaining why the exempted
branch is untestable or defensive, as now required by the
renovate/v8-ignore-reason rule.

Also guard against a nullish comment.loc in the rule itself; the
merged-in stricter tools typechecking flagged the unguarded access.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RxHFNsSworLcv23xXk9Hk

* refactor: add justifications to coverage-ignore comments (batch 2)

Cover the five large platform index files (github, bitbucket,
bitbucket-server, codecommit, gitlab) with site-specific reasons on
every "v8 ignore" comment, completing the renovate/v8-ignore-reason
burndown. Two meaningless ignore hints inside commented-out CodeCommit
mergePr code are dropped instead of annotated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RxHFNsSworLcv23xXk9Hk

* Apply suggestions from code review

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>

* Update lib/util/regex.ts

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-07-20 13:01:39 +00:00
Sebastian Poxhofer 64e6a4c71f refactor(oxlint): enable unicorn/prefer-at (#44556)
Enable the unicorn/prefer-at rule as error in .oxlintrc.json and fix all
43 pre-existing violations (arr[arr.length - 1] -> arr.at(-1)) via oxlint
autofix. Where .at() widened the type to T | undefined, non-null
assertions were added at sites where surrounding logic guarantees the
element exists (length guards, split results), preserving the original
runtime behavior and typing.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:57:23 +00:00
Sebastian Poxhofer 9717259ffc refactor(oxlint): enable no-else-return and unicorn/no-lonely-if (#44553)
Enable no-else-return (with allowElseIf: false) and unicorn/no-lonely-if
as errors in .oxlintrc.json and fix all 131 pre-existing violations
(91 no-else-return, 40 unicorn/no-lonely-if) across 98 files.

The no-else-return violations were fixed with the oxlint autofix
(iterated to a fixpoint, plus two else-if chains that required
--fix-dangerously) followed by Prettier formatting. One comment dropped
by the autofix in lib/modules/manager/pub/artifacts.ts was restored
manually. The unicorn/no-lonely-if violations were merged by hand,
preserving comments and coverage-ignore hints.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:11:21 +00:00
Roshan Banisetti 5a8b5bbedd feat(platform/gitea,forgejo): use login instead of username for user handles (#43904)
refactor(platform/gitea,forgejo): replace username with login in User types
2026-06-10 06:10:43 +00:00
Sebastian Poxhofer 73b90e958b refactor: remove string concetation for production code (#43442)
refactor: prefer templates rather than `+`
2026-05-19 13:31:27 +00:00
Jamie Tanna ff6761ed23 fix(config/global): return default values for GlobalConfig.get (#42113)
* fix(config/global): return default values for `GlobalConfig.get`

As noted in #39949, it can be awkward working with in `GlobalConfig.get`, where
we would previously need to specify the default value when calling `.get`,
which could lead to drift with the defaults for a given config option.

To reduce this risk, we can rely on a given `default` for a configuration
option, providing that as a default.

Because this now definitely returns a value that matches the config option, it
now allows us to remove `!` assertions.

* fixup! fix(config/global): return default values for `GlobalConfig.get`

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* fixup! fix(config/global): return default values for `GlobalConfig.get`

* test(presets): remove impossible test

As it's now not possible to set a value as `undefined` (as
`GlobalConfig` will then use the default), this test no longer validates
anything.

* test(workers/repository): add mock

Now `platform` defaults to `github`, we need to mock out the call to
fetch config.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>

* test: coverage

* test: coverage

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-05-15 17:10:38 +00:00
Michael Kriese 57c6e77787 fix(forgejo,gitea): full name can be empty (#41950) 2026-03-16 13:38:54 +00:00
Sergei Zharinov 41bfb8678e refactor(lint): use oxlint for type-aware rules (#41739)
* feat: enable oxlint type-aware linting

Move type-aware typescript-eslint rules from ESLint to oxlint,
leveraging oxlint-tsgolint for type information. This removes
the need for ESLint's projectService and parserOptions.

- Add `options.typeAware: true` to .oxlintrc.json with all
  type-aware rules (recommendedTypeChecked + stylisticTypeChecked)
- Switch ESLint to non-type-aware configs (recommended, stylistic)
- Remove projectService/parserOptions from ESLint config
- Drop @typescript-eslint/naming-convention (no oxlint equivalent)
- Update oxlint/eslint-plugin-oxlint to 1.51.0
- Add oxlint-tsgolint dependency
- Convert eslint-disable comments to oxlint-disable for type-aware rules
- Fix prefer-optional-chain violations newly caught by oxlint

* fix: revert unnecessary code changes, suppress with oxlint-disable instead

* fix: suppress remaining prefer-optional-chain violations

* fix: suppress last prefer-optional-chain violation

* fix: remove redundant --type-aware CLI flag, use config instead
2026-03-09 12:51:12 +00:00
Michael Kriese 912c623d60 test: full coverage for platforms (#41318)
chore: full coverage for platforms
2026-02-19 11:05:15 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
renovate[bot] acacad57c6 chore(deps): update linters (main) (#40277)
* chore(deps): update linters

| datasource | package              | from   | to     |
| ---------- | -------------------- | ------ | ------ |
| npm        | eslint-plugin-oxlint | 1.36.0 | 1.38.0 |
| npm        | typescript-eslint    | 8.50.1 | 8.52.0 |

* chore: enable oxlint gha format

* chore: fix lint

* chore: fix lint

* chore: fix lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-14 15:32:48 +00:00
Michael Kriese 0af770947b fix: ignorePrAuthor is a global repo config (#39578) 2025-11-27 09:05:15 +00:00
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +00:00
RahulGautamSingh 76f911041a refactor: use named exports (#39196)
* use named exports

* fix test

* add missing imnport

* fix prettier
2025-11-10 12:00:35 +00:00
dh-seanmurphy 9096e55e3e fix(gitea): allow fallbacks in case default merge style not allowed (#37768)
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2025-09-09 08:53:22 +00:00
Michael Kriese 7ac5c93070 fix(platform): open or update issue correctly (#37831) 2025-09-04 10:29:04 +00:00
Patrick Schratz 6c2bd9d197 feat: add forgejo as a standalone platform (#37075)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-07-21 14:24:07 +00:00
Michael Kriese c5f4589536 fix(gitea): prefer default merge method (#36779) 2025-07-02 05:24:16 +00:00
Jimmy Jones ca592eae0b fix(gitea): automerge of repos with only fast forward only merge (#36567) 2025-06-19 05:43:52 +00:00
Jimmy Jones c798912a50 feat(gitea): Support repos with fast forward only merge (#36272) 2025-06-03 05:42:38 +00:00
RahulGautamSingh 49fa1be464 feat(util): getEnv (#35161)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-06 18:37:28 +00:00
renovate[bot] fffd986fa7 chore(deps): update linters (main) (#35113)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-04-02 14:28:27 +00:00
RahulGautamSingh 02a6deaa7e feat(gitea): find prs from other authors (#35065) 2025-03-31 10:51:33 +00:00
Sergei Zharinov f957ea8fec test: Fix coverage for platform code (#34719) 2025-03-23 07:06:52 +00:00
Sergei Zharinov 1c6094c1bd fix(gitea): Fix platform test performance (#34415) 2025-02-23 15:46:56 +00:00
Michael Kriese c7737befb7 feat(gitea/forgejo): set poster server filter for pr cache (#34374)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2025-02-21 13:47:43 +00:00
Michael Kriese df1af911d4 fix(gitea): allow overriding platform version (#34019) 2025-02-04 08:41:26 +00:00
Michael Kriese 5f5c4d13bb fix(gitea): platform automerge only fully works on Gitea v1.24 and Forgejo v10 (#33871) 2025-01-27 14:46:47 +00:00
RahulGautamSingh 0d23707604 refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
Rhys Arkins e27fe66980 feat(git): cloneSubmodulesFilter (#33115) 2024-12-18 13:01:14 +00:00
RahulGautamSingh 92ac488836 refactor(platform): rename addPr to setPr (#33174) 2024-12-17 19:22:20 +00:00
Rhys Arkins 702ffbc9c2 fix(platform): don't log if issues are disabled when closing (#30267) 2024-07-20 11:13:04 +00:00
RahulGautamSingh 4b502025fe refactor: rename platformOptions -> platformPrOptions (#30173) 2024-07-16 07:33:55 +00:00
Michael Kriese a02c850453 fix(dependency-dashboard): fix truncated issue body (#30081) 2024-07-08 12:14:27 +00:00
RahulGautamSingh 10a4a8bb26 feat(self-hosted): autodiscoverRepoSort and autodiscoverRepoOrder (#28738)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-05-06 18:16:01 +00:00
Michael Kriese 4140fe9beb feat(gitea): filter and abort unusable repos (#28063)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-04-25 09:57:02 +00:00
Michael Kriese 0858ccb6a9 feat(platform/gitea): support new forgejo versioning schema (#28492) 2024-04-18 07:46:58 +00:00
RahulGautamSingh f8890796bf feat: update labels when config changes (#25340)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-03-30 04:49:13 +00:00
Ronald van Butselaar 0dfea671b3 feat(platform/gitea): autodiscover repos by namespace (#26821)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-03-19 19:54:24 +00:00
Rhys Arkins 59df10183a feat(platform): getRepoForceRebase -> getBranchForceRebase (#27052)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-02-06 09:14:11 +00:00
Lauris BH f634b9c988 feat(platform/gitea): autodiscover repos by topic (#26676)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-01-21 09:08:25 +00:00
Sergei Zharinov de68769fc2 feat(gitea): Add PR cache (#26451)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-01-15 17:32:44 +00:00
Sergei Zharinov f6d86f8bb1 refactor(gitea): Refactor tests (#26537) 2024-01-08 16:53:23 +00:00
RahulGautamSingh 5f163552a9 fix(reconfigure/pr): find reconfigure pr separately (#25954)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-12-29 12:55:11 +00:00
joegoldman2 0710a35205 feat(platform/gitea): use automergeStrategy in createPr (#26448) 2023-12-28 17:45:37 +00:00
Michael Kriese f88353c671 fix(gitea): disable issues on external tracker (#26228) 2023-12-11 14:35:55 +00:00
Michael Kriese a2672ef722 fix(gitea): check for disabled issues (#26134) 2023-12-05 11:27:30 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00