Repository navigation
Conversation
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>
Codex Review SummaryThis 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".
| 'certificates' => 12, | ||
| 'documents' => 6, | ||
| 'identity' => 14, | ||
| 'notifications' => 3, |
There was a problem hiding this comment.
Classify both omitted endpoints before finalizing the taxonomy
When composer openapi:check-tags (now part of make check) runs, it fails: the generated specs still tag notify-status and signature_elements-use-saved-signature-elements as notify and signature_elements, since NotifyController::status() and SignatureElementsController::useSavedSignatureElements() lack method-level functional tags; the golden inventory here also accounts for only 88 of the 90 operations. Add the two source attributes and map entries so these operations no longer remain in legacy Swagger groups and the new check passes.
AGENTS.md reference: AGENTS.md:L82-L88
Useful? React with 👍 / 👎.
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>
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.
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>
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.
| 'footer_template-get-footer-template', | ||
| ]; | ||
|
|
||
| public const EXPECTED_OPERATION_TAGS = [ |
There was a problem hiding this comment.
Blocking — avoid maintaining a second endpoint registry. EXPECTED_OPERATION_TAGS duplicates the operations already defined by controller attributes and generated OpenAPI specifications. Adding a correctly tagged endpoint will fail until this list is edited. Please remove this inventory and collectGoldenMapErrors(), and validate operations directly from the generated specs. Keep checks for approved tags, missing or multiple tags, and duplicates.
| 'verification', | ||
| ]; | ||
|
|
||
| public const EXPECTED_UNION_COUNTS = [ |
There was a problem hiding this comment.
Blocking — remove hardcoded operation counts. EXPECTED_UNION_COUNTS makes a valid new endpoint fail CI merely because the number of operations in its category changed. Please remove fixed totals and associated assertions. If useful for diagnostics, calculate counts dynamically.
| * @param list<array{operationId: string, method: string, path: string, tags: list<string>}> $operations | ||
| * @return array<string, array{operationId: string, method: string, path: string, tags: list<string>}> | ||
| */ | ||
| public static function indexById(array $operations): array { |
There was a problem hiding this comment.
indexById() silently overwrites entries with the same operationId. Please validate duplicates before indexing and when combining scoped specifications, so collisions cannot be hidden. Compare method/path identities where needed instead of relying only on an associative map keyed by operationId.
vitormattos
left a comment
There was a problem hiding this comment.
Additional file-specific cleanup suggestion.
|
|
||
| - name: Get php version | ||
| id: php_versions | ||
| @@ -84,6 +85,9 @@ |
There was a problem hiding this comment.
This .patch file duplicates the change already applied to .github/workflows/openapi.yml. Please remove this artifact unless it is actually consumed by a documented build or maintenance process.
There was a problem hiding this comment.
Kept on purpose. sync-workflow-templates.yml reapplies .github/workflows/*.yml.patch after syncing the organization template.
Without this file, the next workflow sync would drop both submodules: true and the OpenAPI PHPUnit step from openapi.yml.
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>
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.Contract inventory (paths, methods,
operationIds, schemas, security, and API scopes) is unchanged aside from tags/tag metadata. Current union counts:appearancecertificatesdocumentsidentitynotificationspoliciesrequestssigningsystemverificationopenapi.json: 69 ·openapi-administration.json: 21 ·openapi-full.json: 89(known extractor omission in full:
footer_template-get-footer-template)Also adds:
composer openapi:check-tags/make openapi-check-tagswith a goldenoperationId→ tag mapCONTRIBUTING.md/AGENTS.mdfor classifying future endpoints🧪 How to test
lib/Controller/use only approved functional tags (and preserve any existingSCOPE_ADMINISTRATION/SCOPE_IGNORE).composer run openapi git status --porcelain openapi*.json src/types/openapi/OpenAPI functional tags OKwith the counts above.openapi-full.jsonin Swagger UI and verify grouping, for example:GET .../notify/statusunder notificationsPOST .../signature/elements/savedunder appearanceaccount,admin,file,notify,signature_elementsValidation evidence
⚙️ API / Back-end changes
openapi.json,openapi-administration.json, andopenapi-full.jsonviacomposer openapitests/openapi/check-functional-tags.phpgolden map + vocabulary checks)NoAdminRequired/routes preserved; no auth behavior changes)CONTRIBUTING.md,AGENTS.md)composer openapiwhen necessary🚧 Tasks
#[OpenAPI]attributes✅ Checklist
🤖 AI (if applicable)