- Issue created by @urvashi_vora
- Status changed to Needs work
12 months ago 11:34am 10 January 2024 - 🇮🇳India ashutosh ahirwal India
Provided patch not get applied throwing error.
chat_ai % git apply -v dependency-injections-added.patch
Checking patch src/ChatAI.php...
Checking patch src/Embeddings.php...
Hunk #7 succeeded at 345 (offset 18 lines).
Hunk #8 succeeded at 441 (offset 17 lines).
Checking patch src/Form/ChatBlockForm.php...
Checking patch src/Form/EmbeddingsForm.php...
Hunk #1 succeeded at 88 (offset -1 lines).
error: while searching for:
public function buildForm(array $form, FormStateInterface $form_state) {// Debug.
$entity = Node::load(1);
$embeddings = \Drupal::service('chat_ai.embeddings');
dpm($embeddings->shouldIndex($entity));
// ..
$config = json_decode($this->config('chat_ai.settings')->get('include') ?? '', TRUE);error: patch failed: src/Form/EmbeddingsForm.php:116
error: src/Form/EmbeddingsForm.php: patch does not apply
Checking patch src/Plugin/Block/ChatAIBlock.php... - First commit to issue fork.
- Assigned to pray_12
- Issue was unassigned.
- Status changed to Needs review
11 months ago 8:20am 15 January 2024 - Assigned to realsp
- 🇮🇳India realsp
Getting following errors in the issue's fork commit #3,
FILE: /home/contribution/drupal/web/modules/contrib/chat_ai/tests/src/Functional/SettingsPageTest.php -------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------- 35 | WARNING | Possible useless method overriding detected -------------------------------------------------------------------------------------------------------- FILE: /home/contribution/drupal/web/modules/contrib/chat_ai/src/Form/SettingsForm.php ---------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------------------------- 91 | WARNING | Possible useless method overriding detected ---------------------------------------------------------------------------------------- FILE: /home/contribution/drupal/web/modules/contrib/chat_ai/src/Form/EmbeddingsForm.php ------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------ 231 | WARNING | Possible useless method overriding detected ------------------------------------------------------------------------------------------ FILE: /home/contribution/drupal/web/modules/contrib/chat_ai/src/Form/ChatBlockForm.php ----------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------- 141 | WARNING | Possible useless method overriding detected -----------------------------------------------------------------------------------------
- Issue was unassigned.
- 🇮🇳India realsp
The possible useless methods were empty validate form methods in 'Form' files, and a separate 'setup()' method call without any definitions, hence can be removed. Please review the MR, Thank you.
- Status changed to Needs work
5 months ago 3:48pm 30 July 2024 - 🇵ðŸ‡Philippines roberttabigue
Hi @realsp,
After reviewing and applied the MR!1 to the Chat AI module against 1.0.0-alpha on Drupal 10, not all of the PHPCS errors were resolved.
See below:FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Form/SettingsForm.php ------------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------ 46 | ERROR | [x] Multi-line function declaration not indented correctly; expected 2 spaces but found 4 ------------------------------------------------------------------------------------------------------------------ PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------ FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Form/ChatBlockForm.php ------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------- 70 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter ------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Form/EmbeddingsForm.php -------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------- 90 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 91 | ERROR | [x] Multi-line function declaration not indented correctly; expected 2 spaces but found 4 -------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Embeddings.php ----------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------- 137 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 138 | ERROR | [x] Multi-line function declaration not indented correctly; expected 2 spaces but found 4 ----------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Supabase.php --------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES --------------------------------------------------------------------------------------------------------- 97 | ERROR | [x] Multi-line function declaration not indented correctly; expected 2 spaces but found 4 246 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter --------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/ChatAI.php --------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES --------------------------------------------------------------------------------------------------------- 102 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 103 | ERROR | [x] Multi-line function declaration not indented correctly; expected 2 spaces but found 4 --------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------------------------------------------
I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js chat_ai/
I'm moving this to ‘Needs work’ for now.
Thank you!
- Assigned to kulpratap2002
- 🇮🇳India kulpratap2002
Fixed all remaining phpcs errors, Please review.
- 🇵ðŸ‡Philippines roberttabigue
Hi @kul.pratap,
After reviewing and applied the latest MR!1 to the Chat AI module against 1.0.0-alpha1 on Drupal 10, not all of the PHPCS errors were resolved.
See below:FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/tests/src/Kernel/ChatAIKernelTestBase.php ---------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------- 10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\chat_ai\Supabase. ---------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Form/SettingsForm.php --------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE --------------------------------------------------------------------------------------------------------------------------------- 7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\chat_ai\Http\OpenAiClientFactory. --------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Form/ChatBlockForm.php ----------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------- 11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\chat_ai\ChatAIService. ----------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Form/EmbeddingsForm.php -------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------------------------------------------- 14 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\chat_ai\Embeddings. -------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Embeddings.php ---------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------- 14 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\chat_ai\Http\OpenAiClientFactory. ---------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/Supabase.php ---------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------- 11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\chat_ai\Http\OpenAiClientFactory. ---------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/chat_ai/src/ChatAI.php ---------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------------------------- 11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\chat_ai\Http\OpenAiClientFactory. ---------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------------------
I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js chat_ai/I'm moving this to ‘Needs work’ again.
Thank you!
- 🇮🇳India kulpratap2002
"Hi @roberttabigue,
I have resolved all the errors in the latest MR commit. It seems you may not have reviewed the most recent changes. I have verified everything locally, and there are no errors after the latest commit. The PHPCS errors have already been fixed, which you can confirm by reviewing the updated files.
Since GitLab CI is used to check PHPCS errors, I have enabled GitLab CI.
But the pipeline is failing for composer, i am attaching screenshot for reference.