[PLAN] Where to fetch image from?

Created on 27 April 2022, over 2 years ago
Updated 31 May 2023, over 1 year ago

Problem/Motivation

Providing a "logo" image for projects is somewhat instrumental to the design for project browser. Many projects do not have images right now. Operating under an incorrect assumption that we shouldn't change Drupal.org, we figured we would make sure that projects that did have logos would set the logo as their first image in field_images on Drupal.org.

There are, however some alternatives.

Proposed resolution

We need to decide between what currently look like three options:

  1. Continue with the original plan. Make the logo the first in field_images. This requires 0 changes at Drupal.org, and works for the prototype, but doesn't necessarily work long-term. Longer term we assumed option 2.
  2. Add a field_logo to the Drupal.org module_project nodes. This is a single-value field of structured data. We are already fetching Drupal.org project data, so it would be easy to see if this were NULL/empty or filled out, and push the link down to PB appropriately.
  3. Use the logo from the GitLab instance. This requires a quick-shift, as we are about to make a big push to get maintainers to do option 1. Downsides here means two API calls, d.o. and GitLab, but long term that's probably not bad since that split-data architecture is inevitable. Logo URLs are predictable and could be set, but we'd still need to do a HEAD request or an API request to GitLab to fetch the data. Not sure what's involved for authentication to the GitLab API here, and if making this requests client-side would be possible. If not, we'd need a HEAD request to first see if the image was there, and if not display our fallback.

Remaining tasks

  • ✅ File an issue about this project
  • ☐ Open discussion to come to consensus
  • ☐ Make decision
  • ☐ File follow-up image to update code as needed

User interface changes

none

Data model changes

image could come from somewhere else

📌 Task
Status

Fixed

Version

1.0

Component

API site

Created by

🇺🇸United States chrisfromredfin Portland, Maine

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024