GithubHelp home page GithubHelp logo

drudog's People

Contributors

dependabot[bot] avatar mstrelan avatar

Watchers

 avatar

drudog's Issues

Migrate ingredients and mash steps in to paragraphs

We need to migrate data in to the compound fields added in #1. It seems the json migrate source isn't up to the task as we can't associate the migrated paragraphs with their beer. Might need to convert the json to xml and use xpath.

Handle multiple yeast additions

There are some recipes that use more than one yeast. These are listed in PunkAPI as a single item separated by an ampersand:

Wyeast 1056 - American Ale™ & Wyeast 1272 - American Ale II™

It might be nice to explode this to an array and allow multiple values for the Yeast field.

Determine image storage solution

The PunkAPI specifies an image_url key. Can we use the media module to load a remote URL or should we just download it to a local image field?

Date format of first_brewed field is inconsistent

Some recipes have a month and a year, others only have a year. This makes it hard to migrate. We can use the format_date plugin to catch most of them with the m-Y source format, but this fails for the Y format. Maybe we can chain plugins together to try both, otherwise maybe it's be best to use a different field type for this.

Last batch of items not imported depending on requested pagination

PunkAPI lets us request up to 80 items at a time. There are 325 recipes. Currently we're requesting 50 a time. On the 7th request if we request exactly 25 recipes we only migrate 300 out of 325. If we request 50 recipes (taking it up to 350) we get the desired 325 recipes.

Not working:

  urls:
    - 'https://api.punkapi.com/v2/beers?page=1&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=2&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=3&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=4&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=5&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=6&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=7&per_page=25'

Working:

  urls:
    - 'https://api.punkapi.com/v2/beers?page=1&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=2&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=3&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=4&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=5&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=6&per_page=50'
    - 'https://api.punkapi.com/v2/beers?page=7&per_page=50'

This doesn't really matter, but it would be good to identify the cause and report it back to drupal.org.

Finalise hop schedule data structure

The "add" and "attribute" fields of hop additions are currently just plain text. They could possibly use a vocabulary or text list if there's a good reason for it.

Handle duplicate images

There are 79 recipes that have the fallback keg.png. We should re-use the image instead of duplicating it many times.

PHP 8 compatibility

composer/semver 1.5.1 requires php (^5.3.2 || ^7.0)
doctrine/annotations v1.4.0 requires php (^5.6 || ^7.0)
doctrine/cache v1.6.2 requires php (~5.5|~7.0)
doctrine/collections v1.4.0 requires php (^5.6 || ^7.0)
doctrine/common v2.7.3 requires php (~5.6|~7.0)
doctrine/inflector v1.2.0 requires php (^7.0)
drupal/core 8.9.13 requires php (^7.0.8)
laminas/laminas-diactoros 1.8.7p2 requires php (^5.6 || ^7.0)
laminas/laminas-escaper 2.6.1 requires php (^5.6 || ^7.0)
laminas/laminas-feed 2.12.2 requires php (^5.6 || ^7.0)
laminas/laminas-stdlib 3.2.1 requires php (^5.6 || ^7.0)
laminas/laminas-zendframework-bridge 1.0.4 requires php (^5.6 || ^7.0)
paragonie/random_compat v9.99.99 requires php (^7)
phar-io/manifest 1.0.3 requires php (^5.6 || ^7.0)
phar-io/version 2.0.1 requires php (^5.6 || ^7.0)
phpunit/php-code-coverage 6.1.4 requires php (^7.1)
phpunit/phpunit 7.5.20 requires php (^7.1)
sebastian/global-state 2.0.0 requires php (^7.0)
symfony-cmf/routing 1.4.1 requires php (^5.3.9|^7.0)
symfony/psr-http-message-bridge v1.1.2 requires php (^5.3.3 || ^7.0)
typo3/phar-stream-wrapper v3.1.4 requires php (^7.0)

Constants not working for str_replace plugin

PunkAPI uses "kilograms" and "litres" for weights and volumes but the Physical module expects "kg" and "l". We can transform these using the str_replace plugin but it's not working with constants.

Example:

source:
  constants:
    units_search: ['litres', 'grams', 'kilograms', 'celcius']
    units_replace: ['l', 'g', 'kg', 'c']
process:
  'field_volume/unit':
    plugin: str_replace
    source: volume_unit
    search: constants/units_search
    replace: constants/units_replace

For the time being we can hardcode the expected unit to be replaced:

process:
  'field_volume/unit':
    plugin: str_replace
    source: volume_unit
    search: litres
    replace: l

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.