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

TestGrid API: Dashboards should contain a reference to the group they belong to #1199

Open
chases2 opened this issue May 6, 2023 · 1 comment
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@chases2
Copy link
Collaborator

chases2 commented May 6, 2023

Currently, in the TestGrid API, there is no way to determine what dashboard (or if dashboard X) belongs to a group or not. This makes the index complicated; while the current UI displays groups and next to each other, the new index needs to do a lot of work to show a view this clean.

The List of Dashboards endpoint (http://testgrid-data.k8s.io/api/v1/dashboards) should also include the dashboard group, if there is one.

To do this, you'll need to

  1. Update the API proto with new fields
  2. Enhance the API program to fill these new fields

Adding a New Field

TestGrid's API is defined with this proto. The proto only defines the shape of the API data, so multiple programs can use it.

rpc ListDashboard(ListDashboardRequest) returns (ListDashboardResponse) {}

You'll need to change the ListDashboard response to include the new data. Unfortunately, the Resource message is used in multiple places, and we don't want to break everything else.

Consider:

  • Replacing the "Resource" with a new "DashboardResource" message that you can then add whatever you want to.
  • Returning two "Resource"s, one to the Dashboard and another to the Group.

For more info, https://protobuf.dev/ is a good place to start. We use "proto3" everywhere, not proto2. There is a go-specific tutorial that is pretty useful.

NOTE: When you've changed the proto, do not worry about running "protoc" correctly. You can regenerate the go code with this command:

bazel run //hack:update-protos

Updating the API

The API that actually emits this data is here. I leave this one more open-ended, since there are a lot of examples in config.go and config_test.go to reference.

@chases2 chases2 added good first issue Good for newcomers help wanted Extra attention is needed labels May 6, 2023
@ankur12-1610
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants