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. Removed, see #7.
  • $logo can just be a Drupal\Core\Url object, or null. Due to the way the Svelte code works, this also necessitates simplifying $images so that they're all arrays with only 'file' (a Url object) and 'alt' elements.
  • 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) Fixed by #3492262: Allow isMaintained and security coverage and number of installs to differentiate between NULL and a value
  • author is kind of pointless as implemented, for the reasons detailed in #3502734: Remove author from Project.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chrisfromredfin created an issue. See original summary.

phenaproxima’s picture

Not a stable blocker for Drupal CMS.

phenaproxima’s picture

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.

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue tags: +API clean-up
phenaproxima’s picture

$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.

fjgarlin’s picture

StatusFileSize
new63.98 KB

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
warnings

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.

phenaproxima’s picture

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.

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes
Related issues: +#3502734: Remove author from Project
phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Status: Active » Needs review
chrisfromredfin’s picture

Status: Needs review » Needs work
StatusFileSize
new698.71 KB

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.

phenaproxima’s picture

Assigned: Unassigned » phenaproxima
Issue tags: +Needs tests
phenaproxima’s picture

Assigned: phenaproxima » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs tests

FIXED THAT. Super dumb bug -- the DrupalOrgJsonAPI source wasn't resetting $logo as it loops over the projects. It does in HEAD; I just accidentally deleted a line in the refactoring.

Since this was a bug introduced and fixed by this MR, I'm no longer entirely sure it benefits from a test. But I'll add one if you feel strongly. (Or we could do that in a follow-up if you're okay with that.)

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

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.

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

We made it!

Status: Fixed » Closed (fixed)

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