GithubHelp home page GithubHelp logo

tripal / fields_generator Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 1.0 1.23 MB

A composer tool for easily generating Tripal Fields

License: GNU General Public License v3.0

PHP 100.00%
tripal tripal3 tripal-developer-tools composer

fields_generator's Introduction

alt tag

Tripal 4 (Drupal 10)

               _   _                 _____                 _                                  _
     /\       | | (_)               |  __ \               | |                                | |
    /  \   ___| |_ ___   _____      | |  | | _____   _____| | ___  _ __  _ __ ___   ___ _ __ | |_
   / /\ \ / __| __| \ \ / / _ \     | |  | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __|
  / ____ \ (__| |_| |\ V /  __/     | |__| |  __/\ V /  __/ | (_) | |_) | | | | | |  __/ | | | |_
 /_/    \_\___|\__|_| \_/ \___|     |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__|
                                                                  | |
                                                                  |_|

Compatibility

Target Drupal Version 10.2.x-dev

Tested on PostgreSQL 13 + PostgreSQL 16

Drupal 10.2.x 10.3.x
PHP 8.1 Grid81-102-Badge Grid81-103-Badge
PHP 8.2 Grid82-102-Badge Grid82-103-Badge
PHP 8.3 Grid83-102-Badge Grid83-103-Badge

Code Coverage

This project uses Code Climate to determine the quality of our codebase and the coverage of our test suite. Compatibility above is based on passing of this test suite.

Test Coverage

Maintainability

Current Timeline

Required for Tripal 4.alpha3 Release

  • Display suite / page work
  • Importers: Publications
  • Search (ElasticSearch + Views)

How to get involved!

This upgrade to Drupal 10 is a community effort. As such, we NEED YOUR HELP!

  • To get involved, please join our Tripal Slack and comment in the #core-dev channel.
    • Alternatively, feel free to contact Lacey-Anne Sanderson through Slack direct message.
    • We can use help both with programming, documentation, outreach and welcome all individuals from all backgrounds!
  • We prefer automated testing for all Pull Requests (PRs) and are happy to guide you through the process!
    • Just comment on the issue if you need help designing tests
    • If you need help implementing tests see our documentation
  • If more documentation would be helpful, please create an issue here and we'll add it.

Documentation

Documentation for Tripal 4 has begun on ReadtheDocs.

Tripal Docker

Tripal Docker is currently focused on Development and Automated Testing. There will be a production focused Tripal Docker soon and if you're interested in helping or providing tips -please join us on our Slack channel!

For more information about how to use our fully functional development docker, see our documentation on ReadtheDocs!

fields_generator's People

Contributors

almasaeed2010 avatar bradfordcondon avatar laceysanderson avatar noah-77 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

almasaeed2010

fields_generator's Issues

Zenodo DOI release

I've added DOI integration via Zenodo. Let's make sure the next release is descriptive.

We need help text

I think migrating to symfony console would be great for this module. It'll make the command much more intuitive to use.

Move term adding function to the install

We currently generate the term insertion code in the .fields.inc file but the badges guideline specifically asks for this to be in the install file. Would a simple comment suffice? Or do we need to create a new file for it?

typo in stub file generated

$field_name = 'obi__microarray platform'; instead of $field_name = 'obi__microarray_platform';

More accurately, it could automtically introduce white space for machine names, or throw a warning

simpler rule for CV vs DB?

Use the EBI breadcrumb.

so teal box = CV, orange box = DB. IF obo namespace is provided in the sidebar, that will override the CV

This works for all DB/CVs except where capitalization is inconsistent between db and cv.

style incompatibility

The drupal code sniffer reformats the static variable documentation and its kind of not good.

  • can we use @see like we do for the method definitions?
  • if not, what should we do?
    • remove the comments and perhaps put @see at the top of the class?
    • reformat the comments to follow the Drupal style standard?

move static overrides int othe constructor?

I'm not a big fan of our stubs returning the super verbose public $static everything with the comments etc.

I was messing around with extending an importer and took this approach: overriding the parent static methods in the __construct method:

  /**
   * how we previously set it.  no longer necessary, you get style complaints.
   */
  public static $methods = array(
    'file_upload' => FALSE,
    'file_local' => FALSE,
    'file_remote' => FALSE,
  );
  public static $file_required = FALSE;

  /**
   * EutilsImporter constructor.
   *
   * @param \TripalJob|null $job
   */
  public function __construct(TripalJob $job = NULL) {
    parent::__construct($job);
    static::$name = 'NCBI EUtils Accession loader';
    static::$machine_name = 'eutils_loader';
    static::$description = 'Import a BLAST XML file into Chado';
    static::$use_analysis = FALSE;
    static::$button_text = 'Import NCBI Record';
    static::$methods = [
      'file_upload' => FALSE,
      'file_local' => FALSE,
      'file_remote' => FALSE,
    ];
  }

