Skip to content

Commit 760dfd1

Browse files
committed
Add gemini-agent Prow plugin
Implements a Prow plugin triggered by /gemini-agent <task> comments on GitHub issues and PRs. The plugin collects GitHub context (issue metadata, PR diffs, recent comments) and sends it to Gemini on Vertex AI for analysis. Assisted by Opus 4.6 Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
1 parent 32fe11a commit 760dfd1

6 files changed

Lines changed: 993 additions & 0 deletions

File tree

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ require (
6767
golang.org/x/time v0.12.0
6868
gomodules.xyz/jsonpatch/v2 v2.5.0
6969
google.golang.org/api v0.233.0
70+
google.golang.org/genai v1.57.0
7071
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb
7172
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217
7273
google.golang.org/grpc v1.79.3

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,8 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww
10201020
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
10211021
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
10221022
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
1023+
google.golang.org/genai v1.57.0 h1:qTyG2ynz5dQy2jF4CvZdLHHVslhR0heMue+zM1a4GNM=
1024+
google.golang.org/genai v1.57.0/go.mod h1:A3kkl0nyBjyFlNjgxIwKq70julKbIxpSxqKO5gw/gmk=
10231025
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
10241026
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
10251027
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=

pkg/hook/plugin-imports/plugin-imports.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package pluginimports
1919
// We need to empty import all enabled plugins so that they will be linked into
2020
// any hook binary.
2121
import (
22+
_ "sigs.k8s.io/prow/pkg/plugins/geminiagent"
2223
_ "sigs.k8s.io/prow/pkg/plugins/approve" // Import all enabled plugins.
2324
_ "sigs.k8s.io/prow/pkg/plugins/assign"
2425
_ "sigs.k8s.io/prow/pkg/plugins/blockade"

pkg/plugins/config.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,22 @@ type Configuration struct {
9797
Welcome []Welcome `json:"welcome,omitempty"`
9898
Override Override `json:"override,omitempty"`
9999
Help Help `json:"help,omitempty"`
100+
101+
// GeminiAgents holds per-repo configuration for the gemini-agent plugin.
102+
GeminiAgents []GeminiAgentConfig `json:"gemini_agents,omitempty"`
103+
}
104+
105+
// GeminiAgentConfig holds per-repo settings for the gemini-agent plugin.
106+
type GeminiAgentConfig struct {
107+
// Repos is either of the form org/repos or just org.
108+
Repos []string `json:"repos,omitempty"`
109+
110+
// Model is the Gemini model to use (e.g. "gemini-3-flash-preview").
111+
Model string `json:"model,omitempty"`
112+
113+
// AllowedTeams is a list of GitHub team slugs whose members are allowed
114+
// to invoke /gemini-agent, in addition to standard trigger trust.
115+
AllowedTeams []string `json:"allowed_teams,omitempty"`
100116
}
101117

102118
type Help struct {

0 commit comments

Comments
 (0)