Closed
Conversation
Contributor
rmelisson
commented
Mar 3, 2026
- pour tester les résultats de recherche sans les PQ
revu-bot
reviewed
Mar 3, 2026
Collaborator
revu-bot
left a comment
There was a problem hiding this comment.
PR Summary: Remove Prequalified Results
This PR disables prequalified (PQ) results in two places — the search page (app/recherche/page.tsx) and the presearch() controller method — and adds a new app/api/search/route.ts file.
| File | Lines | Severity | Issue |
|---|---|---|---|
src/api/modules/search/controller.ts |
15 | CRITICAL | get() still enables PQ by default; inconsistent with PR intent |
src/api/modules/search/controller.ts |
15 | IMPORTANT | q as string cast without null guard — runtime crash on missing param |
app/api/search/route.ts |
1–7 | IMPORTANT | New route has no tests and no docstring on the exported handler |
Overall: The change is partially applied — presearch() and the page are updated, but the get() method in the same controller still defaults PQ to true when no pq query param is provided. This is likely a bug given the stated goal of the PR.
revu-bot
reviewed
Mar 3, 2026
Comment on lines
+1
to
+8
| import { SearchController } from "src/api"; | ||
|
|
||
| export const dynamic = "force-dynamic"; | ||
|
|
||
| export async function GET(request: Request) { | ||
| const controller = new SearchController(request); | ||
| return controller.get(); | ||
| } |
Collaborator
There was a problem hiding this comment.
[IMPORTANT] New public route has no tests and no docstring
- Per the coding guidelines, public functions must have concise docstrings explaining purpose and return values.
- The new
GEThandler is a public API entry point with no test coverage. The guidelines require 100% coverage for critical code — an API route qualifies. - At minimum, tests should cover:
- Happy path: valid
?q=returns 200 with results - Missing
qparam returns 400 -
?pq=truevs default behaviour
- Happy path: valid
Suggested docstring addition:
Suggested change
| import { SearchController } from "src/api"; | |
| export const dynamic = "force-dynamic"; | |
| export async function GET(request: Request) { | |
| const controller = new SearchController(request); | |
| return controller.get(); | |
| } | |
| import { SearchController } from "src/api"; | |
| export const dynamic = "force-dynamic"; | |
| /** | |
| * GET /api/search | |
| * | |
| * Searches documents matching the given query. | |
| * Query params: `q` (required) — search term; `pq` (optional, default off) — enable prequalified results. | |
| * Returns a JSON response with matching documents and classification. | |
| */ | |
| export async function GET(request: Request) { | |
| const controller = new SearchController(request); | |
| return controller.get(); | |
| } |
|
|
🎉 Deployment for commit 91c45a1 : IngressesDocker images
|
Contributor
|
remplacé par : #7222 et rebase sur la branche dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


