Problem/Motivation

Currently, there is no caching of results on the endpoints, which might trigger the same request to the plugin source (ie: www.drupal.org).
There is also no validation of the parameters sent in the query, which will make the plugins' job a bit more difficult, so it is a good idea to filter and check it all in the controller before asking the plugin for the data.

Steps to reproduce

Request any of the endpoints (ie: releases) and a new request will be made each time, even if we are asking for the same endpoint with the same parameters.

Proposed resolution

Cache the results within the controller and validate the inputs received before asking for data to the plugin.

Remaining tasks

  • ✅ File an issue about this project
  • ☐ Addition/Change/Update/Fix to this project
  • ☐ Testing to ensure no regression
  • ☐ Automated unit/functional testing coverage
  • ☐ Developer Documentation support on feature change/addition
  • ☐ User Guide Documentation support on feature change/addition
  • ☐ Code review from 1 Drupal core team member
  • ☐ Full testing and approval
  • ☐ Credit contributors
  • ☐ Review with the product owner
  • ☐ Release

User interface changes

None.

API changes

Introduced a new cache bin so we can clear the bin if the plugin ever changes, without needing to clear all the Drupal cache.

Data model changes

None.

Release notes snippet

Added validation to the parameters passed to the endpoints and cached the results to avoid multiple requests for the same information.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fjgarlin created an issue. See original summary.

fjgarlin’s picture

Status: Active » Needs review

MR supplied. Marking as "Needs review".

fjgarlin’s picture

Assigned: Unassigned » fjgarlin
Status: Needs review » Needs work
Related issues: +#3279676: Remove references to taxonomy_vocabulary_3 and the like from Svelte

If the related issue gets merged first (it's already RTBC) then we'll need to add some changes here. Changing to "Needs work" until that happens.

fjgarlin’s picture

Status: Needs work » Needs review

Related issue was merged, so I rebased this branch and did the follow-up changes.

This MR validates/standardises the input from the query parameters and also caches the results per query.
If you're testing this locally for the first time, remember to do `drush cr` before anything else.

Ready to review.

chrisfromredfin made their first commit to this issue’s fork.

chrisfromredfin’s picture

Status: Needs review » Reviewed & tested by the community

This has been rebased off latest and tested for regressions.

fjgarlin’s picture

Status: Reviewed & tested by the community » Needs work
Related issues: +#3240320: Filters for advanced / "all" search
fjgarlin’s picture

Status: Needs work » Needs review
chrisfromredfin’s picture

Status: Needs review » Reviewed & tested by the community

Re-checked against latest. RTBC as long as the tests pass.

tim.plunkett made their first commit to this issue’s fork.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Merged, thanks!

Status: Fixed » Closed (fixed)

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