Implement `sztabQuery` CLI for Issue DSL Execution (SZ-70)
rk@tigase.net opened 2 weeks ago

Introduce a command-line interface (sztabQuery) that allows developers and operators to interactively execute Issue DSL queries against a running Sztab backend. The CLI should support SQL like syntax to filter and search for issues in Sztab. Proposed example:

$ sztabDsl --connect sztab.tigase.net --username admin
  Password:
     *** Sztab ver 1.8, DSL v1.0, 125 open issues in 6 projects ***
     sztabDsl>
     sztabDsl> SELECT key, title, severity, priority, age, component, project
               FROM issues
               WHERE severity IN (HIGH, CRITICAL)
                   AND status IN (NEW, ASSIGNED, IN_PROGRESS)
                   AND age OLDER_THAN 7d
               ORDER BY severity DESC, age DESC
               LIMIT 20

      sztabDsl> SELECT key, title, status, assignee, timeInStatus
                FROM issues
                WHERE status = IN_PROGRESS
                      AND timeInStatus OLDER_THAN 14d
                ORDER BY timeInStatus DESC
                     LIMIT 15



Scope

  • Client-side tool only
  • No new backend features
  • Relies exclusively on existing Issue Query REST endpoints
  • Intended for developers, operators, and advanced users
  • rk@tigase.net commented 2 weeks ago

    Work Estimate

    Functional Requirements

    1. Interactive CLI Shell

    • REPL-style interactive shell
    • Persistent command history across sessions
    • Multiline DSL query input
    • Clear separation between CLI commands and raw DSL
    • Graceful handling of interrupts and exit

    Estimated time: 3–4 hours


    2. Authentication Layer

    • Support for:
      • JWT-based authentication
      • Basic authentication (for local/dev)
    • Configurable backend base URL
    • Secure handling of credentials and tokens
    • Session reuse across multiple queries
    • Explicit login/logout commands

    Estimated time: 3–4 hours


    3. Query Execution

    • Submit DSL queries to:
      • /api/issues/query/execute
      • /api/issues/query/parse
      • /api/issues/query/validate
    • Surface backend errors verbatim
    • Preserve parse error positions
    • Distinguish parse, validation, and execution failures

    Estimated time: 2–3 hours


    4. Output Formatting

    • Tabular rendering of query results
    • Column alignment and truncation
    • Row count and execution-time metadata
    • Optional JSON/raw output mode
    • Clear display of error messages and warnings

    Estimated time: 2–3 hours


    5. Configuration & UX

    • Config file or environment-based configuration
    • Sensible defaults for local development
    • Helpful help and status commands
    • Minimal but discoverable command set

    Estimated time: 1–2 hours


    Non-Goals

    • No UI integration
    • No query caching
    • No write or mutation operations
    • No production hardening
    • No attempt to abstract backend semantics

    Deliverables

    • sztabQuery CLI executable
    • Authentication abstraction layer
    • HTTP client for Issue Query endpoints
    • Result rendering module
    • Minimal documentation and usage examples

    Estimated Total Effort

    12–18 hours, depending on polish level and error-handling depth.

  • rk@tigase.net commented 2 weeks ago
    rksuma@Ramakrishnans-MacBook-Pro sztab % git checkout wolnosc
    Already on 'wolnosc'
    Your branch is up to date with 'origin/wolnosc'.
    rksuma@Ramakrishnans-MacBook-Pro sztab % git pull  
    Already up to date.
    rksuma@Ramakrishnans-MacBook-Pro sztab % git checkout -b feature/Issue-DSL-CLI
    Switched to a new branch 'feature/Issue-DSL-CLI'
    rksuma@Ramakrishnans-MacBook-Pro sztab % 
    
    
  • rk@tigase.net changed state to 'In Progress' 2 weeks ago
    Previous Value Current Value
    Open
    In Progress
  • rk@tigase.net commented 2 weeks ago

    PR: https://tigase.dev/sztab/~pulls/8

    (merged into wolsonsc)

  • rk@tigase.net changed state to 'Closed' 2 weeks ago
    Previous Value Current Value
    In Progress
    Closed
issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Version
none
Sprints
n/a
Customer
n/a
Issue Votes (0)
Watchers (3)
Reference
SZ-70
Please wait...
Page is in error, reload to recover