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

Add export estimation #135

Merged
merged 22 commits into from
Jun 10, 2022
Merged

Add export estimation #135

merged 22 commits into from
Jun 10, 2022

Conversation

come-nc
Copy link
Collaborator

@come-nc come-nc commented Apr 28, 2022

  • Cache size estimates
  • Estimation from FilesMigrator should exclude existing export file if any
  • Use GET with query params for endpoint

Requires:

Add a controller method to get an estimation of export size before exporting.

@come-nc come-nc added the 3. to review Waiting for reviews label Apr 28, 2022
@come-nc come-nc self-assigned this Apr 28, 2022
@come-nc
Copy link
Collaborator Author

come-nc commented Apr 28, 2022

  • Estimation from FilesMigrator should exclude existing export file if any

@come-nc come-nc mentioned this pull request Apr 28, 2022
2 tasks
@Pytal Pytal self-assigned this Apr 29, 2022
@Pytal Pytal added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 29, 2022
@Pytal Pytal force-pushed the enh/add-export-estimation branch 2 times, most recently from ff4986d to 6ed2e8e Compare April 30, 2022 00:35
@Pytal
Copy link
Member

Pytal commented Apr 30, 2022

  • Use $userFolder->getFreeSpace() instead of $storageInfo

@Pytal Pytal added 3. to review Waiting for reviews enhancement New feature request and removed 2. developing Work in progress labels Apr 30, 2022
@come-nc
Copy link
Collaborator Author

come-nc commented May 2, 2022

@Pytal I think the API should expose getting the export size estimate as it may be useful for several things in UI, showing the estimate is a good idea in my opinion, and later we may want to compare it with current export size to have some kind of a progress bar? (Maybe not as a progress bar but as current size vs expected size at least to have a feeling of how it goes.)

@Pytal
Copy link
Member

Pytal commented May 3, 2022

@come-nc let's discuss the details more post release freeze 🚀

come-nc and others added 12 commits June 2, 2022 01:57
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal removed the 3. to review Waiting for reviews label Jun 2, 2022
@Pytal Pytal added the 2. developing Work in progress label Jun 2, 2022
@Pytal Pytal force-pushed the enh/add-export-estimation branch from 6ed2e8e to f8c2260 Compare June 2, 2022 03:02
Pytal added 5 commits June 3, 2022 00:42
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Avoids having to query multiple endpoints on the client for closely related information

Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal force-pushed the enh/add-export-estimation branch from f8c2260 to 3858dd9 Compare June 3, 2022 00:42
Pytal added 2 commits June 3, 2022 01:02
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal
Copy link
Member

Pytal commented Jun 3, 2022

HTTP query example

curl "http://<uid>:<password>@<domain_name>/ocs/v2.php/apps/user_migration/api/v1/export?migrators[]=files&migrators[]=contacts" \
      -H "OCS-APIRequest: true" \
      -H "Accept: application/json"

@Pytal Pytal added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 3, 2022
@Pytal Pytal self-requested a review June 3, 2022 01:31
@Pytal
Copy link
Member

Pytal commented Jun 3, 2022

@come-nc please review and since you can't approve as the author just comment instead

lib/Controller/ApiController.php Show resolved Hide resolved
lib/Controller/ApiController.php Outdated Show resolved Hide resolved
lib/Migrator/FilesMigrator.php Show resolved Hide resolved
lib/Migrator/FilesMigrator.php Show resolved Hide resolved
lib/Service/UserMigrationService.php Show resolved Hide resolved
Pytal added 3 commits June 8, 2022 00:48
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal force-pushed the enh/add-export-estimation branch from 48ae999 to 85c551b Compare June 8, 2022 01:12
@come-nc
Copy link
Collaborator Author

come-nc commented Jun 9, 2022

@come-nc please review and since you can't approve as the author just comment instead

Approved

@Pytal Pytal merged commit 1650884 into main Jun 10, 2022
@Pytal Pytal deleted the enh/add-export-estimation branch June 10, 2022 02:28
@Pytal Pytal added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 10, 2022
@Pytal
Copy link
Member

Pytal commented Jun 10, 2022

/backport to stable24

@backportbot-nextcloud backportbot-nextcloud bot added the backport-request A backport was requested for this pull request label Jun 10, 2022
@backportbot-nextcloud backportbot-nextcloud bot removed the backport-request A backport was requested for this pull request label Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants