Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-83970

AI: Use component name in registration and logging

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-83970-405
    • MDL-83970-main
    • Hide

      SETUP

      1. To quickly generate some AI usage data for this manual test, run the file MDL-83970-generate-data.php  attached to this issue. Save the file to the root of your Moodle installation and then run it via CLI:

      php MDL-83970-generate-data.php

      2. Install another language, for example: *Français ‎(fr)‎*

      Testing 1

      1. Don't apply the patch yet.
      2. Note which branch you are working on. e.g., "main" branch.
      3. Run the command on SETUP number 1.
      4. Check your database by running the below query:

        SELECT * from mdl_ai_action_register

      5. VERIFY that there are five new sets of data, consisting of three sets of data with "OpenAI API provider" as their provider and two with "Azure AI API provider" as their provider.
      6. Apply the patch and run the site upgrade.
      7. Check your database again by running the SQL query on step 2
      8. VERIFY that the "OpenAI API provider" changed to "aiprovider_openai" and "Azure AI API provider" changed to "aiprovider_azureai".
      9. --- The next steps is only available in the main version (5.0). -----
      10. Return to your Moodle web. Navigate to Site Admin > Reports > AI Usage
      11. VERIFY that the table with the provider column display "OpenAI API provider" and "Azure AI API provider".

      Testing 2

      1. Checkout the "main" branch
      2. Run the file fixversion.php via CLI:

        php fixversion.php 

      3. Truncate data in database table mdl_ai_action_register with following query:

        truncate table mdl_ai_action_register;

      4. Run the command on SETUP number 1.
      5. Navigate to Site Admin > General > Language customisation
      6. Choose Français (fr)
      7. Click the Open language packfor editing button.
      8. Wait for language pack loaded and then click the Continue button
      9. Select aiprovider_openai
      10. Fill the String identifier input with pluginname
      11. Fill the Local customisation with Fournisseur OpenAI 
      12. Click the Save changes button.
      13. Change the language to *Français ‎(fr)‎*
      14. Apply the patch and run the site upgrade.
      15. VERIFY that the upgrade process was successful without any errors.
      Show
      SETUP 1. To quickly generate some AI usage data for this manual test, run the file MDL-83970-generate-data.php  attached to this issue. Save the file to the root of your Moodle installation and then run it via CLI: php MDL- 83970 -generate-data.php 2. Install another language, for example: *Français ‎(fr)‎* Testing 1 Don't apply the patch yet. Note which branch you are working on. e.g., " main " branch. Run the command on SETUP number 1. Check your database by running the below query: SELECT * from mdl_ai_action_register VERIFY that there are five new sets of data, consisting of three sets of data with "OpenAI API provider" as their provider and two with "Azure AI API provider" as their provider. Apply the patch and run the site upgrade. Check your database again by running the SQL query on step 2 VERIFY that the "OpenAI API provider" changed to " aiprovider_openai " and "Azure AI API provider" changed to " aiprovider_azureai ". --- The next steps is only available in the main version (5.0). ----- Return to your Moodle web. Navigate to Site Admin > Reports > AI Usage VERIFY that the table with the provider column display "OpenAI API provider" and "Azure AI API provider". Testing 2 Checkout the " main " branch Run the file fixversion.php via CLI: php fixversion.php Truncate data in database table mdl_ai_action_register with following query: truncate table mdl_ai_action_register; Run the command on SETUP number 1. Navigate to Site Admin > General > Language customisation Choose Français (fr) Click the Open language packfor editing button. Wait for language pack loaded and then click the Continue button Select aiprovider_openai Fill the String identifier input with pluginname Fill the Local customisation with Fournisseur OpenAI   Click the Save changes button. Change the language to *Français ‎(fr)‎* Apply the patch and run the site upgrade. VERIFY that the upgrade process was successful without any errors.
    • Hide

      Code verified against automated checks.

      Checked MDL-83970 using repository: https://github.com/meirzamoodle/moodle.git

      More information about this report

      Built on: Fri Feb 14 04:30:40 PM UTC 2025

      Show
      Code verified against automated checks. Checked MDL-83970 using repository: https://github.com/meirzamoodle/moodle.git MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-83970-405 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-83970-main | CI Job ] More information about this report Built on: Fri Feb 14 04:30:40 PM UTC 2025
    • Show
      Launching automatic jobs for branch MDL-83970 -405 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17878/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60959/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60960/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-83970 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17879/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60961/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60962/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60963/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60964/ App tests (stable app version) Built on: Mon Jan 13 04:30:17 AM UTC 2025
    • 2
    • Team Dragons 2025 Sprint 1.2

      There are a couple of places where we are storing data using the AI provider "pluginname" string instead of the provider component name e.g. aiprovider_openai

      This results in translated entries being add to the registration hub data. This will make it harder to parse the data correctly, see below for an example:

      {"Fournisseur API OpenAI":{"summarise_text":{"success_count":0,"fail_count":17,"predominant_error":401}},"time_range":{"timefrom":1731538874,"timeto":1732143670}}

      {"Provedor da API do OpenAI":{"generate_text":{"success_count":0,"fail_count":2,"predominant_error":404}},"time_range":{"timefrom":1731451506,"timeto":1731835082}}

      This is also the case in the "ai_action_register" table. in this table we should also store the provider component name

            meirza.arson@moodle.com Meirza
            matt.porritt@moodle.com Matt Porritt
            Stevani Andolo Stevani Andolo
            Safat Shahin Safat Shahin
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 31 minutes
                1d 3h 31m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.