-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
enh(TextProcessing): Add two new provider interfaces #41271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
181f819
enh(TextProcessing): Add IProvider2
marcelklehr d11b9cb
fix(TextProcessing/Manager): Throw TaskFailureException upon failure
marcelklehr 26a659d
fix(TextProcessing/Manager): add canuseProvider check in getPreferred…
marcelklehr 1476a72
fix(TextProcessing/ migration): add check whether new column exists a…
marcelklehr b01e0c3
enh: update openapi.json
marcelklehr fecf642
fix: psalm issues and coding style
marcelklehr 17e7b6c
fix: split IProvider2 into two more verbose interfaces
marcelklehr b8862bd
fix coding style
marcelklehr 8c0c426
Merge branch 'master' into enh/text-processing-iprovider2
marcelklehr 12c558f
Update lib/private/TextProcessing/Manager.php
marcelklehr 6fbf430
Update lib/private/TextProcessing/Manager.php
marcelklehr a29ed70
Update lib/public/TextProcessing/IProviderWithUserId.php
marcelklehr b45007f
Merge branch 'master' into enh/text-processing-iprovider2
marcelklehr 5704281
fix: Update autoloaders
marcelklehr 017f136
fix: Don't try to access undefined array key
marcelklehr 2031fe1
fix: Make sure array starts at 0 after array filter
marcelklehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * @copyright Copyright (c) 2023 Marcel Klehr <[email protected]> | ||
| * | ||
| * @author Marcel Klehr <[email protected]> | ||
| * | ||
| * @license GNU AGPL version 3 or any later version | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| * | ||
| */ | ||
|
|
||
| namespace OC\Core\Migrations; | ||
|
|
||
| use Closure; | ||
| use OCP\DB\ISchemaWrapper; | ||
| use OCP\DB\Types; | ||
| use OCP\Migration\IOutput; | ||
| use OCP\Migration\SimpleMigrationStep; | ||
|
|
||
| /** | ||
| * Introduce completion_expected_at column in textprocessing_tasks table | ||
| */ | ||
| class Version28000Date20231103104802 extends SimpleMigrationStep { | ||
| /** | ||
| * @param IOutput $output | ||
| * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
| * @param array $options | ||
| * @return null|ISchemaWrapper | ||
| */ | ||
| public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
| /** @var ISchemaWrapper $schema */ | ||
| $schema = $schemaClosure(); | ||
| if ($schema->hasTable('textprocessing_tasks')) { | ||
| $table = $schema->getTable('textprocessing_tasks'); | ||
|
|
||
| $table->addColumn('completion_expected_at', Types::DATETIME, [ | ||
| 'notnull' => false, | ||
| ]); | ||
marcelklehr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| return $schema; | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
| } | ||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * @copyright Copyright (c) 2023 Marcel Klehr <[email protected]> | ||
| * | ||
| * @author Marcel Klehr <[email protected]> | ||
| * | ||
| * @license GNU AGPL version 3 or any later version | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
|
|
||
| namespace OCP\TextProcessing; | ||
|
|
||
| /** | ||
| * This interface supersedes IProvider. It allows the system to learn | ||
| * the provider's expected runtime and lets the provider know which user is running a task | ||
| * @since 28.0.0 | ||
| * @template T of ITaskType | ||
| * @template-extends IProvider<T> | ||
| */ | ||
| interface IProvider2 extends IProvider { | ||
marcelklehr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /** | ||
| * @param ?string $userId the current user's id | ||
| * @since 28.0.0 | ||
| */ | ||
| public function setUserId(?string $userId): string; | ||
|
|
||
| /** | ||
| * @return int The expected average runtime of a task in seconds | ||
| * @since 28.0.0 | ||
| */ | ||
| public function getExpectedRuntime(): int; | ||
marcelklehr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.