-
Notifications
You must be signed in to change notification settings - Fork 339
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
Removing collections package and API cleanup #1501
Conversation
4c51bd1
to
e19bd3b
Compare
62f37ed
to
cb76b2d
Compare
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.
great work! can we eliminate dirs
endpoint?
Yes we can technically remove it now itself. It was listed as a separate work item, so was not sure if there is anything else we need to do. Beekeeper tests need to change. Will be looking into that now. |
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.
This is really great stuff :) I have a few minor comments, but otherwise this looks great! 🙏
pkg/api/bzz_test.go
Outdated
http.StatusBadRequest, | ||
jsonhttptest.WithRequestBody(bytes.NewReader(simpleData)), | ||
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ | ||
Message: "invalid content-type header", |
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.
the pattern we usually use is to define the error as a package variable (unexported), then export it using export_test
, then check for the exact error which is exported in the `export_test_ file in the tests, instead of checking for the hardcoded text value (this allows to change the error messages later on quite easily)
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 went down a rabbit hole here. There are too many. I tried to do everything in the bzz/dirs files.
jsonhttptest.WithExpectedResponse([]byte(expectedResponse)), | ||
) | ||
} | ||
|
||
validateBzzPath := func(t *testing.T, fromPath, toPath string) { | ||
validateAltPath := func(t *testing.T, fromPath, toPath string) { |
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.
do we need the rename? I think valdiateBzzPath
captures it no?
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.
This function validates that the file served on both the 'fromPath' and 'toPath' is the same (for redirects).
I named it 'AltPath' for 'alternate path'. I think this is better no?
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.
Looks good 👍 minor non-blockers otherwise good to go.
Merge checklist:
- beekeeper adjusted tests pass a cluster running this branch
- beekeeper PR merged and new version tagged
- this PR can be merged then
File upload handler. New header for collections. Fixing tests. Adding new tests. Open API changes.
20fa031
to
9c57250
Compare
#1444 #1543