Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashboards): Add browse end point for charts and dashboards #2143

Merged

Conversation

dexter-mh-lee
Copy link
Contributor

Add browse endpoint for charts and dashboards to GMS so that we can surface charts and dashboards on the home page.
Note, this is a backend only change.

Scope
This PR is primarily scoped to gms and elastic-search.

Changes

  1. Add browsePaths to the search index setting for charts and dashboards
  2. Add browsePaths as "dashboardToolEntity/(dashboard|chart)Id" in the index builders
  3. Add browse and getBrowsePaths endpoints to chart and dashboard rest.li clients

Test

curl --location --request POST 'http://localhost:8080/dashboards?action=browse' \
--header 'X-RestLi-Protocol-Version: 2.0.0' \
--header 'Content-Type: text/plain' \
--data-raw '{"path": "", "start": 0, "limit": 10}'
{
    "value": {
        "numEntities": 0,
        "pageSize": 0,
        "metadata": {
            "totalNumEntities": 1,
            "groups": [
                {
                    "name": "looker",
                    "count": 1
                }
            ],
            "path": ""
        },
        "from": 0,
        "entities": []
    }
}
curl --location --request POST 'http://localhost:8080/dashboards?action=browse' \
--header 'X-RestLi-Protocol-Version: 2.0.0' \
--header 'Content-Type: text/plain' \
--data-raw '{"path": "/looker", "start": 0, "limit": 10}'
{
    "value": {
        "numEntities": 1,
        "pageSize": 1,
        "metadata": {
            "totalNumEntities": 1,
            "groups": [],
            "path": "/looker"
        },
        "from": 0,
        "entities": [
            {
                "name": "baz2",
                "urn": "urn:li:dashboard:(looker,baz2)"
            }
        ]
    }
}

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

@jjoyce0510
Copy link
Collaborator

Overall is looking really good --- thanks for the contrib!

CI seems to be failing with

symbol: class BrowseConfigFactory
1923
location: package com.linkedin.metadata.configs
1924
/home/runner/work/datahub/datahub/gms/factories/src/main/java/com/linkedin/gms/factory/dataset/DatasetBrowseDAOFactory.java:25: error: cannot find symbol
1925
BrowseConfigFactory.getBrowseConfig(DatasetDocument.class));

@dexter-mh-lee
Copy link
Contributor Author

Some new files were not added before pushing. All checks pass

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shirshanka shirshanka merged commit cda1ce4 into datahub-project:master Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants