Skip to content

Commit a9f3a91

Browse files
fix: corrected the CI
1 parent 209f4e9 commit a9f3a91

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

test/mocks/multiregion.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,32 @@ function createRegionRoutes(
142142
return { status: 404, body: notFoundFixture };
143143
},
144144
},
145-
// Issues list for project
145+
// Issues list (org-scoped endpoint used by @sentry/api SDK)
146+
// Filters by project slug from the "query" search param (e.g., query=project:my-project)
147+
{
148+
method: "GET",
149+
path: "/api/0/organizations/:orgSlug/issues/",
150+
response: (req, params) => {
151+
if (orgSet.has(params.orgSlug)) {
152+
const url = new URL(req.url);
153+
const query = url.searchParams.get("query") ?? "";
154+
const projectMatch = query.match(/project:(\S+)/);
155+
const projectSlug = projectMatch?.[1];
156+
if (projectSlug) {
157+
const issues = issuesByProject.get(projectSlug) ?? [];
158+
return { body: issues };
159+
}
160+
// No project filter: return all issues for all projects in this org
161+
const orgProjects = projectsByOrg.get(params.orgSlug) ?? [];
162+
const allIssues = (orgProjects as Array<{ slug: string }>).flatMap(
163+
(p) => issuesByProject.get(p.slug) ?? []
164+
);
165+
return { body: allIssues };
166+
}
167+
return { status: 404, body: notFoundFixture };
168+
},
169+
},
170+
// Issues list (legacy project-scoped endpoint)
146171
{
147172
method: "GET",
148173
path: "/api/0/projects/:orgSlug/:projectSlug/issues/",

test/mocks/routes.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,18 @@ export const apiRoutes: MockRoute[] = [
131131
},
132132
},
133133

134-
// Issues
134+
// Issues (org-scoped endpoint used by @sentry/api SDK)
135+
{
136+
method: "GET",
137+
path: "/api/0/organizations/:orgSlug/issues/",
138+
response: (req, params) => {
139+
if (params.orgSlug === TEST_ORG) {
140+
return { body: issuesFixture };
141+
}
142+
return { status: 404, body: notFoundFixture };
143+
},
144+
},
145+
// Issues (legacy project-scoped endpoint)
135146
{
136147
method: "GET",
137148
path: "/api/0/projects/:orgSlug/:projectSlug/issues/",

0 commit comments

Comments
 (0)