fix: почини моки issue-list route после pagination/access-decide изменений (мастер CI красный) #183

Closed
andrei wants to merge 2 commits from agent/cto/pix-13590-fix-master-ci-issue-list-mocks into master
Owner

Что сделано

Master сломан 3 мержа подряд (#177, #178, #180): job API Tests падает на issue-list-agent-limit-routes.test.ts (4 из 10 тестов -> 500 вместо 200).

Причина

Моки теста устарели относительно уже влитых изменений роута GET /api/companies/:companyId/issues:

  • PIX-12722 добавил svc.count() рядом с svc.list() - мок issueService не давал count
  • access.decide() заменил проверки только через canUser/hasPermission для company-scope read
  • blockedByMapForIssues() теперь делает innerJoin()-запрос, которого не было в фейковом db
  • ответ списка сменился с голого массива на { data, total, limit, offset }

Как проверено

npx vitest run src/__tests__/issue-list-agent-limit-routes.test.ts -> 10/10 passed. Полный pnpm typecheck прошёл на push (husky pre-push hook, зелёный).

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

Фейковый db теперь поддерживает две ветки запроса (where().orderBy() и innerJoin().where()), но остаётся упрощённой моделью drizzle - если появится третий query-паттерн, потребуется расширить createDb().

## Что сделано Master сломан 3 мержа подряд (#177, #178, #180): job API Tests падает на `issue-list-agent-limit-routes.test.ts` (4 из 10 тестов -> 500 вместо 200). ## Причина Моки теста устарели относительно уже влитых изменений роута `GET /api/companies/:companyId/issues`: - PIX-12722 добавил `svc.count()` рядом с `svc.list()` - мок `issueService` не давал `count` - `access.decide()` заменил проверки только через `canUser`/`hasPermission` для company-scope read - `blockedByMapForIssues()` теперь делает `innerJoin()`-запрос, которого не было в фейковом db - ответ списка сменился с голого массива на `{ data, total, limit, offset }` ## Как проверено `npx vitest run src/__tests__/issue-list-agent-limit-routes.test.ts` -> 10/10 passed. Полный `pnpm typecheck` прошёл на push (husky pre-push hook, зелёный). ## Где могу ошибаться Фейковый db теперь поддерживает две ветки запроса (`where().orderBy()` и `innerJoin().where()`), но остаётся упрощённой моделью drizzle - если появится третий query-паттерн, потребуется расширить `createDb()`.
fix(server): domock issue-list route deps broken by pagination/access-decide changes
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Failing after 6s
Agents CI / Typecheck and Build (pull_request) Successful in 5m36s
Agents CI / API Tests (pull_request) Failing after 2m43s
8515815815
Master's API Tests job has failed 3 merges in a row (#177, #178, #180):
issue-list-agent-limit-routes.test.ts returned 500 instead of 200 because
the mocks were stale against three route changes that already landed on
master:
- PIX-12722 pagination added svc.count() alongside svc.list()
- access.decide() replaced the old canUser/hasPermission-only checks for
  company-scope reads
- blockedByMapForIssues() now runs an innerJoin() query the fake db
  object never implemented
- the list response envelope changed from a bare array to
  { data, total, limit, offset }

Added the missing count mock, access.decide mock, an innerJoin-capable
fake db builder, and updated the blockedByIssueIds assertion to read
res.body.data[0].

Hey @andrei! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • Missing section: ## Зачем
  • Missing section: ## План тестирования
  • Add the dedup-search checkbox to your PR description and check it once you have searched the GitHub PR list for similar PRs (- [x] I searched ..., or in Russian for Rule 101 PRs: - [x] Я поискал похожие PR и подтверждаю, что дубликатов нет). See the PR template at .github/PULL_REQUEST_TEMPLATE.md and CONTRIBUTING.md → "Before You Start: Search First".

Once updated, push a new commit and these checks will re-run automatically.

— paperclip-gates

Hey @andrei! Before this PR can be reviewed, a few things need attention: **Missing or incomplete:** - [ ] Missing section: **## Зачем** - [ ] Missing section: **## План тестирования** - [ ] Add the dedup-search checkbox to your PR description and check it once you have searched the GitHub PR list for similar PRs (`- [x] I searched ...`, or in Russian for Rule 101 PRs: `- [x] Я поискал похожие PR и подтверждаю, что дубликатов нет`). See the PR template at .github/PULL_REQUEST_TEMPLATE.md and CONTRIBUTING.md → "Before You Start: Search First". Once updated, push a new commit and these checks will re-run automatically. — paperclip-gates
ci: retrigger PR Quality Gates (flaky agent-live-run-routes test)
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Failing after 6s
Agents CI / Typecheck and Build (pull_request) Successful in 5m38s
Agents CI / API Tests (pull_request) Failing after 13m48s
ab0f63ff23
andrei closed this pull request 2026-07-05 03:45:56 +00:00
Some checks failed
security/pr-scan No security concerns detected
PR Quality Gates / PR Quality Gates (pull_request_target) Failing after 6s
Required
Details
Agents CI / Typecheck and Build (pull_request) Successful in 5m38s
Required
Details
Agents CI / API Tests (pull_request) Failing after 13m48s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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!183
No description provided.