question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switch Idea Hub module REST routes to actually use Idea Hub API

See original GitHub issue

Now that the Idea Hub API client library code is available, Site Kit should actually start using the API.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The Idea_Hub class should have its REST data points that are intended to proxy through requests to the Idea Hub API updated to actually use the API. The necessary PHP client service classes are included in Site Kit via #3517.
    • The class needs to implement the setup_services method, to bootstrap a single ideahub service, which should be this class.
    • The get_datapoint_definitions method needs to be modified to reference the new ideahub service for all data points that use the API (GET:new-ideas, GET:saved-ideas, POST:update-idea-state).
    • The three above endpoints need to be connected to the respective Idea Hub API endpoint:

Implementation Brief

  • Add a protected function setup_services to the Idea_Hub class that creates a new instance of Google_Service_Ideahubto be used in the instance ofIdea_Hub`.
  • Modidy the existing get_datapoint_definitions in the Idea_Hub class so that the following point to array( 'service' => 'ideahub' ):
    • GET:new-ideas
    • GET:saved-ideas
    • POST:update-idea-state
  • See ACs for the implementation of each endpoint, as the ACs outline the implementation quite well.

Test Coverage

  • Existing tests should pass, but no new tests needed.

Visual Regression Changes

  • N/A

QA Brief

  • Activate Idea Hub module
  • Set the custom site URL setting in the Site Kit developer settings to https://www.elasticpress.io/
  • Go to the dashboard and verify that you see new ideas
  • Also check that you can create a draft post using a new idea and that idea won’t re-appear in the new ideas list once you refresh the dashboard page.

Changelog entry

  • Update Idea Hub to use the production API.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
felixarntzcommented, Jun 22, 2021

@eugene-manuilov Just two tiny updates here:

  1. Based on a few updates from the API team, it looks like the value we need to pass for the platform is “sitekit” instead of “SITEKIT” what I had in the ACs earlier. If one doesn’t work, please try out the other, just to make sure 😃
  2. The value passed for property needs to be URL-encoded since it is a URL which is part of a regular URL path. That probably would have come up during the implementation anyway, but I just updated the ACs to clarify.
1reaction
felixarntzcommented, Jul 20, 2021

@eugene-manuilov Per our Slack conversation, I’ve reduced the scope of this issue to no longer include any changes to POST:update-idea-state. This is now broken out into #3747.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Idea Hub API Client Library for .NET
This page contains information about getting started with the Idea Hub API by using the Google API Client Library for .NET.
Read more >
Build and sell your own API $$$ (super simple!) - YouTube
... how to make a profitable API and sell it on the RapidAPI Hub.00... ... ___ ⭐ Use promo code ANIAKUBOW for 3...
Read more >
REST API reference
You can use REST interfaces to access data on your instance. ... The AWA Routing API provides endpoints to route a document to...
Read more >
Tutorial to Create a Rest.li Server and Client
Quickstart - A step by step tutorial introduction to Rest.li. ... Using Idea or Eclipse is a handy way to explore and follow...
Read more >
How To Build a REST API with Prisma and PostgreSQL
Prisma is an open source database toolkit. In this tutorial, you will build a REST API for a small blogging application in TypeScript...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found