Ensure every mocks payload folder has a 404 case - #340
Open
Samuelfaure wants to merge 3 commits into
Open
Conversation
DGFIP::TVA::ValidateResponse and both CNOUS student-scholarship interactors already return a NotFoundError on an empty provider response, but the rswag request specs never documented a 404 case for these endpoints (the v4/v5 CNOUS specs were cloned from v3 with only the 200 path). Add the missing response blocks and regenerate the OpenAPI docs so the public spec matches actual behavior.
21 of 107 endpoint folders had no not-found test case. Add a 404.yaml to each, matching the (now complete, see previous commit) OpenAPI documentation for that operation, and regenerate the per-folder READMEs.
The skill only checked for missing payload folders, not for folders that exist but lack a 404 case, and it told agents to skip 404 whenever the OpenAPI spec didn't document it. Since NotFoundError is a universal error every SIADE interactor can emit, an undocumented 404 is almost always a spec gap, not a real absence of the case. Add a step to check 404 coverage on existing folders, and replace the skip-if-undocumented rule with instructions to check the interactor code and, if it does call resource_not_found!, fix the rswag spec and regenerate the OpenAPI docs before writing the mock.
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.
Summary
mocks/payloads/endpoint folders had no not-found test case. Investigated each: for 14 of them the OpenAPI spec already documented a 404 (payload written straight from the spec's example); for the remaining 7 (api_entreprise_v3_dgfip_tvaand all 6cnous_etudiant_boursierv4/v5 variants) the spec simply never documented one, even though the underlying siade interactors already produce aNotFoundErrorin that case.response '404'rswag blocks to the siade request specs (mirroring sibling/prior-version endpoints), added a WebMock "not found" stub for DGFIP TVA, and regeneratedcommons/swagger/*.yamlso the public OpenAPI docs now match actual behavior.404.yamlto all 21 folders and regenerated their READMEs.siade-sync-openapi-payloadsskill so future syncs always check 404 coverage (not just missing folders) and know to fix an undocumented-but-real 404 at the siade/rswag level instead of skipping it.Test plan
bundle exec rspecon the 7 touched siade request spec files — 19 examples, 0 failuresbash siade/bin/generate_swagger.sh(full request-spec suite) — 826 examples, 0 failuresLOCAL=1 bundle exec rspecinmocks/— 6775 examples, 0 failurespayloads/folder exceptfrance_connect/(not an endpoint, always 200 by design) now has a 404 case