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

Initial implementation of the Routing system

XMLWordPrintable

    • MOODLE_404_STABLE
    • MOODLE_405_STABLE
    • MDL-81031-main
    • Hide

      Note: All new APIs are unit tested
      The only changes to current behaviour are to switch to use of the new API for settings/getting preferences and these are currently behat tested in a number of locations

      Admin UI test

      1. Log in as admin
      2. Navigate to Site admin -> Development -> Moodle REST API UI (SwaggerUI)
        1. Confirm the page loads without error
        2. Confirm that the URL shown underneath "Moodle LMS" ends with:

          /r.php/api/rest/v2/openapi.json
          

        3. *Confirm that you are shown a page with a number of options (core, user, GET/POST, etc).

      Smoke test

      This is best performed by an experienced develoepr

      Things to try:

      1. Use the Swagger UI to play with the various defined endpoints. Do things like:
        1. fetch all preferences
        2. fetch a single preference
        3. Set a single preference (drawer-open-block is a good one)
        4. Set a single preference to an invalid value
        5. Set a preference which does not exist
        6. Get a preference which does not exist
        7. Set/Get multiple preferences
        8. Fetch a single template (e.g. core/modal)
        9. Fetch a template with dependencies (e.g. core/notification)
        10. Incldue/exclude comments when fetching templates
        11. Install a different site language and fetch the template for a different language

      More things to try

      1. Edit config.php and set $CFG->debugdisplay = false;
      2. Tail your php error log
      3. Edit an existing service and modify the attributes in such a way that they break, for example:
        1. Edit lib/classes/route/api/templates.php:
          1. find the pathtypes, then make a typo in the class name for the path_themename
            1. Check the Swagger UI and confirm that the page loads without the relevant service
            2. The error log should be filled with useful information on the problem
          2. Undo that, and copy one of the query parameters into the path types
            1. Check the Swagger UI and confirm that the page loads without the relevant service
            2. The error log should be filled with useful information on the problem
          3. Undo that and insert parser exception in (e.g. replace class templates with cla ss templates)
            1. Check the Swagger UI and confirm that the page loads without the relevant service
            2. The error log should be filled with useful information on the problem
      4. Repeat the above with debugdisplay set to true - you'll have to look directly at the openapi.json URI instead of the Swagger UI page
      5. Play around with $CFG->debug_developer_use_pretty_exceptions = false; in both true/false settings too
      Show
      Note: All new APIs are unit tested The only changes to current behaviour are to switch to use of the new API for settings/getting preferences and these are currently behat tested in a number of locations Admin UI test Log in as admin Navigate to Site admin -> Development -> Moodle REST API UI (SwaggerUI) Confirm the page loads without error Confirm that the URL shown underneath "Moodle LMS" ends with: /r.php/api/rest/v2/openapi.json *Confirm that you are shown a page with a number of options (core, user, GET/POST, etc). Smoke test This is best performed by an experienced develoepr Things to try: Use the Swagger UI to play with the various defined endpoints. Do things like: fetch all preferences fetch a single preference Set a single preference ( drawer-open-block is a good one) Set a single preference to an invalid value Set a preference which does not exist Get a preference which does not exist Set/Get multiple preferences Fetch a single template (e.g. core/modal ) Fetch a template with dependencies (e.g. core/notification ) Incldue/exclude comments when fetching templates Install a different site language and fetch the template for a different language More things to try Edit config.php and set $CFG->debugdisplay = false; Tail your php error log Edit an existing service and modify the attributes in such a way that they break, for example: Edit lib/classes/route/api/templates.php: find the pathtypes , then make a typo in the class name for the path_themename Check the Swagger UI and confirm that the page loads without the relevant service The error log should be filled with useful information on the problem Undo that, and copy one of the query parameters into the path types Check the Swagger UI and confirm that the page loads without the relevant service The error log should be filled with useful information on the problem Undo that and insert parser exception in (e.g. replace class templates with cla ss templates ) Check the Swagger UI and confirm that the page loads without the relevant service The error log should be filled with useful information on the problem Repeat the above with debugdisplay set to true - you'll have to look directly at the openapi.json URI instead of the Swagger UI page Play around with $CFG->debug_developer_use_pretty_exceptions = false; in both true/false settings too
    • 10
    • Team Hedgehog 2024 Sprint 2.3, Team Hedgehog 2024 Review 2

      This issue covers creation of the general infrastructure which blocks the rest of the project, that is:

      • Inclusion of relevant PSRs
      • Inclusion of Slim framework
      • Creation of our Route attribute
      • Creation of our initial router implementation
      • Initial unit tests and changes to make existing tests continue passing
      • Any other required components

        1. (1) 2 Passed -- (Main)MDL-81031.png
          (1) 2 Passed -- (Main)MDL-81031.png
          102 kB
        2. swagger_1.png
          swagger_1.png
          388 kB
        3. swagger_2.png
          swagger_2.png
          355 kB
        4. swagger_3.png
          swagger_3.png
          408 kB
        5. swagger_4.png
          swagger_4.png
          347 kB

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Huong Nguyen Huong Nguyen
            Shamim Rezaie Shamim Rezaie
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            2 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 weeks, 2 days, 2 hours, 41 minutes
                6w 2d 2h 41m

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