* fix(platform/gerrit): replace getJsonUnchecked with validated getJson
Migrate all getJsonUnchecked calls in lib/modules/platform/gerrit/client.ts
to use Zod-validated getJson. Co-locate schemas in schema.ts with lenient
optional fields to ensure backward compatibility with all existing API responses.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* strictly follow previous interfaces
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: migrate from zod/v3 to zod/v4
This commit contains the logic changes
* chore: migrate imports from zod/v3 to zod/v4
This contains import updates and adds explicit record keys as zod/v4 requires these now
* ci: enforce usage of zod/v4
* fix(gerrit): defer change creation to `createPr()`
Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
* Refactor hashtags handling
* Add prTitle to all missing commitAndPush()
* Fix gerrit tests
* Add warning when prTitle is set in updatePr
* Remove now useless labels from commitAndPush
* Fix gerrit client coverage
* Fix gerrit scm coverage
* Fix rebase coverage
* Improve TODO about assignees
* Fix formatting
* Fix review comment
* Extract to a pushForReview function
* Fix after #41382
* Fix onboarding
* Cleanup code
* Fix ESLint
* Fix tests
* Restore gitRetry for git.merge
* Fix tests
* Simplify hashtags code
* Delete pendingChangeBranch in pushForReview()
* Fix test name
* Remove unnecessary test comments
* Improve test name again
* Fix another test name
* Delete local branch in Gerrit SCM
* Add test for deleting pending branch
* Add tests for pushForReview()
* Fix test case name
* Improve another test name
* Fix another small test inconsistency
* Fix some code style issues
* Use isUndefined instead
* Fix one small test style issue
---------
Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
We need to explicitly pass the gerrit credentials to the api calls
in initPlaform since the host rules for the platform aren't set up
until later on, so the standard http library won't find any credentials
for the gerrit platform yet.
This follows the same pattern as many of the other platforms on renovate
where they also explicitly pass credentials for the api calls made
during their initPlatform.
This appears to have been broken recently due to the recent addition
of an authenticated version api call in
https://github.com/renovatebot/renovate/pull/39223
See https://github.com/renovatebot/renovate/discussions/39969
* fix(gerrit): use most efficient search operators based on Gerrit version
Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
* Address review comments
* Use ignore if instead
* Rename client.version to client.gerritVersion
* Update lib/modules/platform/gerrit/client.spec.ts
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
---------
Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
* feat(gerrit): handle pagination when querying changes
* Add noPagination option, rename pageLimit to limit, and JSDoc them
* Rename limit to pageLimit
* Rename test references