-
Notifications
You must be signed in to change notification settings - Fork 138
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
CBG-3720: Diagnostic API - get all user channels endpoint #6647
Conversation
14e338e
to
fcfb93d
Compare
new Response format
|
Some more feedback after testing: Default collectionThe response for the default channel doesn't match the response format for collections, and doesn't contain any sequence information. They should be consistent and use the After adding named collections:It doesn't appear to support a named default collection (e.g. a db config running with |
Redocly previews |
Can you rebase/fix tests before I review again? |
e8bc436
to
080f36b
Compare
e6135e0
to
583fa05
Compare
rest/diagnostic_api.go
Outdated
if len(collectionChannels) == 0 && len(channelHistory) == 0 { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this avoid making empty maps? Hitting the continue
statement is identical to going through this loop with a no-op
rest/diagnostic_api_test.go
Outdated
"/{{.db}}/_user/"+username+"/_all_channels", ``) | ||
RequireStatus(rt.TB, response, http.StatusOK) | ||
rt.TB.Logf("All channels response: %s", response.BodyString()) | ||
require.JSONEq(rt.TB, expectedOutput, convertUpdatedTimeToConstant(rt.TB, response.BodyBytes())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like these changes but I think we should test _default._default
and named collections explicitly, especially because our handling of _default._default
in user docs is different.
I think we can do this by adding golang templating to the output. I think we might be able to directly call
sync_gateway/rest/utilities_testing.go
Line 687 in cef73b7
func (rt *RestTester) mustTemplateResource(resource string) string { |
and replace explicit _default._default
with {{.keyspace}}
but you should check and let me know if this isn't true.
…le named collection (#6836)
https://jenkins.sgwdev.com/job/SyncGateway-Integration/2441/ XATTRS = true |
CBG-3720
Describe your PR here...
/{keyspace}/_user/{user}/all_channels
endpoint, returns list of channels.Pre-review checklist
fmt.Print
,log.Print
, ...)base.UD(docID)
,base.MD(dbName)
)docs/api
Dependencies (if applicable)
Integration Tests
GSI=true,xattrs=true
https://jenkins.sgwdev.com/job/SyncGateway-Integration/2318/