Repository navigation
feat(openapi): apply functional tags to LibreSign endpoints - #9341
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6d5213f07
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
vitormattos
left a comment
There was a problem hiding this comment.
Requesting changes to consolidate the OpenAPI taxonomy checks in the existing test infrastructure and ensure they are enforced by CI. No manual edits to generated OpenAPI JSON files are requested.
vitormattos
left a comment
There was a problem hiding this comment.
Please address the inline findings and keep functional OpenAPI tagging and auto-generated JSONs. The revised tests should accept a new correctly tagged endpoint without test-code changes, while rejecting invalid tags and duplicate IDs.
vitormattos
left a comment
There was a problem hiding this comment.
Additional file-specific cleanup suggestion.
6feb56e to
0afdc9b
Compare
vitormattos
left a comment
There was a problem hiding this comment.
Thank you for the work done so far, especially the move to PHPUnit and the improvements to the OpenAPI tag checks.
I have two follow-up comments for the next iteration: please fix the incomplete generated full specification at its source (rather than allowlisting the omission), and simplify the tag validation by removing the redundant legacy-tag inventory. The isolated PHPUnit configuration is fine as it is.
Could you please address these points, regenerate the specifications, and request another review when the CI checks have been rerun? Thanks again for the progress so far.
7db8c9a to
2ba9f22
Compare
Assign the approved OpenAPI taxonomy from issue LibreSign#9088 via method-level #[OpenAPI(tags: [...])] attributes. Preserve administration scope, routes, and authorization attributes. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com> Co-authored-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Regenerate openapi.json, openapi-administration.json and openapi-full.json through composer run openapi after the controller attribute updates. TypeScript generation produced no additional diff. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com> Co-authored-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Verify the approved tag vocabulary, one tag per operation, unique operationIds, and the expected union counts without booting Nextcloud or a database. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com> Co-authored-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Document how to tag new PHP endpoints and regenerate the specifications. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com> Co-authored-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Catch tag swaps that leave vocabulary and aggregate counts unchanged by locking all 88 documented operationIds. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com> Co-authored-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Issue LibreSign#9088 asked for a lightweight PHP/composer static check, not a new GitHub Actions workflow. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com> Co-authored-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Apply the approved functional tags to endpoints introduced on main after the LibreSign#9088 taxonomy work. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Keep durable classification prose for LibreSign/documentation later. Retain the short functional-tag reminder in AGENTS.md. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Replace the standalone script with an isolated PHPUnit suite that does not boot Nextcloud, and run it from the existing OpenAPI workflow. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Validate generated specs for approved tags and unique identities without a second registry of operationIds or tag counts. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Use the stable extractor release required for method-aware path merges and stricter OpenAPI type extraction. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Rename the OCS-aware base controller so extractor 1.9 detects OCS routes, move unused Psalm aliases out of ResponseDefinitions, replace TYPE[] docs with list<>/array shapes, and keep Psalm/TS checks green after the stricter generated contracts. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Expose the identification-document approval flag as an explicit nullable string parameter so OpenAPI documents it and runtime stays aligned with InjectionMiddleware's strict 'true' comparison. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Refresh default, administration, full, and TypeScript clients after the extractor bump so scoped and full contracts stay in sync. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Drop known full-spec omissions and legacy-tag exceptions, compare full coverage by operationId and route, and keep raw scoped/full objects equal. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Head branch was modified
2ba9f22 to
00593aa
Compare
Resolves: #9088
📝 Summary
Applies the approved functional OpenAPI taxonomy to LibreSign controller operations via method-level
#[OpenAPI(tags: [...])]attributes, then regenerates the OpenAPI specs.Controller-name tags (
account,admin,file,policy, …) are replaced by the ten functional tags used for SDK grouping:appearance,certificates,documents,identity,notifications,policies,requests,signing,system, andverification.After syncing with
main, also classifies the newer endpointsnotify-status→notificationsandsignature_elements-use-saved-signature-elements→appearance.Bumps
nextcloud/openapi-extractorto stablev1.9.1so scoped path merges keep both HTTP methods on the same path (fixes the previousGET/POST /footer-templatefull-spec omission). PHPUnit undertests/php/openapi/enforces approved tags, uniqueness, scoped/full consistency (byoperationIdand route), and raw object equality—without a second operation inventory.Current union counts:
openapi.jsonopenapi-administration.jsonopenapi-full.jsonExtractor 1.9.1 contract churn (no production behavior change)
All of the following come from regenerating with extractor
v1.9.1; runtime handlers were not rewritten for these items:401responses inopenapi.json; 19401+ 19403inopenapi-administration.json(OCS auth documentation).integer/enum [0,1]query params (a,forceIcon,mimeFallback,show*,file/listfilters,deleteFile, …) are now documented asboolean. Nextcloud’s Dispatcher still accepts"true"/"1".default: nullon nullable parameters; some nullable property$refs becomeallOf.libresign-sign-request-uuidonsignature/elements; CORS note text on two descriptions.DocMdpConfig,ReminderSettings,*WriteRequest, …). None were referenced fromsrc/outside generated types.idDocApprovalonPOST /sign/uuid/{uuid}/code, bound as?stringand compared with=== 'true'to matchInjectionMiddleware.🧪 How to test
lib/Controller/use only approved functional tags (and preserve existing scopes).composer run openapi git status --porcelain openapi*.json src/types/openapi/openapi-full.jsonin Swagger UI and verify functional grouping with no legacy tag sections.Validation evidence
tests/php/openapi,SignFileControllerTest)composer psalm,npm run ts:check)⚙️ API / Back-end changes
openapi.json,openapi-administration.json, andopenapi-full.jsonviacomposer openapitests/php/openapi)NoAdminRequired/routes preserved;idDocApprovalkeeps middleware semantics)AGENTS.md)composer openapiwhen necessary🚧 Tasks
#[OpenAPI]attributes^1.9.1and regenerateAPPROVED_TAGS(noLEGACY_TAGS)✅ Checklist
🤖 AI (if applicable)