Cleanup of Project object contract/constructor

Created on 18 December 2024, 2 months ago

Problem/Motivation

Moving into a Drupal CMS stable release, the DA needs to know that our contract is as minimal as possible for the Project object. We reviewed it (fjgarlin, hestenet, phenaproxima, drumm, chrisfromredfin) and have the following suggestions:

Proposed resolution

  • Investigate the use of $warnings; is this tech debt / cruft / leftovers? Or is it actually used? If it's not used, get rid of it. If it is, document it.
  • We are making some effort to actually re-transcribe the image format from the old Drupal 7 API after getting it from the new API. This is just tech debt introduced to make the change to the new API endpoint easier, but it really needs to go. We're adding extra code for no reason, really. See code for core plugin and code for DrupalOrgJsonApi plugin
  • projectUsageTotal is always a number, but should be allowed to see NULL as a distinct entity. 0 means "no sites report using this" but NULL means "we don't have usage data for this." (Both should be hidden in the frontend UI, which currently only hides for 0, I think)
πŸ“Œ Task
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

    Not a stable blocker for Drupal CMS.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    This also need not be on our radar for a general release of Drupal CMS. Re-categorizing as a beta blocker because the Project class is API, which can change in alpha releases but not in beta.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    $warnings is used extensively in the Svelte code, but the backend is a different story. The only source plugin which uses it is ProjectBrowserTestMock. The fact that it's not used by the DrupalOrgJsonApi source suggests a few possibilities:

    • The functionality is supposed to exist but the DA hasn't implemented it yet.
    • The functionality doesn't exist, and won't - the property was merely added to support an API feature that never materialized.
    • The functionality exists at the drupal.org end but the DrupalOrgJsonApi source doesn't take advantage of it.

    This probably needs input from @fjgarlin.

  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    I think it was just to replicate what was done in here: https://git.drupalcode.org/project/drupalorg/-/blob/e31465608d1380345834...

    ie: https://www.drupal.org/project/ckeditor β†’

    From the API endpoint is just a taxonomy term value, and then it’s really up to PB what to do with it. I think it can be cleaned up, and if we want to implement it, it can be done from scratch taking into account what is it we really want.

    Currently, PB and filters only care about: active status and maintained status. In the early days, we were checking each possible value, and marking/showing some as "negative", but that changed with the introduction of other Plugins and it makes no sense anymore.

    Should we want to show the descriptions of the values for the taxonomies, we could always do it, without the need to show a warning triangle.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    That makes sense to me. I think $warnings, as implemented in HEAD, is too generic and semantically meaningless. It really should be something like $flags, and that should be an enum case, or array of enum cases, that have specific meanings and can be rendered in specific ways by the Svelte code.

    So +1 for removing it for now.

  • Merge request !713Rip warnings out of backend β†’ (Merged) created by phenaproxima
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Canceled
    15 days ago
    Total: 225s
    #417974
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    15 days ago
    Total: 384s
    #417976
  • Pipeline finished with Success
    15 days ago
    Total: 353s
    #417981
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    15 days ago
    Total: 278s
    #417991
  • Pipeline finished with Failed
    15 days ago
    Total: 637s
    #417992
  • Pipeline finished with Failed
    15 days ago
    Total: 543s
    #418006
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    15 days ago
    Total: 282s
    #418015
  • Pipeline finished with Failed
    15 days ago
    Total: 407s
    #418022
  • Pipeline finished with Failed
    15 days ago
    Total: 353s
    #418024
  • Pipeline finished with Success
    15 days ago
    Total: 622s
    #418044
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    15 days ago
    Total: 360s
    #418240
  • Pipeline finished with Success
    15 days ago
    Total: 354s
    #418258
  • Pipeline finished with Success
    15 days ago
    Total: 359s
    #418264
  • Pipeline finished with Success
    15 days ago
    Total: 353s
    #418269
  • πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

    This looks really good from a code perspective, but at least one bug.

    It seems like ones that should have the default/fallback logo are instead using the logo of the previous project that has one set. so in 2.0.x, Scheduler has a logo, but File Entity does not. Feeds does, but the three after Feeds do not, etc.

    Once you get out of the top 100 you see a bunch that don't have logos (my favorite is going to page 5) on the drupalorg_jsonapi source.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    FIXED THAT. Super dumb bug -- the DrupalOrgJsonAPI source wasn't resetting $logo as it loops over the projects.

    Since this is a bug in the actual source plugin, not the Svelte code, I'm no longer sure it benefits from a test.

  • Pipeline finished with Failed
    15 days ago
    Total: 543s
    #418288
  • πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

    This is a great clean-up. I'd like to see a test for #17, I'm actually surprised PHPStan didn't catch that. But that can happen in a follow-up.

  • Pipeline finished with Skipped
    12 days ago
    #420381
  • πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

    We made it!

Production build 0.71.5 2024