Skip to content

fix: log model download URL and destination - #1564

Merged
marcelklehr merged 2 commits into
nextcloud:mainfrom
RSKKSOFFICIAL:fix/1403-log-model-download-info
Sep 3, 2026
Merged

marcelklehr merged 2 commits into
nextcloud:mainfrom
RSKKSOFFICIAL:fix/1403-log-model-download-info

Conversation

@RSKKSOFFICIAL

Copy link
Copy Markdown

Summary

Fixes #1403.

The recognize:download-models command 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:

  • The existing models directory being removed
  • The model archive download URL
  • The archive destination path
  • The model extraction path

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

Signed-off-by: RSKKSOFFICIAL <rsksofficial02@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-models console 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 {
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be nice indeed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marcelklehr! Added the @PARAM annotation for $log to the docblock.

Comment thread lib/Service/DownloadModelsService.php
Comment thread lib/Service/DownloadModelsService.php
Comment thread lib/Command/DownloadModels.php
@marcelklehr
marcelklehr merged commit 0754b29 into nextcloud:main Sep 3, 2026
41 of 42 checks passed
@marcelklehr

Copy link
Copy Markdown
Member

Thank you! 💙

@RSKKSOFFICIAL
RSKKSOFFICIAL deleted the fix/1403-log-model-download-info branch September 5, 2026 07:53
@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@RSKKSOFFICIAL

RSKKSOFFICIAL commented Sep 14, 2026 via email

Copy link
Copy Markdown
Author

@marcelklehr

Copy link
Copy Markdown
Member

There was an error while submitting the form

Oh, darn, thanks for notifying us!

@RSKKSOFFICIAL

RSKKSOFFICIAL commented Sep 15, 2026 via email

Copy link
Copy Markdown
Author

@marcelklehr

Copy link
Copy Markdown
Member

I have applied for the Backend Engineer – Integration & AI role

Wow, super cool, Ravi! Our HR department is currently severly understaffed, sadly, so it can take some time, I'm afraid. But you definitely should get a response in the next two weeks, I'd assume.

@RSKKSOFFICIAL

RSKKSOFFICIAL commented Sep 15, 2026 via email

Copy link
Copy Markdown
Author

@marcelklehr

Copy link
Copy Markdown
Member

Any important things that I should be preparing of in the meantime?

I don't think so, you will likely get a coding challenge at some point, but with your experience in contributing to our apps, that should not be a problem :)

@RSKKSOFFICIAL

RSKKSOFFICIAL commented Sep 15, 2026 via email

Copy link
Copy Markdown
Author

@RSKKSOFFICIAL

Copy link
Copy Markdown
Author

Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Hi @marcelklehr , this got fixed.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print model downloads URLs and destination

4 participants