Skip to content
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

Improvements for failed repo updates #3645

Merged
merged 2 commits into from
Aug 29, 2022

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Aug 24, 2022

Problems

  • Repo.Update defines an inherently incoherent operation: Refreshing metadata from just one repository to the exclusion of any others that may be configured. This is not something you would ever want to do, because you would end up with an incomplete set of modules in your registry. Registry updates should be from all repos or none.
  • Repo updates can't be cancelled, and if one fails, you can't recover

Changes

  • Now the ability to update only one repo in isolation is eliminated
    • Repo.Update is removed
    • The ckan update command no longer takes a parameter and always update all repos
    • ckan update's --all parameter is removed (note that its documentation incorrectly described upgrading modules, which it never did)
  • Now DownloadTarget.filename is used as the default for NetAsyncDownloaderDownloadPart.path, so users of NetAsyncDownloader can find the files they requested
  • Now NetAsyncDownloaderDownloadPart.Done and NetAsyncDownloader.onOneCompleted pass the download's ETag (see Avoid redundant metadata downloads #2682) as a third parameter if available, so users of NetAsyncDownloader can save this information after downloading if desired
  • Now Repo.UpdateAllRepositories accepts a NetAsyncDownloader parameter and uses it to perform its downloads asynchronously, in parallel, with progress bar updates, and with the possibility of cancellation
  • Now Repo.UpdateRegistryFromTarGz is renamed to Repo.ModulesFromTarGz
  • Now Repo.UpdateRegistryFromZip is renamed to Repo.ModulesFromZip
  • Now Repo.ModulesFromTarGz and Repo.ModulesFromZip provide progress bar updates as they process their input files
  • Now the parts of Wait that were specific to CkanModule are made generic and able to handle strings instead
  • Now the DownloadsFailedDialog from Many improvements for failed downloads #3635 is made generic and accepts objects instead of CkanModules, and the module-specific strings it contained are parameters to be supplied by the calling code
    • MainInstall.cs is updated to pass module-specific strings to the DownloadsFailedDialog
  • GUI.Main.UpdateRepo now:
    • Loops inside a transaction to allow retries and rollback
    • Enables the Cancel button in the Wait dialog, and clicking it cancels in progress downloads
    • Calls the DownloadsFailedDialog from Many improvements for failed downloads #3635 to allow the user to retry or abort the refresh or remove a bad repository:
      image
  • minimizeNotifyIcon_BalloonTipClicked is moved from MainRepo.cs to MainTrayIcon.cs because it is about the tray icon

Fixes #1070.
Fixes #1114 (proper transaction handling).
Fixes #1238.
Fixes #1981.

@HebaruSan HebaruSan added Bug Something is not working as intended Enhancement New features or functionality GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN Pull request Registry Issues affecting the registry Network Issues affecting internet connections of CKAN labels Aug 24, 2022
@HebaruSan
Copy link
Member Author

HebaruSan commented Aug 25, 2022

  • Now the DownloadsFailedDialog ... accepts objects instead of CkanModules

Initially I tried using a generic type parameter instead (DownloadsFailedDialog<T>), but this wreaked havoc with i18n since the resource manager looks up strings based on Type.

Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

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

Looks sensible to me 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality GUI Issues affecting the interactive GUI Network Issues affecting internet connections of CKAN Registry Issues affecting the registry
Projects
None yet
2 participants