fix(taskprocessing): use the event for AppAPI to get list of AI providers#52050
Merged
oleksandr-nc merged 1 commit intomasterfrom Apr 10, 2025
Merged
fix(taskprocessing): use the event for AppAPI to get list of AI providers#52050oleksandr-nc merged 1 commit intomasterfrom
oleksandr-nc merged 1 commit intomasterfrom
Conversation
cc9d5e7 to
29d07ed
Compare
marcelklehr
reviewed
Apr 9, 2025
marcelklehr
requested changes
Apr 9, 2025
Member
marcelklehr
left a comment
There was a problem hiding this comment.
Can we extend the tests for this?
29d07ed to
8468a4e
Compare
Contributor
Author
I think it might be more effective to place the integration tests in the AppAPI or ExApps repositories, where they can actually validate the Provider registration end-to-end. Mocking the tests here might not fully cover both parts of the system, and events system in the Nextcloud Server is already covered with tests. |
8468a4e to
a639015
Compare
…ders Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
a639015 to
c23ab0d
Compare
Contributor
Author
|
/backport to stable31 |
Merged
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
Currently, external Task Processing providers (like those from AppAPI ExApps) might need to be loaded and registered on every request during AppAPI bootstrap, potentially impacting performance. This PR introduces an event-driven mechanism to allow the core Task Processing Manager to discover these providers on demand.
New Event: Introduced
OCP\TaskProcessing\Events\GetTaskProcessingProvidersEvent. This event is dispatched by the Manager when it needs to build the list of available providers and task types.A request-scoped static cache within
dispatchGetProvidersEventprevents redundant dispatching within the same request twice(fisrt time for Providers list and second time for custom TasksTypes list)TODO
Checklist