Skip to content

Pilot 6552: update upload preupload logic to batchly create resumable_info.json#207

Merged
colorzzr merged 8 commits intodevelopfrom
PILOT-6552
Mar 19, 2025
Merged

Pilot 6552: update upload preupload logic to batchly create resumable_info.json#207
colorzzr merged 8 commits intodevelopfrom
PILOT-6552

Conversation

@colorzzr
Copy link
Copy Markdown
Member

Summary

Previously, the preupload logic will generate resumable_info.json after all preupload finished. But if any batch raises error or gets interrupted, users will lose current upload completely. To resolve this, cli add a new field to keep track unregistered_item at local and update resumable_info.json per batch:

        manifest_json = {
            'project_code': self.project_code,
            'operator': self.operator,
            'zone': self.zone,
            'parent_folder_id': self.parent_folder_id,
            'current_folder_node': self.current_folder_node,
            'tags': self.tags,
            'registered_items': {file_object.item_id: file_object.to_dict() for file_object in registered_items},
            'unregistered_items': {file_object.local_path: file_object.to_dict() for file_object in unregistered_items},
            'attributes': self.attributes if self.attributes else {},
            'resumable_manifest_file': output_path,
        }

JIRA Issues

PILOT_6552

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Refactor or reformatting

Testing

Are there any new or updated tests to validate the changes?

  • Yes
  • No

Test Directions

add test cases to make sure outputs contains unregistered_items

@colorzzr colorzzr added the enhancement New feature or request label Mar 11, 2025
@colorzzr colorzzr requested a review from afmam March 11, 2025 13:24
@colorzzr colorzzr self-assigned this Mar 11, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 11, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py00100% 
pilotcli.py0590%5, 7–10, 12–18, 21–22, 24–25, 27–28, 30–34, 36–39, 41, 43–44, 46–47, 50, 53–57, 59, 61–64, 66–71, 74–80, 83–85
commands
   __init__.py00100% 
   container_registry.py01959%16, 22–24, 31–33, 41–44, 50–53, 62–65
   dataset.py0989%20, 38–39, 47, 82–83, 92, 126, 130
   entry_point.py01185%41, 47, 75, 98–100, 102–106
   file.py03887%48, 159–162, 166, 171, 174–176, 319–326, 328, 330, 344–350, 352, 381, 383, 387, 433, 436, 451–453, 459–460
   folder.py0196%23
   project.py0295%18, 61
   user.py0982%27, 44–45, 53–54, 62–63, 84–85
configs
   __init__.py00100% 
   app_config.py00100% 
   config.py00100% 
   user_config.py02382%35, 75, 84, 95, 128, 137–138, 141, 151, 157, 161, 165, 169, 173–174, 178, 182–183, 187, 191–192, 200, 204
   utils.py03536%13–14, 16–19, 22–23, 25, 27, 31–32, 34, 36–37, 40, 43, 45–47, 49–51, 54–57, 59, 67, 69–72, 74–75
models
   __init__.py00100% 
   enums.py00100% 
   item.py00100% 
   service_meta_class.py0180%9
   singleton.py00100% 
   upload_form.py0433%28, 40–42
resources
   custom_error.py00100% 
   custom_help.py00100% 
services
   __init__.py00100% 
services/clients
   __init__.py00100% 
   base_auth_client.py0196%54
   base_client.py0295%53, 104
services/container_registry_manager
   container_registry_manager.py010817%19–20, 23–26, 29–33, 36–44, 48–60, 62–64, 68–82, 84–86, 90–99, 101–103, 107–110, 125–136, 140–143, 147–162, 164, 166–169
services/crypto
   __init__.py00100% 
   crypto.py01940%35, 43–47, 49, 59–61, 69–75, 77–78
services/dataset_manager
   dataset_detail.py02271%38, 59, 66–71, 73–75, 77–86, 88
   dataset_download.py02282%53, 63–65, 74–76, 92, 94–95, 97–98, 100, 102–104, 112–115, 149, 164
   dataset_list.py0881%36–41, 43, 52
   model.py00100% 
services/file_manager
   __init__.py00100% 
   file_list.py01285%60–66, 86–88, 100, 102
   file_manifests.py08031%18–23, 43–47, 51–57, 59, 63–68, 70, 74–75, 79–83, 85, 88, 90–91, 93–94, 96–99, 104–110, 115–120, 123–129, 131–133, 136–142, 144–146, 148–151
   file_tag.py04031%23–24, 28–32, 34, 37–49, 51–53, 55–56, 60–62, 65–69, 71–74, 76–77
services/file_manager/file_download
   __init__.py00100% 
   download_client.py010555%52–61, 79–80, 122–126, 128–130, 142–143, 148–149, 153–162, 165–170, 180–181, 212, 217, 223–233, 235–236, 239–240, 245–246, 250–255, 259–260, 263–265, 267–278, 285, 290, 305, 309–311, 313–326, 328
   model.py00100% 
services/file_manager/file_metadata
   __init__.py00100% 
   file_metadata_client.py0395%98–100
   folder_client.py0491%50, 79–81
services/file_manager/file_move
   __init__.py00100% 
   file_move_client.py03759%60–64, 66, 74, 79–83, 86–94, 96, 98–103, 114, 116–120, 122, 172–173
services/file_manager/file_trash
   __init__.py00100% 
   file_trash_client.py0296%69, 90
   utils.py0392%39, 63, 70
