Update Cube proxy to work with Cube JS library
What does this MR do and why?
This MR changes the following:
- Moves the endpoint from being a
POST
to aGET
- Append the
/load
to the end of the endpoint - Add the
queryType
param to the Cube API query body
These changes are behind the :cube_api_proxy
feature flag.
Screenshots or screen recordings
Created using the patches in the issue and associated MRs
Screen_Recording_2022-10-11_at_15.42.53
How to set up and validate locally
- Enable the feature flag:
echo "Feature.enable(:cube_api_proxy)" | rails c
. - Set up the devkit and start it running using
docker-compose up
. - Update application settings:
echo "ApplicationSetting.current.update(cube_api_base_url: 'http://localhost:4000', cube_api_key: API KEY FROM CUBE .env)" | rails c
. - As an authenticated user who has developer+ access to a particular project, make the following API call:
POST /api/v4/projects/{PROJECT_ID}/product_analytics/request
Content-Type: application/json
Send it with a valid cube query as a JSON body:
{
"query": {
"measures": [
"Jitsu.count"
],
"timeDimensions": [
{
"dimension": "Jitsu.utcTime",
"dateRange": "This week"
}
],
"order": [
[
"Jitsu.count",
"desc"
],
[
"Jitsu.docPath",
"desc"
],
[
"Jitsu.utcTime",
"asc"
]
],
"dimensions": [
"Jitsu.docPath"
],
"limit": 23
},
"queryType": "multi"
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #377511 (closed)
Merge request reports
Activity
changed milestone to %15.5
assigned to @rob.hunt
- Resolved by 🤖 GitLab Bot 🤖
Proper labels assigned to this merge request. Please ignore me.
@rob.hunt - please see the following guidance and update this merge request.1 Warning Please add a subtype label to this merge request. If you have added a type label and do not feel the purpose of this merge request matches one of the subtypes labels, please resolve this discussion.
Edited by 🤖 GitLab Bot 🤖
added bugfunctional label
removed workflowin dev label
added 17 commits
-
277890f7...9fcc65fd - 15 commits from branch
master
- 46bf8f6c - Change endpoint to GET and make sure it has the correct params
- 9ce3f7bb - Update the documentation
-
277890f7...9fcc65fd - 15 commits from branch
- A deleted user
added documentation label
2 Messages CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, add the
Changelog
trailer to the commit message you want to add to the changelog.If you want to create a changelog entry for GitLab EE, also add the
EE: true
trailer to your commit message.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
doc/api/product_analytics.md
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Bishwa Hang Rai ( @bhrai
) (UTC+2, 1 hour ahead of@rob.hunt
)Matthias Käppler ( @mkaeppler
) (UTC+2, 1 hour ahead of@rob.hunt
)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangerrequested review from @mwoolf
Setting label(s) ~"Category:Product Analytics" based on groupproduct analytics.
added Category:Product Analytics Visualization label
requested review from @agarciatesares
@agarciatesares
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
Hey @rob.hunt
I just took a look, and it works! Thanks.removed review request for @agarciatesares
requested review from @marc_shaw and removed review request for @mwoolf
mentioned in merge request !98613 (merged)
enabled an automatic merge when the pipeline for 3b27e87a succeeds
mentioned in commit f69230d8
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
added releasedcandidate label
mentioned in issue #381696 (closed)
mentioned in merge request !103330 (merged)
added releasedpublished label and removed releasedcandidate label