Skip to content

feat: add GetDashboard and assert every query field carries a uri tag - #454

Draft
NickJosevski wants to merge 1 commit into
mainfrom
nj/dashboard-get
Draft

feat: add GetDashboard and assert every query field carries a uri tag#454
NickJosevski wants to merge 1 commit into
mainfrom
nj/dashboard-get

Conversation

@NickJosevski

Copy link
Copy Markdown
Contributor

Closes #442.

GetDashboard

DashboardService implements the non-dynamic endpoint, reusing the existing DashboardQuery and the Dashboard type from #441. Expanded via the service's own URI template, as its siblings do.

Verified against a live server, counts from that instance:

Request Items IsFiltered
no parameters 10 false
projectId=<id> 3 true
projectId=<name> 0 true
releaseId=<id> 2 true
selectedTenants=<id> 1 true
selectedTags=Region/Aus-East 1 true
showAll=true 10 false
highestLatestVersionPerProjectAndEnvironment=true 10 false

Filters on IDs only, same as the dynamic endpoint: a name matches nothing and returns an empty dashboard rather than an error. showAll and highestLatestVersion... are accepted but had no observable effect on this dataset, so their behaviour is untested beyond the parameter reaching the server.

DashboardQuery.IncludeLatest

It carried only a url tag. uritemplates reads uri, so it expanded to nothing:

DashboardQuery{ProjectID: "Projects-1", IncludeLatest: true, ShowAll: true}
  -> /api//dashboard?projectId=Projects-1&showAll=true

highestLatestVersionPerProjectAndEnvironment never reached the server. Adds the uri tag with omitempty, which is right because both bools are non-nullable and default to false server side.

Audit test

test/conventions walks every *Query struct under pkg/ and fails on any field without a uri tag, calling out url-only fields specifically. 98 structs across 626 files; IncludeLatest was the only violation. Confirmed it fails when the tag is removed.

It does not catch a uri tag whose name is absent from the template, nor a response type used as a query — which is what #437 was.

DashboardService now implements the non-dynamic dashboard, reusing the
existing DashboardQuery and Dashboard types.

DashboardQuery.IncludeLatest carried only a url tag, so the uritemplates
path dropped it and highestLatestVersionPerProjectAndEnvironment never
reached the server. Adds the uri tag, plus a test that walks every *Query
struct under pkg/ and fails on a field without one.

Closes #442

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Feat: Add GetDashboard for the non-dynamic dashboard endpoint

1 participant