feat: add GetDashboard and assert every query field carries a uri tag - #454
Draft
NickJosevski wants to merge 1 commit into
Draft
feat: add GetDashboard and assert every query field carries a uri tag#454NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #442.
GetDashboardDashboardServiceimplements the non-dynamic endpoint, reusing the existingDashboardQueryand theDashboardtype from #441. Expanded via the service's own URI template, as its siblings do.Verified against a live server, counts from that instance:
projectId=<id>projectId=<name>releaseId=<id>selectedTenants=<id>selectedTags=Region/Aus-EastshowAll=truehighestLatestVersionPerProjectAndEnvironment=trueFilters on IDs only, same as the dynamic endpoint: a name matches nothing and returns an empty dashboard rather than an error.
showAllandhighestLatestVersion...are accepted but had no observable effect on this dataset, so their behaviour is untested beyond the parameter reaching the server.DashboardQuery.IncludeLatestIt carried only a
urltag.uritemplatesreadsuri, so it expanded to nothing:highestLatestVersionPerProjectAndEnvironmentnever reached the server. Adds theuritag withomitempty, which is right because both bools are non-nullable and default tofalseserver side.Audit test
test/conventionswalks every*Querystruct underpkg/and fails on any field without auritag, calling outurl-only fields specifically. 98 structs across 626 files;IncludeLatestwas the only violation. Confirmed it fails when the tag is removed.It does not catch a
uritag whose name is absent from the template, nor a response type used as a query — which is what #437 was.