Skip to content

feat(site): add --verbose flag to restore command#550

Open
wustwyh wants to merge 1 commit into
frappe:developfrom
wustwyh:fix/restore-verbose
Open

feat(site): add --verbose flag to restore command#550
wustwyh wants to merge 1 commit into
frappe:developfrom
wustwyh:fix/restore-verbose

Conversation

@wustwyh

@wustwyh wustwyh commented Jun 23, 2026

Copy link
Copy Markdown

Add the --verbose flag when invoking �ench --site restore so that progress information is emitted during heavy backup restores.

Fixes #483

Add the --verbose flag when invoking �ench --site <site> restore so
that progress information is emitted during heavy backup restores.

Fixes frappe#483
@mergify

mergify Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge — a one-line flag addition with a well-structured test covering the new behaviour.

The change is a single string literal addition to the bench restore command. The test correctly patches all dependencies, calls the unwrapped function, and verifies the flag is present. No logic paths are altered and no new risk surfaces are introduced.

No files require special attention.

Important Files Changed

Filename Overview
agent/site.py Adds --verbose flag to the bench restore command string in restore_site; change is minimal and correctly positioned between --force restore and the credential options.
agent/tests/test_site.py Adds a unit test that patches bench_execute and create_mariadb_user, calls restore_site.__wrapped__ to bypass the @step decorator, and asserts --verbose appears in the captured command; logic and mock wiring are correct.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Caller
    participant Site
    participant Bench
    participant BenchCLI as bench CLI

    Caller->>Site: restore_site(mariadb_root_password, admin_password, db_file, pub_file, priv_file)
    Site->>Bench: create_mariadb_user(site_name, root_pw, db)
    Bench-->>Site: (_, temp_user, temp_password)
    Site->>BenchCLI: "bench --site <site> --force restore --verbose --mariadb-root-username ... [files]"
    BenchCLI-->>Site: output
    Site->>Bench: drop_mariadb_user(site_name, root_pw, db)
    Site-->>Caller: result
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Caller
    participant Site
    participant Bench
    participant BenchCLI as bench CLI

    Caller->>Site: restore_site(mariadb_root_password, admin_password, db_file, pub_file, priv_file)
    Site->>Bench: create_mariadb_user(site_name, root_pw, db)
    Bench-->>Site: (_, temp_user, temp_password)
    Site->>BenchCLI: "bench --site <site> --force restore --verbose --mariadb-root-username ... [files]"
    BenchCLI-->>Site: output
    Site->>Bench: drop_mariadb_user(site_name, root_pw, db)
    Site-->>Caller: result
Loading

Reviews (1): Last reviewed commit: "feat(site): add --verbose flag to restor..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Higher verbosity in backup restore job

1 participant