Do we like this more? You get a lot of less code sniffer complaints this way and its a lot more compact.

I also think it will partially resolve #46

improving CVterm suggestions

since OLS tends to show you lots of garbage from garbage CVs...

Elasticsearch integration

  • Pick which CVs to search?

Update stubs

Stephen has added more functionality to fields.

I need to update the stub files to reflect this.

library contributed fields need to have "tripal_chado"

for library, the module should be 'tripal_chado'. That's because we dont have the fields.inc file that tells drupal about our field, so someone has to tell drupal about it: and we want that to be Tripal.

To fix, change the 'module' prompt to advise people of this.

Changes to the TripalField class

I have just made a change to the TripalField class (on the collections branch of Tripal) which moves the download_formatters out of the $default_instance_settings variable and into it's own static variable. This is because it would be really hard to add new formatters to a field without manually rewritting the settings for existing fields.... too much effort. Once the 'collections' branch gets merged into the 7.x-3.x branch then this change will be active.

add @see to stubs

for the formatter view for example: * @see TripalFieldFormatter::view()

I like having the stubs generated have the full text, but maybe we should do something like:

/**
* @see TripalFieldFormatter::view()
* the full description for this method is provided below.  You should delete it, and only leave the @see annotation above, when you are ready to contribute your code.
* full 
* description...
**/

broken build

phpunit
PHP Fatal error:  Declaration of GeneratorEngineTest::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /home/travis/build/tripal/fields_generator/tests/Generator.php.test on line 34
PHP Stack trace:
PHP   1. {main}() /home/travis/.phpenv/versions/7.2.15/bin/phpunit:0
PHP   2. PHPUnit\TextUI\Command::main() /home/travis/.phpenv/versions/7.2.15/bin/phpunit:619
PHP   3. PHPUnit\TextUI\Command->run() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/TextUI/Command.php:164
PHP   4. PHPUnit\TextUI\Command->handleArguments() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/TextUI/Command.php:175
PHP   5. PHPUnit\Util\Configuration->getTestSuiteConfiguration() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/TextUI/Command.php:910
PHP   6. PHPUnit\Util\Configuration->getTestSuite() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Util/Configuration.php:870
PHP   7. PHPUnit\Framework\TestSuite->addTestFiles() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Util/Configuration.php:1013
PHP   8. PHPUnit\Framework\TestSuite->addTestFile() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Framework/TestSuite.php:625
PHP   9. PHPUnit\Util\FileLoader::checkAndLoad() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Framework/TestSuite.php:546
PHP  10. PHPUnit\Util\FileLoader::load() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Util/FileLoader.php:47
Fatal error: Declaration of GeneratorEngineTest::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /home/travis/build/tripal/fields_generator/tests/Generator.php.test on line 34
Call Stack:
    0.0008     561248   1. {main}() /home/travis/.phpenv/versions/7.2.15/bin/phpunit:0
    0.0721    9831616   2. PHPUnit\TextUI\Command::main() /home/travis/.phpenv/versions/7.2.15/bin/phpunit:619
    0.0721    9840408   3. PHPUnit\TextUI\Command->run() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/TextUI/Command.php:164
    0.0721    9840408   4. PHPUnit\TextUI\Command->handleArguments() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/TextUI/Command.php:175
    0.0793    9843040   5. PHPUnit\Util\Configuration->getTestSuiteConfiguration() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/TextUI/Command.php:910
    0.0793    9843624   6. PHPUnit\Util\Configuration->getTestSuite() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Util/Configuration.php:870
    0.0798    9881960   7. PHPUnit\Framework\TestSuite->addTestFiles() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Util/Configuration.php:1013
    0.0798    9881960   8. PHPUnit\Framework\TestSuite->addTestFile() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Framework/TestSuite.php:625
    0.0798    9881960   9. PHPUnit\Util\FileLoader::checkAndLoad() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Framework/TestSuite.php:546
    0.0799    9882248  10. PHPUnit\Util\FileLoader::load() phar:///home/travis/.phpenv/versions/7.2.15/bin/phpunit/phpunit/Util/FileLoader.php:47
The command "phpunit" exited with 255.

https://travis-ci.org/tripal/fields_generator/builds/500085780?utm_medium=notification&utm_source=email

h for help?

Right now the questions we ask the user to generate the field are too verbose making it not clear where the cursor is which is a bit disorienting (for me at least). For a better experience, I suggest adding the following:

  • A -v option to enable verbose mode which is the mode it is currently using
  • Typing h or help as the answer to any question should generate help text

Yes it's a little bit of work but a good improvement imo.

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.