Code Monkey home page Code Monkey logo

cld-migrate-remote-assets-in-bulk's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cld-migrate-remote-assets-in-bulk's Issues

Support mapping of structured metadata fields (from labels to external ids)

Problem

When importing structured metadata, Cloudinary requires you to use the external_ids for the field and field options (for enum and set fields). This is currently possible for the field names but becomes cumbersome for the field options.

I believe building in functionality to automatically map labels to external ids will be a good addition to the help speed up the migration process

Potential solutions

There are a number of possible solutions (my initial thoughts listed below):

  1. Low touch: Pass a metadata object to input2ApiPayload to allow the user to map the external ids (without the need to call the Admin API on each load)
  2. Medium touch: Create helper functions to get the external ids, for example getFieldExternalId and getFieldValueExternalId
  3. Higher touch: Create a function that takes a JSON object and converts of the metadata (using labels) and converts it to external ids. This object can then be merged with other metadata values input2ApiPayload
  4. Highest touch: Somehow we preprocess the row and pass the "initial" upload parameters that the user can then modify in input2ApiPayload. This could review each column in the CSV and try to map it to the expected upload parameters, this could be used for metadata but also Display name, resource type etc.

Explicitly assign status (& operation)

          Having "MIGRATED' as the default feels risky to me.

Should this not be set after we have the response?

I see there being 4 status':

  • MIGRATED = New upload of an asset
  • OVERWRITTEN = Public id already existed and overwrite was set to true (overwritten is in the response object)
  • ALREADY EXISTED = Public id already existed and overwrite was set to false (existing is in the response object)
  • FAILED = Error occurred

Originally posted by @mgriff in #7 (comment)

Add support for reading compressed CSV files

Some customers may have very large manifest files. In such a case, it may be useful to consider reading from the compressed manifest file and save disk space.

This could be an optional flag for the CLI.

Support auto generation of the log folders

When running the migration I don't want to have to set the log folder each time, I end up using a numbering system (i.e. run1, run2, run3) which doesn't add much value.

I propose we add an option to use a default folder path, initially still using the output-folder parameter but potentially making it the default in the future.

I propose we use the following format: logs/<cloud_name>/<todays_date>/<current_time>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.