services/file_manager/file_upload
   __init__.py00100% 
   exception.py00100% 
   file_upload.py02687%38–45, 103–105, 117, 142, 167–169, 198–199, 208, 213, 414–416, 425, 428, 432
   models.py0296%24, 44
   upload_client.py04877%106–109, 149, 221, 234–235, 237–251, 253, 255–259, 261–265, 267–268, 369–370, 372, 442, 448–449, 454–457, 459–460
   upload_validator.py01176%46–52, 55–56, 61, 63
services/logger_services
   __init__.py00100% 
   debugging_log.py00100% 
   log_functions.py00100% 
services/output_manager
   __init__.py00100% 
   error_handler.py00100% 
   help_page.py0791%13–17, 19, 21
   message_handler.py05673%24, 46, 51, 66–68, 73, 83, 88, 101, 106, 113, 118, 123, 127, 143, 178, 188, 197, 215, 237, 281–292, 303–308, 310–316, 327, 331–332, 336–337, 339–340, 344, 348, 352
services/project_manager
   __init__.py00100% 
   project.py0684%40, 46–47, 49–51
services/user_authentication
   __init__.py00100% 
   decorator.py0293%27, 30
   token_manager.py0888%42–46, 73–74, 91
   user_login_logout.py01684%29–30, 41, 126, 130–136, 138–140, 144–145
utils
   __init__.py00100% 
   aggregated.py02684%56, 66–68, 82–84, 116, 130–131, 144, 168–175, 177–178, 206, 214, 231–232, 270
TOTAL369288775% 

Copy link
Copy Markdown
Member

@afmam afmam left a comment

Choose a reason for hiding this comment

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

Left a few comments

@colorzzr colorzzr requested a review from afmam March 17, 2025 14:58
Copy link
Copy Markdown
Member

@afmam afmam left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes! LGTM

@colorzzr colorzzr merged commit 4ca276c into develop Mar 19, 2025
1 check passed
@colorzzr colorzzr deleted the PILOT-6552 branch March 19, 2025 15:28
colorzzr added a commit that referenced this pull request Mar 27, 2025
* Pilot 7101: Update the message of new version notification (#210)

* build on testing

* build on testing

* remove the testing code

* update new version notification

* remove the testing pipeline

* Pilot 6552: update upload preupload logic to batchly create `resumable_info.json` (#207)

* update manifest logic to output resumable information after each batch

* update test cases for new resumable upload files

* bumpup version

* update PR

* fixup test cases due to new output

* merged

* Pilot 7234: Add git actions to automatically extract compatible version from PR into release note and README (#216)

* Pilot 7234: add pipeline to automatically extract compatible version to README and Release Note (#211)

* test on git actions

* test on git actions

* Updated compatible_version.md with PR #

* test actions on pull request

* test actions on pull request

* update git actions

* Updated docs/compatible_version.md with PR #

* testing

* Updated docs/compatible_version.md with PR #

* modify the pipeline file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Updated docs/compatible_version.md with PR #211

* embed the compatible table into README.md

* embed the compatible table into README.md (#212)

* Updated docs/compatible_version.md with PR #212

* add pipeline to add version in cli binary release

* Patch20250318 (#213)

* embed the compatible table into README.md

* add pipeline to add version in cli binary release

* Updated docs/compatible_version.md with PR #213

* fixup the table will truncate the readme

* Patch20250318: fixup the table will truncate the readme (#214)

* embed the compatible table into README.md

* add pipeline to add version in cli binary release

* fixup the table will truncate the readme

* Updated docs/compatible_version.md with PR #214

* add PR related in build and publish

* remove the testing branch

* update compatible version as NDJSON format for later api design

* update compatible version as NDJSON format for later api design

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* update git action (#221)

* use github actions as commit user

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
colorzzr added a commit that referenced this pull request Mar 27, 2025
* Pilot 7101: Update the message of new version notification (#210)

* build on testing

* build on testing

* remove the testing code

* update new version notification

* remove the testing pipeline

* Pilot 6552: update upload preupload logic to batchly create `resumable_info.json` (#207)

* update manifest logic to output resumable information after each batch

* update test cases for new resumable upload files

* bumpup version

* update PR

* fixup test cases due to new output

* merged

* Pilot 7234: Add git actions to automatically extract compatible version from PR into release note and README (#216)

* Pilot 7234: add pipeline to automatically extract compatible version to README and Release Note (#211)

* test on git actions

* test on git actions

* Updated compatible_version.md with PR #

* test actions on pull request

* test actions on pull request

* update git actions

* Updated docs/compatible_version.md with PR #

* testing

* Updated docs/compatible_version.md with PR #

* modify the pipeline file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Updated docs/compatible_version.md with PR #211

* embed the compatible table into README.md

* embed the compatible table into README.md (#212)

* Updated docs/compatible_version.md with PR #212

* add pipeline to add version in cli binary release

* Patch20250318 (#213)

* embed the compatible table into README.md

* add pipeline to add version in cli binary release

* Updated docs/compatible_version.md with PR #213

* fixup the table will truncate the readme

* Patch20250318: fixup the table will truncate the readme (#214)

* embed the compatible table into README.md

* add pipeline to add version in cli binary release

* fixup the table will truncate the readme

* Updated docs/compatible_version.md with PR #214

* add PR related in build and publish

* remove the testing branch

* update compatible version as NDJSON format for later api design

* update compatible version as NDJSON format for later api design

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* update git action (#221)

* use github actions as commit user

* directly parse of version from .toml file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants