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

Backup does not include list of repos #6288

Open
palmtree5 opened this issue Feb 1, 2024 · 0 comments · May be fixed by #6289
Open

Backup does not include list of repos #6288

palmtree5 opened this issue Feb 1, 2024 · 0 comments · May be fixed by #6289
Labels
Category: Cogs - Downloader This is related to the Downloader cog. Category: Core - Other Internals This is related to core internals that don't have a dedicated label. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.

Comments

@palmtree5
Copy link
Member

What Red version are you using?

3.5.5

What were you trying to do?

I was in the process of working on #5703 and created a backup in order to work on the restore process

What did you expect to happen?

The repos.json file to be present in the backup

What actually happened?

I opened up the backup to look at the repos file generated to work on restoring the repos and cogs that the repos.json file being created during the backup process was not present in the specified folder

How can we reproduce this error?

  1. Create a backup
  2. Open the backup in something like 7-zip
  3. Navigate to the directory and see the file is missing
    ...

Anything else?

I believe this to be due to the exclusions, as I ran the code that pulls the list of files to add in an eval and found that the file was not present when I listed the files to be backed up, but was present when listing excluded files.

from pathlib import Path
import os
from redbot.core import data_manager

data_path = Path(data_manager.core_data_path().parent)

exclusions = [
    "__pycache__",
    "Lavalink.jar",
    os.path.join("Downloader", "lib"),
    os.path.join("CogManager", "cogs"),
    os.path.join("RepoManager", "repos"),
    os.path.join("Audio", "logs"),
]

out_list = []
for f in data_path.glob("**/*"):
    if not any(ex in str(f) for ex in exclusions) and f.is_file():
        out_list.append(str(f))
print("\n".join(out_list))

the exclusion in particular of RepoManager/repos is having the effect of excluding RepoManager/repos (the thing intended to be excluded), AND RepoManager/repos.json (which needs to be in the backup)

@palmtree5 palmtree5 added the Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. label Feb 1, 2024
@github-actions github-actions bot added the Status: Needs Triage This has not been labeled or discussed for handling yet. label Feb 1, 2024
@palmtree5 palmtree5 linked a pull request Feb 1, 2024 that will close this issue
@Kowlin Kowlin added Status: Accepted We want this Category: Cogs - Downloader This is related to the Downloader cog. Category: Core - Other Internals This is related to core internals that don't have a dedicated label. and removed Status: Needs Triage This has not been labeled or discussed for handling yet. labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Cogs - Downloader This is related to the Downloader cog. Category: Core - Other Internals This is related to core internals that don't have a dedicated label. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants