feat(web): filter GitLab merge requests by source branch

This commit is contained in:
2026-08-16 16:23:36 +00:00
parent 6868a58359
commit 267db3fb9d
6 changed files with 73 additions and 4 deletions
+4
View File
@@ -507,6 +507,7 @@ export function registerGitLabRoutes(app, options = {}) {
const rawPage = typeof req.query?.page === 'string' ? Number(req.query.page) : 1;
const effectivePage = Number.isFinite(rawPage) && rawPage > 0 ? rawPage : 1;
const searchQuery = asString(req.query?.query);
const sourceBranch = asString(req.query?.sourceBranch);
const client = await getClient();
if (!client) {
@@ -522,6 +523,9 @@ export function registerGitLabRoutes(app, options = {}) {
if (searchQuery) {
params.search = searchQuery;
}
if (sourceBranch) {
params.source_branch = sourceBranch;
}
const resp = await withTimeout(client.mergeRequests(projectPath, params), ROUTE_TIMEOUT_MS, 'gitlab mrs list');
if (resp.status === 429) {
return res.status(503).json({ error: 'GitLab rate limited' });