Display warnings/errors from DrupalOrgJsonApi backend

Created on 18 December 2024, 4 months ago

Problem/Motivation

The Project Browser may become outdated vis a vis the API being provided by Drupal.org. Old clients may not support newer versions of the API. We need to let people know if they need to upgrade Drupal/Project Browser, based on the version of Drupal being used.

Proposed resolution

Display messages provided by Drupal.org that are given in the request from the parent issue.

โœจ Feature request
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @chrisfromredfin
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    This isn't a stable blocker for Drupal CMS.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin
  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin
  • Pipeline finished with Failed
    4 months ago
    Total: 525s
    #380343
  • Pipeline finished with Failed
    4 months ago
    Total: 590s
    #380351
  • Pipeline finished with Failed
    4 months ago
    Total: 672s
    #380363
  • Pipeline finished with Failed
    4 months ago
    Total: 796s
    #380371
  • Pipeline finished with Failed
    4 months ago
    Total: 557s
    #380568
  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    This is ready for review.

    I don't think there are any new errors provoked by these changes. The errors shown in the CI pipeline are not related to this issue:
    - CSpell: words in files that are not modified by this MR
    - Stylelint: CSS files that are not modified by this MR
    - Nightwatch: failures already present in 2.0.x
    - PHPUnit: failures already present in 2.0.x

    Tested on Drupal 10.3.2:

    The message shown comes from https://www.drupal.org/drupalorg-api/project-browser-filters?drupal_vers... โ†’

    When tested on Drupal 11.0.1 the message does not appear.

  • Pipeline finished with Failed
    4 months ago
    Total: 554s
    #380581
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Does PB not support D10 any more?

  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    PB wonโ€™t be included as stable and part of core until D11.

    In any case, this is not relevant for this issue. This issue is about querying the d.org api endpoint and relaying an error message, if present. Changing the message and/or versions to show the message, would be a drupal.org issue.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    Bump for review/test on this.

  • Pipeline finished with Failed
    3 months ago
    Total: 442s
    #388445
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    So on principle this looks great to me, however - it really needs a test. I assume a FunctionalJavascript so we can test that the message is displayed on the front-end using JS... but I have no idea how to fake/mock the endpoint result.

    But we need to test that if we create a results page with an error, that error is displayed.

    I would love to (could be in the future/follow-up) add support for warnings in addition to errors (so we could notify of an upcoming deprecation).

    But I think the approach is right.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    (Also, you'll notice I rebased this but it's failing a bunch of tests now?? Was that me? ๐Ÿ˜ฌ)

  • Pipeline finished with Failed
    3 months ago
    Total: 972s
    #389065
  • Pipeline finished with Failed
    3 months ago
    Total: 523s
    #389515
  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    We won't be able to do a FunctionalJavscript test unless we fake the Drupal version as the query to the endpoint sends the "current" installed Drupal version.

    It's not possible to change the value of a constant (Drupall::VERSION in this case) so I'm not sure which approach to follow.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    Re tests failing, all nightwatch tests seem to be failing in 2.0.x: https://git.drupalcode.org/project/project_browser/-/jobs/3935754

  • Pipeline finished with Failed
    3 months ago
    Total: 448s
    #389593
  • Pipeline finished with Failed
    3 months ago
    Total: 440s
    #389605
  • Pipeline finished with Failed
    3 months ago
    Total: 470s
    #389620
  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    Adde a test and altered the fixture regeneration to cater for the new parameter. Ready for review again.

  • Pipeline finished with Failed
    3 months ago
    Total: 450s
    #389630
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Test added, Changes looks good to me. Moving it to RTBC.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    I'm gonna take this for now because I want it in, but I think the test should have been more generic and/or at a minimum doesn't really belong in the TestDrupalOrgJsonApi - really a test that "if any backend gives an error with its response, that error is displayed" - but this test DOES do that, so I think refactoring in a follow-up is best.

    But also, I'm speaking a little bit out of my pay grade, so I welcome any response to this idea. :)

  • Pipeline finished with Skipped
    3 months ago
    #389856
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    ship it dot com

  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    Agree, but as this is the very first plugin to implement this it made sense to do it here. We are not sure which conditions could trigger an error on other plugins, but yeah, in any case, a follow-up can address this if needed.

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

  • Pipeline finished with Failed
    2 months ago
    Total: 8140s
    #423551
  • Pipeline finished with Skipped
    2 months ago
    #424171
  • Pipeline finished with Success
    2 months ago
    Total: 2197s
    #424173
  • Pipeline finished with Success
    2 months ago
    Total: 1207s
    #424484
  • Pipeline finished with Success
    2 months ago
    Total: 1207s
    #424522
Production build 0.71.5 2024