Skip to content

use SQLITE_DATABASE resource type, to permit larger file uploads #6098

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

Merged

Conversation

jordanverasamy
Copy link
Contributor

@jordanverasamy jordanverasamy commented Jul 11, 2025

WHY are these changes introduced?

Fixes https://github.com/Shopify/workflows-operations/issues/3359

WHAT is this pull request doing?

This PR updates the SQLite file upload functionality to:

  1. Use the SQLITE_DATABASE resource type instead of FILE for staged uploads
  2. Increase the maximum file size limit from 20MB to 300MB
  3. Add API version parameter to the staged upload request (using 'unstable')
  4. Fix the resource URL construction by appending the key parameter value
  5. TEMPORARILY Add SQLite-specific types until SQLITE_DATBASE resource type visibility changes are in place

How to test your changes?

npm shopify store copy --from-file file_bigger_than_20_mb_smaller_than_300mb.sqlite --to-store target_store
with an sqlite file

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

jordanverasamy commented Jul 11, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jordanverasamy jordanverasamy changed the title use SQLITE_DATABASE resource type for createStagedUpload [wip] use SQLITE_DATABASE resource type, to permit files up to 10GB! Jul 11, 2025
Copy link
Contributor

github-actions bot commented Jul 11, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.25% 13040/16665
🟡 Branches 72.42% 6348/8765
🟡 Functions 78.2% 3375/4316
🟡 Lines 78.66% 12349/15699

Test suite run success

3037 tests passing in 1318 suites.

Report generated by 🧪jest coverage report action from 2468e7c

@odacrem
Copy link
Contributor

odacrem commented Jul 12, 2025

?  Import data from large.sqlite to pablo-dev-store-10.myshopify.com?
✔  Yes, import

╭─ info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                           │
│  Import Operation                                                                                                                                                                         │
│                                                                                                                                                                                           │
│  From: large.sqlite                                                                                                                                                                       │
│  To:   pablo-dev-store-10.myshopify.com                                                                                                                                                   │
│                                                                                                                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯


╭─ error ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                           │
│  Operation failed                                                                                                                                                                         │
│                                                                                                                                                                                           │
│                                                                                                                                                                                           │
│  The Admin GraphQL API responded unsuccessfully with errors:                                                                                                                              │
│                                                                                                                                                                                           │
│  [                                                                                                                                                                                        │
│    {                                                                                                                                                                                      │
│      "message": "Variable $input of type [StagedUploadInput!]! was provided invalid value for 0.resource (Expected \"SQLITE_DATABASE\" to be one of: COLLECTION_IMAGE, FILE, IMAGE,       │
│  MODEL_3D, PRODUCT_IMAGE, SHOP_IMAGE, VIDEO, BULK_MUTATION_VARIABLES, RETURN_LABEL, URL_REDIRECT_IMPORT)",                                                                                │
│      "locations": [                                                                                                                                                                       │
│        {                                                                                                                                                                                  │
│          "line": 1,                                                                                                                                                                       │
│          "column": 30                                                                                                                                                                     │
│        }                                                                                                                                                                                  │
│      ],                                                                                                                                                                                   │
│      "extensions": {                                                                                                                                                                      │
│        "value": [                                                                                                                                                                         │
│          {                                                                                                                                                                                │
│            "resource": "SQLITE_DATABASE",                                                                                                                                                 │
│            "filename": "database.sqlite",                                                                                                                                                 │
│            "mimeType": "application/x-sqlite3",                                                                                                                                           │
│            "httpMethod": "POST",                                                                                                                                                          │
│            "fileSize": "24006656"                                                                                                                                                         │
│          }                                                                                                                                                                                │
│        ],                                                                                                                                                                                 │
│        "problems": [                                                                                                                                                                      │
│          {                                                                                                                                                                                │
│            "path": [                                                                                                                                                                      │
│              0,                                                                                                                                                                           │
│              "resource"                                                                                                                                                                   │
│            ],                                                                                                                                                                             │
│            "explanation": "Expected \"SQLITE_DATABASE\" to be one of: COLLECTION_IMAGE, FILE, IMAGE, MODEL_3D, PRODUCT_IMAGE, SHOP_IMAGE, VIDEO, BULK_MUTATION_VARIABLES, RETURN_LABEL,   │
│  URL_REDIRECT_IMPORT"                                                                                                                                                                     │
│          }                                                                                                                                                                                │
│        ]                                                                                                                                                                                  │
│      }                                                                                                                                                                                    │
│    }                                                                                                                                                                                      │
│  ]                                                                                                                                                                                        │
│                                                                                                                                                                                           │
│  Request ID: 198e8bea-0669-4eb9-8604-36a5604c8e6c-1752292381                                                                                                                              │
│                                                                                                                                                                                           │
│                                                                                                                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Sadly there is more to be done here methinks; when I run this command I get the above error.

Copy link
Contributor Author

Sadly you're right :( I have no idea why though, I was pretty convinced this should work.

It should just require bulk_data_transfer_public to be visible:
https://github.com/shop/world/blob/main/areas/core/shopify/components/platform/admin/app/models/graph_api/admin/upload_resource.rb#L181-L188

And that is manually set to true for the CLI app: https://experiments.shopify.com/flags/bulk_data_transfer_public

@rzaharenkov any idea why this isn't visible to the CLI? 🤔

Copy link
Contributor Author

@alexcwatt alexcwatt force-pushed the submit-correct-resource-type-when-creating-staged-upload branch from f23e3c0 to e1dc115 Compare July 14, 2025 16:45
@skelley-ton skelley-ton changed the title [wip] use SQLITE_DATABASE resource type, to permit files up to 10GB! use SQLITE_DATABASE resource type, to permit files up to 300MB Jul 14, 2025
@odacrem odacrem changed the base branch from main to graphite-base/6098 July 14, 2025 21:14
@odacrem odacrem force-pushed the submit-correct-resource-type-when-creating-staged-upload branch from a92bd5f to bc3f5fb Compare July 14, 2025 21:14
@odacrem odacrem changed the base branch from graphite-base/6098 to ea-release July 14, 2025 21:14
@odacrem odacrem mentioned this pull request Jul 14, 2025
@odacrem odacrem changed the title use SQLITE_DATABASE resource type, to permit files up to 300MB use SQLITE_DATABASE resource type, to permit larger file uploads Jul 14, 2025
@odacrem odacrem marked this pull request as ready for review July 14, 2025 22:36
@odacrem odacrem requested review from a team as code owners July 14, 2025 22:36
@odacrem odacrem requested review from odacrem and rzaharenkov July 14, 2025 22:36
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@odacrem odacrem force-pushed the submit-correct-resource-type-when-creating-staged-upload branch from 3ff75e3 to 524454a Compare July 14, 2025 23:01
@odacrem odacrem changed the base branch from ea-release to graphite-base/6098 July 14, 2025 23:01
@odacrem odacrem force-pushed the submit-correct-resource-type-when-creating-staged-upload branch from 524454a to 2468e7c Compare July 14, 2025 23:01
@odacrem odacrem force-pushed the graphite-base/6098 branch from 8dacb01 to 51c1ebb Compare July 14, 2025 23:01
@odacrem odacrem changed the base branch from graphite-base/6098 to main July 14, 2025 23:01
@odacrem odacrem added this pull request to the merge queue Jul 14, 2025
Merged via the queue into main with commit 1374c93 Jul 14, 2025
31 checks passed
@odacrem odacrem deleted the submit-correct-resource-type-when-creating-staged-upload branch July 14, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants