fix: log model download URL and destination - #1564
Open
RSKKSOFFICIAL wants to merge 1 commit into
Open
Conversation
Signed-off-by: RSKKSOFFICIAL <rsksofficial02@gmail.com>
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adds optional, user-visible logging to the model download flow so recognize:download-models prints the archive URL and relevant filesystem paths (Fixes #1403).
Changes:
- Extend
DownloadModelsService::download()to accept an optional logger callback. - Emit log messages for model directory removal, archive download URL/path, and extraction path.
- Wire the callback to
occ recognize:download-modelsconsole output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lib/Service/DownloadModelsService.php | Adds optional callback-based logging around model download/extract steps. |
| lib/Command/DownloadModels.php | Passes a console logger callback so messages are printed during the CLI command. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
26
to
+31
| * @return void | ||
| * @throws \Exception | ||
| */ | ||
| public function download() : void { | ||
| public function download(?callable $log = null) : void { | ||
| $log ??= static function (string $message): void { | ||
| }; |
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
Fixes #1403.
The
recognize:download-modelscommand previously did not show the model download URL and destination path.This change adds optional logging to
DownloadModelsService::download()and wires it to the console command output.The command now reports:
This makes it possible to identify the exact URL and paths when the Nextcloud instance does not have direct Internet access.
Testing
Tested locally with:
docker compose exec --user www-data nextcloud php occ recognize:download-models