Add cluster reports tab via backplane API#325
Merged
Conversation
Add a new "Reports" tab (tab 6) to display CORA cluster diagnostic reports fetched from the backplane API. Uses direct HTTP calls with OCM Bearer auth instead of importing backplane-cli dependencies. - New pkg/backplane/ package: config loader, HTTP client, mock, types - Reads ~/.config/backplane/config.json for proxy config - Resolves backplane URL from OCM environment metadata when config url field is empty (standard setup) - Adds GetAccessToken() and GetBackplaneURL() to OCMClient interface - Phase 2 enrichment: dispatches report fetch after cluster info loads - Graceful degradation: shows "Backplane not enabled" if no config - Deferred client creation for async OCM auth flow - 92% test coverage on backplane package Created with assistance from Claude 🤖 <[email protected]> Signed-off-by: Christopher Collins <[email protected]>
Add plan doc for #316 and update README to document the new Reports tab and backplane integration. Created with assistance from Claude 🤖 <[email protected]> Signed-off-by: Christopher Collins <[email protected]>
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (46.74%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #325 +/- ##
==========================================
- Coverage 68.30% 67.60% -0.71%
==========================================
Files 46 49 +3
Lines 7323 7568 +245
==========================================
+ Hits 5002 5116 +114
- Misses 1988 2110 +122
- Partials 333 342 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
pkg/backplane/package with direct HTTP client — nobackplane-clidependency~/.config/backplane/config.jsonfor proxy config, resolves backplane URL from OCM environment metadataCloses #316
Details
New package:
pkg/backplane/backplane.go— types (ReportSummary,Report) andBackplaneClientinterfaceconfig.go— reads~/.config/backplane/config.json(proxy-url, govcloud); accepts empty URL (resolved from OCM)client.go— HTTP client with Bearer auth from OCM access token, proxy supportmock.go— mock client for dev mode with fixture loading fromtestdata/fixtures/clusterreports.jsonOCMClient interface additions:
GetAccessToken() (string, error)— extracts OCM access token viaconn.Tokens()for Bearer authGetBackplaneURL() (string, error)— resolves backplane API URL from OCM environment metadataTUI integration:
tabReports(tab 6) withrenderClusterReportsTab()getClusterReports()after cluster info resolvesclusterReportsMsghandler caches results per clusterTest coverage: 92.1% on
pkg/backplane/Test plan
make test-allpasses (fmt, vet, lint, test, race)srepd --dev) shows Reports tab with fixture dataCreated with assistance from Claude 🤖 [email protected]