Skip to content

Add --dry-run Mode to Simulate Playbook Execution #18

@shalev007

Description

@shalev007

Problem:
Currently, there's no way to preview what a playbook would do without actually making HTTP requests. This makes debugging risky and error-prone—especially in destructive workflows (e.g., POSTing data or deleting resources).

A dry-run mode would let developers inspect:

  • Resolved variables
  • Final request URLs
  • Headers and body content (after Jinja rendering)

✅ What to Implement

  • Add a --dry-run flag to the CLI (restbook run --dry-run)
  • Simulate each step without sending requests
  • Print:
    • Resolved endpoint
    • Final headers
    • Final body / payload (from data or fromFile)
    • Stored variable names
  • Highlight any missing or unresolved variables
  • Exit cleanly with exit code 0 (unless validation fails)

💡 Why It Matters

  • Safer debugging during development
  • Great for CI/CD dry runs or change previews
  • Helps catch templating bugs early (missing vars, incorrect formatting)
  • Reduces accidental API spam / destructive calls

📎 Related Enhancements

  • Could later support a --dry-run=phase-2 or --until=phase-N for partial simulation
  • Option to write dry-run output to a file (--dry-run-output out.json)
  • Can integrate with restbook lint in the future

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions