-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: Error if purge request made with dev mode disabled #3295
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3295 +/- ##
========================================
Coverage 78.09% 78.09%
========================================
Files 382 382
Lines 35405 35412 +7
========================================
+ Hits 27647 27654 +7
+ Misses 6123 6122 -1
- Partials 1635 1636 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 19 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
praise: The code looks good and is easy to follow :) Good job on implementing the chosen design.
todo: I do think the design is faulty here, this will improve things for the http
and cli
clients, but not the embedded clients. And it worsens an existing discrepancy between the embedded Go client and the http
/cli
clients.
I expect push back from some other team members on my todo, so maybe chat with them before making changes.
IMO this is adding more tech debt on top of existing tech debt, and it would be much more sensible/cost-effective to fix the existing purge
problem first instead of continuing to build upon it.
The purge command doesn't need to exist in the embedded Go client. Its a development utility.
I'm not sure what you mean by existing problem. Can you add more context? |
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.
LGMT. I don't see the tech debt issue raised by Andy as the purge command is a development utility that I don't see a need for on the embedded Go client. Let just wait to resolve the "purge problem" conversation before merging.
Majority view is that Purge
is not needed in the embedded Go client. I still think it would be architecturally nicer, cheaper maintenance-wise, basically free to have there, but I'm not going to try fight everyone on that, especially not in the middle of this PR :)
Relevant issue(s)
Resolves #3140
Description
The issue was that if a purge request was made when the database was not in development mode, it would fail, and an error would be output on the node side of things. However, on the client side nothing indicated that the process had failed. Whether the purge was successful, or it failed, there would be no output.
I have created a new variable in the http package called
IsDevMode
, which is checked in thehttp/handler_extras.go/Purge
function. If dev mode is enabled thenhtttp.StatusOK
is written to the response header. If it is not enabled, thenhttp.StatusBadRequest
is written to the header instead, with a message indicating what happened.Tasks
How has this been tested?
The platform(s) on which this was tested: