The Chatbot AP module provides a common layer to expose your website content and logic to Chatbots and Personal Assistants (NLPs).

Requirements and Recommended modules

Chatbot API by itself doesn't do anything. You should install it only if another module asks for it or you want to build your own integration driver.

Currently the following platforms are supported out of the box:

More integrations are coming, besides the module provide examples on how to write your own driver for (yet) unsupported platforms.

Roadmap

The module is already stable and its RC phase. No new features are planned in the next 6-12 months, other than bugfixes and new / better integrations with platforms.

The README file is in our TODO, however the module already have a pretty good documentation.

Tests are currently green, there are 6 Coding Standard issues left because fixing them could break the current API, and the module it's in its Release Candidate phase.

Credits

gambry and larowlan are the maintainers.

Project link

https://www.drupal.org/project/chatbot_api

Git instructions

git clone --branch 8.x-2.x https://git.drupal.org/project/chatbot_api.git

CommentFileSizeAuthor
#2 chatbot_api_alexa.txt26.01 KBnandu.kumar

Comments

gambry created an issue. See original summary.

nandu.kumar’s picture

StatusFileSize
new26.01 KB

Hey @gambry,

i am able to see the some error Pareviw of your project.

The chatbot_api_alexa.module does not implement hook_help()
DrupalPractice has found some issues with your code, but could be false positives.
Coder Sniffer has found some issues with your code (please check the Drupal coding standards).

https://pareview.sh/pareview/https-git.drupal.org-project-chatbot_api.git

nandu.kumar’s picture

Status: Needs review » Needs work
gambry’s picture

That's what I love about community! :D

They do implement hook_help(), just with old modules namings which I haven't updated accordingly.

RE Coding Standard issues, most of them are due Drupal Console code templates.

Thanks for your review! We'll check those soon.

gambry’s picture

Issue summary: View changes
Status: Needs work » Needs review

I've released a new version with most of the issues flagged by #2 solved.
The only Coding Standards issues left can't be fixed because they won't be Back Compatible and as the module is in Release Candidate I don't want to break its API.

The README file is in our TODO, however the module already have a pretty good documentation.

Tests are still green, and 31 coding standard issues have been fixed.

gambry’s picture

Additional Coding Standard issues have been fixed: https://pareview.sh/pareview/https-git.drupal.org-project-chatbot_api.git
The only outstanding one is the README, which #5 has an answer and a plan for.

avpaderno’s picture

Priority: Normal » Critical
Issue summary: View changes
sleitner’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Automated Review

Pareview details: https://pareview.sh/pareview/https-git.drupal.org-project-chatbot_api.gi...

Review of the 8.x-1.x branch (commit 973ed2d):

This automated report was generated with PAReview.sh, your friendly project application review script.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follow the guidelines for in-project documentation and/or the README Template. Is missing see pareview
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements
Coding style & Drupal API usage
(*) Coder Sniffer and DrupalPractice in pareview

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

gambry’s picture

Status: Needs work » Needs review

README.txt is in the main branch. The remaining CS issues can't be fixed because they will require to break the API.

avpaderno’s picture

#8 doesn't report any coding style issue. Which coding style issue would break the API?

sleitner’s picture

Status: Needs review » Needs work

I agree with kiamlaluno. I can't find where the API would break, if you change the code to match with Drupal coding standards.

Review of the 8.x-1.x branch (commit ba50156):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: ..._temp/modules/chatbot_api_entities/src/Form/EntityCollectionForm.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
    --------------------------------------------------------------------------
     344 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     345 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     346 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     347 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
     348 | WARNING | \Drupal calls should be avoided in classes, use
         |         | dependency injection instead
    --------------------------------------------------------------------------
    
    Time: 3.89 secs; Memory: 6Mb
    

This automated report was generated with PAReview.sh, your friendly project application review script.


FILE: ...mp/modules/chatbot_api_entities/src/Plugin/QueryHandlerInterface.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 27 | ERROR | Arguments with default values must be at the end of the
    |       | argument list
--------------------------------------------------------------------------


FILE: ...ntities/src/Plugin/ChatbotApiEntities/QueryHandler/DefaultEntity.php
--------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------
  5 | WARNING | [x] Unused use statement
 37 | ERROR   | [ ] Arguments with default values must be at the end of
    |         |     the argument list
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...i_entities/tests/src/Functional/ChatbotApiEntitiesFunctionalTest.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 48 | ERROR | Public method name
    |       | "ChatbotApiEntitiesFunctionalTest::testAdminUI" is not in
    |       | lowerCamel format
--------------------------------------------------------------------------


FILE: ...sh/pareview_temp/src/Command/Generate/PluginChatbotIntentCommand.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 16 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 5.64 secs; Memory: 8Mb
gambry’s picture

Hi guys, thanks for your time. Really appreciated.

  • modules/chatbot_api_entities/src/Form/EntityCollectionForm.php these issues are related to the __wakeup() PHP magic method. I discussed with the other maintainer and the method can probably go, as DependencySerializationTrait already takes care of it.
  • modules/chatbot_api_entities/src/Plugin/QueryHandlerInterface.php This will break the API if I fix it. It's the plugin interface, if I change the arguments any plugin implementing it will break.
  • src/Plugin/ChatbotApiEntities/QueryHandler/DefaultEntity.php Same as above. This is a base class implementing QueryHandlerInterface interface.
  • tests/src/Functional/ChatbotApiEntitiesFunctionalTest.php this is a public method. If any site is extending it for their own tests I would break their classes. Probably the worrying is more than the actual risk, but still.
  • The remaining issues are about unused use statements, which refer to the plugins Annotation, and I thought they were required. I can try to remove and test, if all looks code I'll fix those.

I hope that makes sense, but let me know your thoughts.

gambry’s picture

Status: Needs work » Needs review
  • #12.1 has been fixed
  • #12.2, .3 can't be changed because the API will break
  • #12.4 can't be changed because if anyone is extending the public method we could break his/her code. You should never extend tests method, but the fix is not worth the potential issue we could cause to users.
  • #12.5 has been partially fixed. use statements importing annotation classes can be avoided in Drupal plugins (so i fixed DefaultEntity), but are required for Drupal console Commands (so I forced ignoring CodingStyle checks for that line)

I hope there aren't any more issues. Thanks.

avpaderno’s picture

Status: Needs review » Postponed

There are still methods where the arguments with default values aren't the last in the argument list. That is not allowed from PHP.

public function query(EntityTypeManagerInterface $entityTypeManager, array $existing = [], EntityCollectionInterface $collection) {
  $entity_type_id = $collection->getCollectionEntityTypeId();
  $entity_type = $entityTypeManager->getDefinition($entity_type_id);
  $query = $this->getQuery($entityTypeManager, $collection, $entity_type);
  return $existing + $entityTypeManager->getStorage($entity_type_id)->loadMultiple($query->execute());
}

If the module is already used, create a new branch, don't create new tags, and fix the code there.

avpaderno’s picture

Status: Postponed » Needs work

(That was the wrong status.)

gambry’s picture

Status: Needs work » Needs review

Hi @kiamlaluno,
that is allowed in PHP. PHP doc just says "defaults should be on the right side [...] otherwise, things will not work as expected", and it doesn't refer to something wrong with the implementation, but with the usage.

That is how the interface QueryHandlerInterface is defined, and I can't change it in 1.x due the module being in RC version already, and we can't break the API.

But as you suggested I created a branch 2.x and fixed it in there.
As that is a new major version and we can break things, I fixed the CS issue with the test method "Public method name "ChatbotApiEntitiesFunctionalTest::testAdminUI" is not in lowerCamel format" too.

Thanks for your time!

avpaderno’s picture

Issue summary: View changes
sleitner’s picture

Status: Needs review » Reviewed & tested by the community

I see no issues in branch 2.x

avpaderno’s picture

Assigned: Unassigned » avpaderno

I am going to take the final step in 4 hours (less or more).

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for your contribution!

I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.