Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The current Project Browser calls the unofficial Drupal.org endpoint for project data. The more-supported and future-proof way is to make an API call to the Drupal 9 site that has been built and to which project data from Drupal.org has been migrated.
Proposed resolution
Make the API endpoint semi-configurable (i.e. leverage config without a UI), and point it at the Drupal 9 site. Rewrite all the API layer to use JSON:API from the data coming back from that site.
Remaining tasks
- change the endpoint
- rewrite the API-digesting code
- ensure Drupal 9 site is ready
- ensure Drupal 9 migrations are ongoing
API changes
Lots. :)
Data model changes
???
Issue fork project_browser-3240319
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
Comment #2
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedAdjusted title slightly as this issue is exactly what I am working on. Assigning to me. I will create an issue fork so we can see the progress.
Note that it is built from the changes introduced here: https://www.drupal.org/project/project_browser/issues/3278352
Comment #4
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedThe referenced issues changes are added to this MR as they're useful/needed.
Comment #5
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedWaiting for related issues to go through as this one relies on those.
Comment #10
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedInclude the correct namespace for composer as separate property here too.
Comment #16
narendraRI have moved the plugin in
project_browser_test
module in MR#308. May be some other work needs to be done here hence not changing assignee/Status.Comment #17
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedAdded some more feedback, really small.
Actually, the only reason why I was assigned to it was to make sure I was able to keep up with the rest of PB changes on this issue, but as we're now making ready to be in the module, there is no need to have me as assignee.
Other than the small feedback I added, I think we can start asking for reviews. @narendraR, @bnjmnm and myself have worked on it, so maybe a further review from @tim.plunkett would be great.
MR#308 is the one to review.
Comment #18
narendraRAddressed feedback and marking as needs review.
Comment #19
tim.plunkettComment #20
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedIntegrated the new logo field, which will be a separate field on projects on the new www.drupal.org D9/10 version.
This was a follow-up from #3334783: Integrate GitLab Logo png to Drupal.org D7 project pages and #3334807: Repository logo on projects pages styling as the repo gitlab avatar is now displayed on the project pages.
Comment #21
lostcarpark CreditAttribution: lostcarpark as a volunteer commentedThis is fantastic progress.
I think we just need to be aware that when this is promoted to the D9 endpoint, it will have the effect that many projects that have logos in the first image will lose their logos in Project Browser.
Comment #22
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedWe can just define the policy here #3277464: [PLAN] Where to fetch image from? and then implement the logic in this issue.
We can just fetch from the new D9 logo_url field (this is what's done right now), or add a fallback if needed.
As for the "losing" logos, taking a first image as a logo doesn't make it a logo (there are some comments about it in the linked issue). Maintainers that do worry about their logo will quickly update, and as far as I know, all the logo suggestions that we will make to the top 100 will also be made with the recommendation of adding it as logo.png to the repo.
Once users start seeing their modules showing up in project browser, they'll change logos, descriptions, etc and the advantage of the live endpoint is that the changes will show up in real-time.
In any case, I'm happy to implement whatever is decided.
Comment #23
chrisfromredfin@fjgarlin - Can you confirm that logo_url is only being used in the D9 version in this branch? Right now, those who have their logo as logo.png will _never_ see that appear for PB data generated from the fixture, because logo_url isn't available from the D7 API?
OR, is it and we could actually update the fixture generation code to use it? (I don't see it, say, here: https://www.drupal.org/api-d7/node.json?nid=640498 )
Comment #24
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedCorrect Chris. It's not part of the json output.
On D7, we check it (and cache it) on the fly from the gitlab avatar URL, no field required.
On D9, this is a field that checks the above URL, and populates it.
We could alter the fixture generation to check the gitlab avatar and set it as logo. That won't be a difficult one. I'm happy to address it (best on a separate issue).
Comment #25
bbralaI think it might also need a rebase? :)
Comment #28
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedIt seems that markup has changed and the CSS selectors in the tests are no longer up to date. I will try to work on them.
Comment #29
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedOk, a lot of markup changed since the test was written.
All feedback that was given at DrupalCon was addressed and all the tests have been fixed.
Ready to review again.
Comment #30
bbralaReviewed the code for the JSON:API source. Seems there is an testing issue left though.
Comment #31
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedTests are green now. I forgot to propagate the change to another part of the file. I love having tests.
Comment #32
bbralaWent through the last commits, changes look as expected. Only a small comment on a comment (lol), but that is probablly nothing.
RTBC if i may ;)
Comment #33
chrisfromredfinWoohoo! This is a major milestone step forward, and I can confirm it's not breaking anything in the UI. Renaming issue and filing follow-up.