Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add GroupBy option to snapshots command #2087
What is the purpose of this change? What does it change?
This commit adds a --group-by option to the snapshots command, which
The default behavior (when --group-by is not given) has not changed.
More to this discussion can be found in issue #2037.
Was the change discussed in an issue or in the forum before?
Yes, it was discussed in issue #2037.
Hey, I want to work on the group-by option discussed in #2037. The main functionality is already done, whats missing are tests, documentation and changelogs.
As this is my first contribution to restic and also my first time coding in Go, I have some questions:
I hope my contribution helps!
@@ Coverage Diff @@ ## master #2087 +/- ## ========================================== - Coverage 50.69% 46.35% -4.35% ========================================== Files 176 177 +1 Lines 14167 14215 +48 ========================================== - Hits 7182 6589 -593 - Misses 5938 6632 +694 + Partials 1047 994 -53
fd0 left a comment
Hey, I've had a look at the code, thanks for your contribution (especially as a first-time contributor new to Go)!
I've got a few things that you could improve in the code, but it looks great already.
For testing, we're using the builtin testing framework, you can easily run all tests with
Unfortunately, we don't have tests for user-interface interactions like this in place (at least not yet).
Let me know if you need any help!
Okay, this is nearly complete, I just have some last questions:
The tests succeed with my changes, but shall I add new ones? I have no idea how I should design such UI tests. Maybe just save the expected output into a fixture?
Furthermore I added a changelog file, whats missing now is the modification of the documentation. Where shall I mention it? Maybe at the working with repos section?
Okay, I refactored the forget command to use the shared code and added the documentation. Tests are green for me, just waiting for the CI to confirm this. As I do not know how to do the interface tests (and we did not have them before), I believe this is ready for review.