Skip to content
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: Status information about all snapshot profiles #2019

Draft
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

s4moore
Copy link
Contributor

@s4moore s4moore commented Jan 25, 2025

Implemented the 'status' command to provide a snapshot of the status of all profiles.

options:
-h, --help show this help message and exit
--profile NAME a more detailed summary of the profile with the name, NAME
--profile-id ID a more detailed summary of the profile with the id, ID
--issues show only profiles with errors on most recent run or no snapshot history at all
--human-readable, -r print in human readable format

Consider adding a CHANGELOG entry.
Run "codespell" to check for typos.

Close #1018

@buhtz
Copy link
Member

buhtz commented Jan 25, 2025

Looks nice in a first place. You are on the right track.

@buhtz buhtz added this to the 2nd release from now milestone Jan 25, 2025
@buhtz buhtz marked this pull request as draft January 25, 2025 17:57
@s4moore s4moore marked this pull request as ready for review January 26, 2025 09:27
@buhtz buhtz added the PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team. label Jan 26, 2025
Copy link
Member

@buhtz buhtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be aware that I updated your branch to the latest dev. So you have to update your local working branch, too.

  • Please set the PR into Draft mode if it isn't finished yet. This helps me organizing.
  • Added some PEP8 related suggestions.
  • Feel free to add yourself into the SPDX header of backintime.py.
  • Different from my first comments about it I would prefer to make human readable output the default behavior. So add --json as a new switch and remove --human-readable.

The --issues switch is not working as expected. I might misunderstand something?

$ ./backintime status --issues
usage: backintime status [-h] [--profile NAME | --profile-id ID | --issues ] [--human-readable]
backintime status: error: argument --issues: expected one argument

$ ./backintime status --profile 1 --issues
usage: backintime status [-h] [--profile NAME | --profile-id ID | --issues ] [--human-readable]
backintime status: error: argument --issues: expected one argument

@buhtz buhtz added PR: Modifications requested Maintenance team requested modifications and waiting for their implementation and removed PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team. labels Feb 2, 2025
@s4moore s4moore marked this pull request as draft February 2, 2025 23:13
@s4moore
Copy link
Contributor Author

s4moore commented Feb 2, 2025

I've commited some changes (and converted pr to draft):

  • fixed --issues switch
  • changed default to human readable output
  • added --json switch for machine readable output
  • implemented checking status on ssh drives

I've been trying different layouts for the output and I think it looks neat now but I was wondering if I should add a --compact switch or something similar in case the user has lots of profiles, what do you think?

Is there any other information you want to be displayed in the profile specific view (or the overview)?

@buhtz buhtz removed the PR: Modifications requested Maintenance team requested modifications and waiting for their implementation label Feb 3, 2025
@buhtz buhtz added the PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team. label Feb 3, 2025
@buhtz
Copy link
Member

buhtz commented Feb 9, 2025

Looks good.

There is a bug in BIT that helps you somehow. 🤣
Your connections cause INFO logging outputs on terminal. Usually this polute the json string. But BIT has the bug that every logging output, not matter of its level, is on stderr.

So your json output and the log output is separated.

...
STDERR: INFO: Connecting to: unittest
STDERR: INFO: mount ssh_encfs: user@localhost:/home/user/Downloads/bit_test_ssh_encfs on /home/user/.local/share/backintime/mnt/8D19350B/mountpoint
STDERR: INFO: unmount ssh_encfs: user@localhost:/home/user/Downloads/bit_test_ssh_encfs from /home/user/.local/share/backintime/mnt/8D19350B/mountpoint
STDOUT: {
STDOUT: "Main profile": {
STDOUT: "Last snapshot": "2023-08-13 15:30:34",
STDOUT: "Successful": true
STDOUT: },
...

We can keep it that way. Re-write the logging machine, using Pythons in-build logging, is also on my list. But it is that big that I won't touch it yet.

Usually I would say that your feature should somehow silence the log output. But with this BIT bug there is no need. Let's keep it simple.

@buhtz buhtz added HELP-WANTED Used by 24pullrequests.com to suggest issues PR: Merge after creative-break Merge after creative-break (min. 1 week) labels Feb 9, 2025
@buhtz buhtz changed the title feat: Status information about all snapshot profiles #1018 feat: Status information about all snapshot profiles Feb 9, 2025
@s4moore
Copy link
Contributor Author

s4moore commented Feb 15, 2025

Do you have any suggestions on other data to be included or other changes to be made? Otherwise, should I start to look at incorporating this funcitonality into the gui?

On a side note, thank you for including me in the list of contributors for the release candidate. Just a heads-up for possible future mentions, I recently changed my github username from mooresamuel to s4moore.

@s4moore
Copy link
Contributor Author

s4moore commented Feb 20, 2025

I've made a start at incorporating this into the gui. Let me know if you think this approach works or what you think would be better.

output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HELP-WANTED Used by 24pullrequests.com to suggest issues PR: Merge after creative-break Merge after creative-break (min. 1 week) PR: Waiting for review PR won't be merged until review and approval from a member of the maintenance team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Activity or status information's about all snapshot profiles (in machine readable JSON format)
2 participants