-
Notifications
You must be signed in to change notification settings - Fork 288
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
Fix saving option only using days argument #424
Conversation
EDIT: amending for CHANGELOG.md Signed-off-by: Thibaud CANALE <[email protected]>
Thanks for the contribution! I understand the goal and it is a good idea to fix this. There is existing logic from lines 264 to 291 that should be moved into a re-usable function so that both Once a single function is created to handle the date calculations, a new unit test can be created to test that new function. I will enable the automated test runs for this PR so that you can begin getting test feedback, but it is expected that contributors can fully execute the unit tests locally before submitting PRs. Relying on GitHub to execute tests for each commit is not recommended. |
Hello @jertel, thanks for your review. I agree with you, as it is also my point of view, there need to be a refactoring of those logics. However my (first) approach is to fix steps by steps stuffs which could be fixed without requiring to break or rework other part of the code. About the new function you talked about, did you plan to implement the bases of this new, refactored, logic? Best regards, |
Hello! No, I do not have plans to refactor this. Since you created the PR I am giving feedback to you so that the PR can be accepted. As it is now it will fix a bug but will also introduce technical debt to the project by having duplicated code. So my goal in providing the feedback to you is to help ensure the fix is correct, tested, and maintainable. If you're unable to finish the PR we can leave the PR open for a while, and mark it as a Work In Progress (WIP) to see if anyone else would like to assist you. |
Signed-off-by: Thibaud CANALE <[email protected]>
Signed-off-by: Thibaud CANALE <[email protected]>
Hello again, I submitted new patches to improve as much as I could without modifying code out of the scope of this issue. I am even thinking I over did however those modifications were required to not introduce new errors. Is this the result you were expecting? Is it validate for you? Please keep me updated. Best regards, |
Yes, the changes look good. I only had the one code review concern about the |
I posted a comment explaining some details, pointing out |
Thanks for the explanation; I see what you're doing now. |
Signed-off-by: Thibaud CANALE [email protected]
Description
The saving feature was unable to save content without the none default --days argument.
Now it should be able to store content with --start/--end and for the last day without --days argument, as described in the help section of arguments.
Checklist
make test-docker
with my changes.Questions or Comments
I was unable to test my commit because I met some issue to run the Docker test (I am behind a corporate proxy, I fails to fetch content from the WAN) or to execute directly the Python script (some circular imports issues).
About the documentation, this is a fix so there is nothing to update.
If someone could test for me, my tries were unsuccessful:
As you might have noticed, I store the timestamp in the class instead of querying for each call, this allows to keep a steady differential between days.
Best regards,