fix: почини моки issue-thread-interaction и issue-list-agent-limit тестов (PIX-13034) #179

Closed
andrei wants to merge 1 commit from agent/fullstack/pix-13034 into master
Owner

Что сделано

  • В issue-thread-interaction-routes.test.ts добавлен метод reconcileForIssueAndAncestors в мок taskWatchdogService — прод-код вызывает его синхронно на каждом PATCH статуса issue (server/src/routes/issues.ts), без метода это давало TypeError -> 500 вместо 200.
  • В issue-list-agent-limit-routes.test.ts:
    • добавлен count в мок issueService (используется для total count из PIX-12722, параллельно с list);
    • добавлен decide в мок accessService (нужен для upstream visibility guard actorCanReadCompanyScope);
    • добавлен явный мок ../services/issues.js с blockedByMapForIssues — роут импортирует эту функцию напрямую из services/issues.js, а не через services/index.js, поэтому раньше вызывалась реальная реализация против db-стаба без .innerJoin;
    • устаревший ассерт res.body[0] заменён на res.body.data[0] под текущую форму ответа {data, total, limit, offset}.

Зачем

PR #173 (PIX-13019) закрыт как superseded после merge #174/#177 — часть фикса (queueAnnotationCommentWakeup) уже попала в master, но точечные правки моков из него в master не попали. Живой прогон на актуальном master подтвердил 5 failed | 18 passed именно по описанным причинам (см. триаж CTO в PIX-13034).

План тестирования

  • NODE_ENV=test pnpm exec vitest run server/src/__tests__/issue-thread-interaction-routes.test.ts server/src/__tests__/issue-list-agent-limit-routes.test.ts server/src/__tests__/issue-agent-mutation-ownership-routes.test.ts --no-file-parallelism — 85/85 passed.
  • Pre-push hook: typecheck для всех воркспейсов (включая server) — зелёный.

Где могу ошибаться

  • Правки затрагивают только тестовые моки, продовый код не менялся — риск регрессии минимален.
  • Полный monorepo tsc --noEmit без ensure-build-deps шага плагинного SDK показывает предсуществующие ошибки в plugin-host-services.ts/plugin-sdk (не связаны с этим PR, воспроизводятся и на чистом master без сборки SDK); pre-push hook собирает SDK перед typecheck и проходит зелёным.
## Что сделано - В `issue-thread-interaction-routes.test.ts` добавлен метод `reconcileForIssueAndAncestors` в мок `taskWatchdogService` — прод-код вызывает его синхронно на каждом PATCH статуса issue (`server/src/routes/issues.ts`), без метода это давало `TypeError` -> 500 вместо 200. - В `issue-list-agent-limit-routes.test.ts`: - добавлен `count` в мок `issueService` (используется для total count из PIX-12722, параллельно с `list`); - добавлен `decide` в мок `accessService` (нужен для upstream visibility guard `actorCanReadCompanyScope`); - добавлен явный мок `../services/issues.js` с `blockedByMapForIssues` — роут импортирует эту функцию напрямую из `services/issues.js`, а не через `services/index.js`, поэтому раньше вызывалась реальная реализация против db-стаба без `.innerJoin`; - устаревший ассерт `res.body[0]` заменён на `res.body.data[0]` под текущую форму ответа `{data, total, limit, offset}`. ## Зачем PR #173 (PIX-13019) закрыт как superseded после merge #174/#177 — часть фикса (`queueAnnotationCommentWakeup`) уже попала в master, но точечные правки моков из него в master не попали. Живой прогон на актуальном master подтвердил 5 failed | 18 passed именно по описанным причинам (см. триаж CTO в PIX-13034). ## План тестирования - `NODE_ENV=test pnpm exec vitest run server/src/__tests__/issue-thread-interaction-routes.test.ts server/src/__tests__/issue-list-agent-limit-routes.test.ts server/src/__tests__/issue-agent-mutation-ownership-routes.test.ts --no-file-parallelism` — 85/85 passed. - Pre-push hook: typecheck для всех воркспейсов (включая server) — зелёный. ## Где могу ошибаться - Правки затрагивают только тестовые моки, продовый код не менялся — риск регрессии минимален. - Полный monorepo `tsc --noEmit` без `ensure-build-deps` шага плагинного SDK показывает предсуществующие ошибки в `plugin-host-services.ts`/`plugin-sdk` (не связаны с этим PR, воспроизводятся и на чистом master без сборки SDK); pre-push hook собирает SDK перед typecheck и проходит зелёным.
fix(test): repair mocks for issue-thread-interaction and issue-list-agent-limit tests
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Successful in 5s
Agents CI / Typecheck and Build (pull_request) Successful in 5m58s
Agents CI / API Tests (pull_request) Failing after 11m6s
d32a2815c7
taskWatchdogService mock in issue-thread-interaction-routes.test.ts was
missing reconcileForIssueAndAncestors, called synchronously on every
issue status PATCH (server/src/routes/issues.ts), causing a 500 instead
of 200 on the terminal-status test.

issue-list-agent-limit-routes.test.ts mocked issueService without count
and left accessService without decide, both needed by the GET
/companies/:id/issues route (total count + upstream visibility guard
from PIX-12722). blockedByMapForIssues is imported directly from
../services/issues.js by the route (not re-exported through
../services/index.js), so it hit the real implementation against a db
stub lacking innerJoin. Added an explicit ../services/issues.js mock and
updated the stale res.body[0] assertion to res.body.data[0] matching the
paginated {data, total, limit, offset} response shape.

PIX-13034
andrei force-pushed agent/fullstack/pix-13034 from d32a2815c7
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Successful in 5s
Agents CI / Typecheck and Build (pull_request) Successful in 5m58s
Agents CI / API Tests (pull_request) Failing after 11m6s
to 4205704ec4
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Successful in 4s
Agents CI / API Tests (pull_request) Has been cancelled
Agents CI / Typecheck and Build (pull_request) Has been cancelled
2026-07-05 01:24:03 +00:00
Compare
andrei force-pushed agent/fullstack/pix-13034 from 4205704ec4
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Successful in 4s
Agents CI / API Tests (pull_request) Has been cancelled
Agents CI / Typecheck and Build (pull_request) Has been cancelled
to 3c48255f53
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Successful in 4s
Agents CI / Typecheck and Build (pull_request) Successful in 5m44s
Agents CI / API Tests (pull_request) Failing after 14m27s
2026-07-05 01:40:00 +00:00
Compare
andrei closed this pull request 2026-07-05 03:46:51 +00:00
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Successful in 4s
Required
Details
Agents CI / Typecheck and Build (pull_request) Successful in 5m44s
Required
Details
Agents CI / API Tests (pull_request) Failing after 14m27s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
europa-tech-srl/europa-tech-agents!179
No description provided.