Promote drupal endpoint to full / default source plugin

Created on 28 June 2023, over 1 year ago
Updated 18 July 2024, 4 months ago

Problem/Motivation

Now that the parent is closed, we have a test infrastructure for migrating to a real live Drupal endpoint for querying data for Project Browser.

Proposed resolution

When the Association has appropriately stood up the infrastructure to support that, we can move this plugin out of tests and refactor for production use.

We need to:
1. Move the "DrupalDotOrgJsonApi" source plugin from the test folder to the "src/Plugin\ProjectBrowserSource" folder.
2. Change the namespace to "namespace Drupal\project_browser\Plugin\ProjectBrowserSource;"
3. Change the DRUPAL_ORG_ENDPOINT to the right value.
4. Revise all the other class constants to make sure that they have the right hardcoded values.
5. Change the default plugin in "config/install/project_browser.admin_settings.yml" to "drupalorg_jsonapi"
6. Check if all the tests are running.
7. Not sure about this one: we might need to recreate the fixtures here "tests/fixtures/drupalorg_jsonapi"

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States chrisfromredfin Portland, Maine

Live updates comments and jobs are added and updated live.
  • Starshot blocker

    A potential blocker for Drupal Starshot. More information: http://www.drupal.org/project/starshot

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @chrisfromredfin
  • Status changed to Postponed over 1 year ago
  • 🇪🇸Spain fjgarlin

    Postponed until we have the live endpoint.

  • 🇺🇸United States chrisfromredfin Portland, Maine
  • 🇺🇸United States chrisfromredfin Portland, Maine
  • 🇪🇸Spain fjgarlin

    Update given in slack channel: https://drupal.slack.com/archives/C01UHB4QG12/p1717668171381089

    I wanted to give an update on where we are at in regards to the future Project Browser endpoint to read data from www.drupal.org.

    PB side
    Note that Project Browser is already prepared to consume that data:

    www.drupal.org side
    We had some blockers that were finally solved and we could pivot back to working on this.

    So, we have:

    We still don’t have:

    • Elastic Search remote server to test the search functionality which leverages search_api. We’ve tried locally with database server, solr server and elastic search server and it all works well. Adding this to the remote server is our next priority.
    • And staging or live endpoint.

    More in the coming weeks 🙂

  • 🇪🇸Spain fjgarlin

    Current situation:

    • ✅ Dev and prod servers created
    • ✅ Drupal 7 database replicas accessible by the D10 projects
    • ⚠️ Copy of the D7 files folder. Nearly there on dev and prod. Migrations have a fallback to the public URL.
    • ⚠️ Migrations: Struggling to run the +2 million user migration. When it does, then it's files, projects and project usage, each depending on the previous.
    • ⚠️ Elastic search: set up in the dev server but not yet in the prod server (It's meant to be quick once we finetune permissions).

    Some of the ⚠️ are nearly ✅ but going into the cautious side.

  • Assigned to fjgarlin
  • Status changed to Needs work 5 months ago
  • 🇪🇸Spain fjgarlin

    Hi all,

    As of today, we have:

    🟢Migrations
    - Finally got the first full user migration to run.
    - It now follows files (done)
    - And then all the projects migrations (running)
    - Finally, there is the project_usage migration. This last one has got +40 million rows so we are expecting it to take a long time.

    🔴 Elastic Search
    - We are awaiting on the Elastic Search server for the production environment.
    - We have set it up on development and the infra team is fine-tuning permissions and settings, but it’s not set up in production yet.
    - This is currently the main blocker as we cannot index and search the data migrated otherwise.

    🟠 PB promoting endpoint issue (aka this issue)
    - I will work tomorrow and the day after on it, hoping to have something to be reviewed / tested via drupalpod by the end of the week.

    If/when the Elastic Search part is solved, we will be in a position to deliver a “live” endpoint. It will be live in the sense of being a endpoint reading from the d.o database, but note that currently, migrations take “hours” to run and that this is the very first week ever that we have these running on the new infra for the production environment. This also means that we are learning about server requirements, real volume of data, Drupal limitations, etc.

    ⚠️ So, our ask is that you treat the endpoint as an “alpha” or “beta” version of it, and as such, Project Browser could not be considered stable under we are happy with the stability of the endpoint. I think this makes sense but please let us know if you don’t understand any of the above.

    Having said all that, the “alpha” live endpoint will be: https://drupalorg.prod.cluster.drupalsystems.org/jsonapi 🎉🎉
    This will change to be www.drupal.org/jsonapi but I think this makes it more obvious that it’s still not the final version.

  • Merge request !536Integrate the new endpoint. → (Merged) created by fjgarlin
  • 🇪🇸Spain fjgarlin

    fjgarlin changed the visibility of the branch 3371084-promote-drupal-endpoint to hidden.

  • Pipeline finished with Failed
    5 months ago
    Total: 595s
    #214607
  • 🇪🇸Spain fjgarlin

    WIP in the MR.

    Not sure why but when adding some filters the result is 0.

    Works:

    https://drupalorg.prod.cluster.drupalsystems.org/jsonapi/index/project_modules?
      filter[status]=1&
      filter[type]=project_module&
      filter[project_type]=full&
      page[limit]=12&
      page[offset]=0&
      ainclude=field_supporting_organizations,field_supporting_organizations.field_supporting_organization,field_module_categories,field_maintenance_status,field_development_status,uid,field_project_images
    

    When adding any of the following, it does not:

      filter[maintenance_status_uuid][value][0]="9125cb6-2f35-451b-922d-3042cb1b4391"
      filter[maintenance_status_uuid][value][1]="de457d5a-2ce3-45b4-b88b-1c54e5e6d0e2"
      filter[maintenance_status_uuid][value][2]="fd8b539f-a5e4-4577-9367-f119a252327b"
      filter[maintenance_status_uuid][operator]=IN
      filter[maintenance_status_uuid][path]=maintenance_status_uuid
      filter[security_coverage][value][0]=covered
      filter[security_coverage][operator]=IN
      filter[security_coverage][path]=security_coverage
      filter[n_security_coverage][value][0]=revoked
      filter[n_security_coverage][operator]=NOT IN
      filter[n_security_coverage][path]=security_coverage
      sort=-active_installs_total
    
  • Pipeline finished with Failed
    5 months ago
    Total: 564s
    #214830
  • 🇮🇳India narendraR Jaipur, India

    Is it related to sort somehow? As when I hit https://drupalorg.prod.cluster.drupalsystems.org/jsonapi/index/project_modules?filter[status]=1&filter[project_type]=full&filter[type]=project_module&page[limit]=12&page[offset]=0&include=field_supporting_organizations,field_supporting_organizations.field_supporting_organization,field_module_categories,field_maintenance_status,field_development_status,uid,field_project_images&sort=title it is working but not when https://drupalorg.prod.cluster.drupalsystems.org/jsonapi/index/project_modules?filter[status]=1&filter[project_type]=full&filter[type]=project_module&page[limit]=12&page[offset]=0&include=field_supporting_organizations,field_supporting_organizations.field_supporting_organization,field_module_categories,field_maintenance_status,field_development_status,uid,field_project_images&sort=-active_installs_total

  • 🇮🇳India narendraR Jaipur, India

    May be it's because field_active_installs_total has null value everywhere. Just a guess 🤔.

  • 🇪🇸Spain fjgarlin

    Yup. It’s related and due to that. We’re working on fixing the endpoint issue. It’s not because it’s null as it happens with other fields with data.

    It’s related to Elastic vs Open Search and the Drupal modules we use.

    WIP.

  • Pipeline finished with Failed
    5 months ago
    Total: 586s
    #215630
  • Pipeline finished with Failed
    5 months ago
    #215648
  • Pipeline finished with Failed
    5 months ago
    #215657
  • Pipeline finished with Canceled
    5 months ago
    Total: 106s
    #215755
  • Pipeline finished with Canceled
    5 months ago
    Total: 280s
    #215758
  • Pipeline finished with Failed
    5 months ago
    Total: 543s
    #215770
  • Pipeline finished with Failed
    5 months ago
    #215803
  • Pipeline finished with Failed
    5 months ago
    #215823
  • 🇪🇸Spain fjgarlin

    Most of the failing tests on CI are passing locally. I'm trying a few small things here and there to see if CI is happy.

    $ php web/core/scripts/run-tests.sh --types PHPUnit-FunctionalJavascript --sqlite "sites/default/files/.sqlite" --verbose --class \\Drupal\\Tests\\project_browser\\FunctionalJavascript\\ProjectBrowserUiTestJsonApi
    
    Drupal test run
    ---------------
    
    Tests to be run:
      - \Drupal\Tests\project_browser\FunctionalJavascript\ProjectBrowserUiTestJsonApi
    
    Test run started:
      Thursday, July 4, 2024 - 14:03
    
    Test summary
    ------------
    
    Drupal\Tests\project_browser\FunctionalJavascript\ProjectBro  15 passes                                      
    
    Test run duration: 3 min 20 sec
    
    Detailed test results
    ---------------------
    
    
    ---- Drupal\Tests\project_browser\FunctionalJavascript\ProjectBrowserUiTestJsonApi ----
    
    
    Status    Group      Filename          Line Function                            
    --------------------------------------------------------------------------------
    Pass      Other      ProjectBrowserUiT   50 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT   79 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT   90 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  109 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  152 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  167 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  217 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  263 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  305 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  312 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  325 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  332 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  350 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  425 Drupal\Tests\project_browser\Functi
        
    Pass      Other      ProjectBrowserUiT  453 Drupal\Tests\project_browser\Functi
        
    
  • Pipeline finished with Failed
    5 months ago
    #215837
  • Pipeline finished with Failed
    5 months ago
    #215866
  • Pipeline finished with Canceled
    5 months ago
    Total: 84s
    #215886
  • Pipeline finished with Success
    5 months ago
    Total: 400s
    #215889
  • Status changed to Needs review 5 months ago
  • 🇪🇸Spain fjgarlin

    All tests are green now. ALL 🙂

    The changes in tests/fixtures are just replacing contants/URLs, so no need to review those. Review all the other changes.

    I also created a follow up to decide what to do with the "mock" plugin, as it is expected in many tests, but it's out of the scope for this issue:
    📌 [PP-1] Remove drupalorg_mockapi or move it to "test" folder Postponed .

    Please review.

  • Pipeline finished with Skipped
    5 months ago
    #215978
  • Status changed to Fixed 5 months ago
  • 🇺🇸United States chrisfromredfin Portland, Maine

    Like many things that are "star shots" - this is OUT OF THIS WORLD! I'm so overjoyed. I'll celebrate with some fireworks. :)

    🎆

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

Production build 0.71.5 2024