Offer only available Gemini chat models, newest first

The Gemini provider listed every model returned by ListModels on the
v1 API in API order, so the chat dropdown started with outdated or
unsuitable entries:

* gemini-2.5-pro is still listed, but generateContent fails with
  "This model models/gemini-2.5-pro is no longer available to new
  users".
* Image models such as gemini-2.5-flash-image were offered for a
  text-only code review.
* Preview models and the gemini-*-latest aliases, including the
  replacement Google suggests for gemini-2.5-pro, exist only on v1beta
  and were never offered.

Move all Gemini API calls to v1beta: not only the models listing but
also generateContent, which serves the actual reviews, since the
preview models and -latest aliases fail with HTTP 404 on v1. Request
up to 1000 models per page, as the v1beta catalog is larger than the
default page of 50. Drop the image, tts, transcribe, live,
customtools, robotics, computer-use, omni and nano-banana variants.

ListModels carries no lifecycle information, so probe every remaining
model with countTokens, which fails with HTTP 404 for retired models
like generateContent does, without consuming generation quota. Any
other failure keeps the model listed. The provider plugin caches the
resulting list for a day, so the probes run at most once per day.

Sort the -latest aliases first, then by version, newest first; within
a version pro comes before flash and flash-lite, and stable models
before previews.

Bug: https://github.com/GerritForge/ai-review-agent-provider/issues/8
Change-Id: Ibc3cdc71de7efc4b9f5cee02cacc2dcfef961fe6
1 file changed
tree: 7aa467c4e5782a82677ff03c1098172c0c873b7c
  1. admin/
  2. ai/
  3. multi-primary/
  4. replication/
  5. .gitignore
  6. README.md
README.md

Gerrit scripting plugins collection

Overview

This repository contains a collection of Gerrit scripting plugins that are intended to provide simple and useful extensions.

How to run the scripting plugins

Gerrit needs to be able to recognise the scripts syntax and being able to load them as plugins.

In order to be able to run Groovy scripts, you need to install first the Groovy scripting provider and then copy the Groovy scripts under your Gerrit /plugins directory.

Similarly for Scala scripts, you need to install the Scala scripting provider and then copy the Scala scripts under your Gerrit /plugins directory.

Administration Scripts

Gerrit multi-primary Scripts