Commit graph

39 commits

Author SHA1 Message Date
MinaSaad1
93c4275848 fix: wrap long lines in tests to pass ruff E501 (>100 chars) 2026-04-07 17:17:13 +02:00
MinaSaad1
895e90d710 fix: correct 7 PBIR report-layer issues found during Desktop testing
- visual bind: remove legacy Commands/SemanticQueryDataShapeCommand block
  (PBIR 2.7.0 uses additionalProperties:false -- Commands is a hard schema error)
- visual bind: add active:true to column (category/row/detail) projections
  so Desktop treats the field as the active axis
- visual add: remove empty "objects:{}" from all 32 visual templates
  (noisy and rejected by strict schema validators)
- visual add: write position coordinates as integers not floats
  (Desktop normalises to int; 320.0 vs 320 caused inconsistency)
- report set-background: always write transparency:0 alongside color
  (Desktop defaults missing transparency to 100 = fully invisible)
- report validate: drop false-positive layoutOptimization required error
  (real Microsoft 3.2.0 schema does not require this field)
- all write commands: add --no-sync flag to report/visual/filters/bookmarks
  groups to suppress per-command Desktop reload during scripted builds;
  use pbi report reload for a single sync at the end
2026-04-07 17:13:41 +02:00
MinaSaad1
8b7bef9e6d fix: resolve CI failures from _ensure_ready removal
- connection.py: move skills_cmd import to module level (fixes ruff I001)
- setup_cmd.py: remove dead _ensure_ready import and call (fixes mypy attr-defined)
- tests/conftest.py: remove _ensure_ready monkeypatch (function no longer exists)
- tests/test_commands/test_setup.py: remove _ensure_ready patch
2026-04-05 22:27:40 +02:00
MinaSaad1
5acb3f33e3 fix: resolve CI failures (formatting, mypy, test import)
- Run ruff format on all 26 unformatted files
- Fix mypy strict errors: add explicit typing for json.loads returns,
  add pywin32/websockets to mypy ignore_missing_imports
- Remove yaml dependency from test_skill_triggering.py (use regex parser)
- Fix skill triggering test to handle both single-line and multi-line
  description formats in YAML frontmatter
2026-04-02 15:59:49 +02:00
MinaSaad1
56ddacbfb1 chore: add missing v3 source and test files
19 files from earlier v3 sessions were created on disk but never
staged/committed: 11 source modules (backends, preview, templates,
utils) and 8 test files (488 tests depend on these).

Without these files the package would be broken on install.
Found during pre-publish review.
2026-04-02 15:37:19 +02:00
MinaSaad1
f0504bcf51 feat: v3.10.0 -- audit fixes, 12 skills, README rewrite
- Fix 4 code bugs: TopN filter cross-table, theme_set corruption,
  visual_bind type annotation, tmdl_diff hierarchy pluralization
- Add missing VisualTypeError and ReportNotFoundError to errors.py
- Register 5 command groups in CLI (report, visual, filters, format, bookmarks)
- Split monolithic report skill into 5 focused skills (12 total):
  power-bi-report, power-bi-visuals, power-bi-pages, power-bi-themes,
  power-bi-filters
- Update CLAUDE.md snippet for 12 skills organised by layer
- Add diff-tmdl section to deployment skill
- Write CHANGELOG entries for v3.0.0 through v3.10.0
- Rewrite README.md and README.pypi.md for both model and report layers
- Add skill triggering test suite (19/19 passing)
- 488 tests passing, ruff clean
2026-04-02 00:07:52 +02:00
MinaSaad1
88cb644f64 feat: add pbi database diff-tmdl command (v3.9.0) 2026-04-01 22:31:51 +02:00
MinaSaad1
d5574d2e9a feat: add pbi database diff-tmdl command (v3.9.0)
Pure-Python TMDL folder diff for CI/CD model change reporting.
No Power BI Desktop connection required. Handles direct and
SemanticModel folder layouts, strips lineageTags to avoid false
positives, and keys relationships by fromColumn->toColumn instead
of GUIDs. 18 tests covering all diff scenarios.
2026-04-01 22:27:57 +02:00
MinaSaad1
0afb44200c fix: update hardening test to use Values role for card (Fields -> Values fix) 2026-04-01 22:08:28 +02:00
MinaSaad1
e6085418b7 feat: surface pageBinding in page_get for drillthrough pages (v3.8.0)
Adds page_binding key to the page_get() return dict using data.get("pageBinding"),
returning None for regular pages and the full binding dict for drillthrough pages.
Two new tests in TestPageGet cover both the None and present cases.
2026-04-01 22:05:59 +02:00
MinaSaad1
ff295578ae feat: add azureMap visual type (v3.8.0)
Register azureMap in SUPPORTED_VISUAL_TYPES and VISUAL_TYPE_ALIASES
(azure_map, map), add Category+Size data roles and role aliases, default
size 500x400, renderer color/icon, and template. All 4 new tests pass.
2026-04-01 22:03:08 +02:00
MinaSaad1
bd7e3cd50a test: add bind integration tests for kpi TrendLine and gauge MaxValue roles 2026-04-01 21:59:58 +02:00
MinaSaad1
9f2a7b044e fix: add TrendLine to kpi and MaxValue to gauge queryState roles
Confirmed from Sales_Report.Report Desktop export: kpi visuals have a
third queryState key TrendLine (date/axis column for the sparkline), and
gauge visuals have a second queryState key MaxValue (a measure role).

- kpi.json template: add TrendLine projection slot
- gauge.json template: add MaxValue projection slot
- VISUAL_DATA_ROLES: updated kpi and gauge role lists
- ROLE_ALIASES: added trend_line/trend aliases for kpi, max/max_value/target for gauge
- MEASURE_ROLES: added MaxValue (TrendLine binds to Column, not Measure)
- tests: 6 new tests covering template structure and alias resolution
2026-04-01 21:52:50 +02:00
MinaSaad1
628a5fb758 fix: strengthen card/multiRowCard test assertions, comment Fields in MEASURE_ROLES
- Add isinstance(qs["Values"], dict) assertion to card and multiRowCard tests
- Add inline comment on "Fields" in MEASURE_ROLES clarifying it is used by cardNew only
2026-04-01 21:50:36 +02:00
MinaSaad1
407ce11ff6 fix: correct card and multiRowCard queryState role from Fields to Values
Real Power BI Desktop PBIR exports use "Values" as the queryState role key
for card and multiRowCard visuals. The previous "Fields" key was silently
ignored by Desktop, causing visual_bind to write bindings that had no effect.
Updated templates, VISUAL_DATA_ROLES, and ROLE_ALIASES accordingly. Added
two regression tests to lock in the correct role name.
2026-04-01 21:47:22 +02:00
MinaSaad1
8b0958eb10 feat: surface page_type, filter_config, visual_interactions in page read ops (v3.7.0) 2026-04-01 21:22:31 +02:00
MinaSaad1
316fafa675 feat: add advancedSlicerVisual (tile/image slicer) visual type (v3.6.0)
Registers advancedSlicerVisual with aliases advanced_slicer, adv_slicer,
and tile_slicer. Includes template with Values queryState, data roles,
role aliases, default size (280x280), renderer color/icon, and tests.
2026-04-01 21:02:24 +02:00
MinaSaad1
ba44ff814c feat: add image, shape, textbox, pageNavigator visual types (v3.6.0) 2026-04-01 21:00:25 +02:00
MinaSaad1
8362335866 feat: add clusteredColumnChart, clusteredBarChart, textSlicer, listSlicer (v3.5.0) 2026-04-01 20:45:16 +02:00
MinaSaad1
eb75d5a198 fix: update visual container schema URL from 1.5.0 to 2.7.0
Update SCHEMA_VISUAL_CONTAINER constant and all 22 visual template JSON
files to use visualContainer/2.7.0/schema.json instead of 1.5.0.
2026-04-01 20:42:12 +02:00
MinaSaad1
a8272926f3 fix: address review issues -- validate color, guard KeyError, surface visibility, detect no-op, fix -g shorthand
- Guard missing 'visual' key in visual_set_container with PbiCliError
- Detect no-op in visual_set_container when no args are provided
- Remove -g shorthand from set-container --page option
- Add is_hidden field to page_list and page_get return dicts
- Validate hex color format in page_set_background before writing
- Add tests for all new validation and behaviour
2026-04-01 19:25:33 +02:00
MinaSaad1
24539335c5 feat: add visual_set_container and pbi visual set-container command
Implements Task 4: container-level property control for PBIR visuals.
visual_set_container() updates border/background show and title text in
visual.visualContainerObjects using immutable dict spreading. The CLI
command pbi visual set-container exposes all three options as optional
flags, leaving unspecified keys unchanged.
2026-04-01 19:16:17 +02:00
MinaSaad1
bd82712f64 feat: add page_set_visibility and pbi report set-visibility command
Implements Task 3: hidden pages write "visibility": "HiddenInViewMode"
to page.json; unhiding removes the key. Includes 4 tests covering hide,
show, idempotent-show, and missing-page error.
2026-04-01 19:11:10 +02:00
MinaSaad1
230b40ef61 feat: add page_set_background and pbi report set-background command
Implements immutable background-color writing into page.json objects dict,
preserving any existing object properties (e.g. outspace). Wires to the
`pbi report set-background <page_name> --color <hex>` CLI subcommand.
2026-04-01 18:47:25 +02:00
MinaSaad1
b783aa0f6b feat: add cardVisual and actionButton visual types (v3.4.0)
- Register cardVisual and actionButton in SUPPORTED_VISUAL_TYPES
- Add aliases: card_visual, modern_card -> cardVisual; action_button, button -> actionButton
- cardVisual template includes Data queryState role and sortDefinition (matches Desktop export)
- actionButton template omits query entirely and adds howCreated: InsertVisualButton
- Add Data to MEASURE_ROLES, update VISUAL_DATA_ROLES and ROLE_ALIASES accordingly
- Set default sizes from real Desktop export: cardVisual (217x87), actionButton (51x22)
- Add renderer colors and icons for both new types
- 4 new tests; all 398 tests pass, ruff clean
2026-04-01 18:40:03 +02:00
MinaSaad1
e4fd958e13 feat: v2.1.0 - improve Claude skill triggering and CLAUDE.md auto-injection
- Update all 7 skill descriptions to be pushy with explicit trigger phrases
- Add DAX expression limitations section to power-bi-dax skill (VAR/RETURN workarounds)
- Add date/calendar table creation section to power-bi-modeling skill
- Add quick troubleshooting section to power-bi-diagnostics skill
- Auto-inject pbi-cli section into ~/.claude/CLAUDE.md on `pbi connect`
- Auto-remove pbi-cli section on `pbi skills uninstall`
- Extract claude_integration.py module to avoid circular imports
- Add 7 unit tests for CLAUDE.md snippet lifecycle
2026-03-27 12:00:41 +02:00
MinaSaad1
3f3fc7bdf1 fix: format remaining 6 files flagged by ruff format 2026-03-27 07:30:21 +02:00
MinaSaad1
b777adec55 feat: v2.0.0 - replace MCP server with direct pythonnet/.NET TOM interop
Remove the MCP server binary dependency entirely. All 22 command groups now
connect directly to Power BI Desktop's Analysis Services engine via pythonnet
and bundled Microsoft.AnalysisServices DLLs (~20MB, in-process).

- Direct .NET TOM/ADOMD.NET interop for sub-second command execution
- 7 Claude Code skills (added Diagnostics and Partitions & Expressions)
- New commands: trace, transaction, calendar, expression, partition, advanced culture
- 91 tests passing, all skills updated, README/CHANGELOG rewritten
2026-03-27 07:19:21 +02:00
MinaSaad1
d9951aeecc fix: use server-assigned connection name instead of local name
The MCP server assigns connection names like "PBIDesktop-demo-57947"
but we were saving and reusing "localhost-57947", causing "connection
not found" errors on subsequent commands. Now _auto_reconnect extracts
the server-returned connectionName from the Connect response.
2026-03-26 23:03:23 +02:00
MinaSaad1
fb5cea04d9 fix: auto-reconnect to saved connection on each command
Each non-REPL command starts a fresh MCP server process, so the
connection must be re-established. Commands now silently reconnect
using the saved connection info before running the actual tool call.
2026-03-26 20:28:45 +02:00
MinaSaad1
084809c6d6 fix: resolve connectionName from store when no --connection flag
Commands now automatically use the last-used connection from
connections.json instead of requiring --connection or -c flag.
2026-03-26 20:17:42 +02:00
MinaSaad1
e19981d98c fix: apply ruff formatting to platform module and tests 2026-03-26 20:01:15 +02:00
MinaSaad1
144222aa31 feat: support Microsoft Store PBI Desktop and update setup docs
- Add Store version path (~\Microsoft\Power BI Desktop Store App\)
  alongside MSI path for port auto-discovery
- Fix UTF-16 LE encoding when reading msmdsrv.port.txt
- Update all 5 skills to reflect new install flow (pipx + pbi connect)
- Update error messages, docstrings, and READMEs to mention pbi connect
  as the primary entry point instead of pbi setup
- Add tests for Store path discovery, encoding, and path candidates
2026-03-26 19:58:54 +02:00
MinaSaad1
bb1c225a20 test: add discover_pbi_port tests and fix binary_manager test isolation 2026-03-26 16:43:06 +02:00
MinaSaad1
62b2305909 fix: patch _ensure_ready in tests to prevent real downloads in CI 2026-03-26 16:31:34 +02:00
MinaSaad1
ea726f8e48 style: apply ruff format to all source and test files 2026-03-26 14:55:44 +02:00
MinaSaad1
11691c8d92 fix: resolve mypy and ruff CI errors across all source and test files
- Fix Traversable import with TYPE_CHECKING guard for Python 3.10-3.14 compat
- Add explicit dict[str, object] type annotations to all request dicts
- Fix unused variable and import warnings in connection.py and test files
- Break long lines to satisfy ruff E501 (100-char limit)
- Fix click.MultiCommand -> click.Group for mypy arg-type in repl.py
- Wrap binary_manager return in str() for mypy no-any-return
2026-03-26 14:51:35 +02:00
MinaSaad1
51a23668a7 feat: add REPL mode, test suite, CI/CD, and Claude Skills (Sprints 6-8)
Sprint 6 - REPL Mode + Polish:
- Error hierarchy (PbiCliError, McpToolError, etc.) for clean REPL error handling
- Interactive REPL with prompt-toolkit (persistent MCP connection, command completion, history)
- REPL-aware run_tool() and connection commands that reuse shared client
- README.md and CHANGELOG.md

Sprint 7 - Tests + CI/CD:
- 120 tests across unit, command, and e2e test files (79% coverage)
- MockPbiMcpClient with canned responses for test isolation
- GitHub Actions CI (lint + typecheck + test matrix: 3 OS x 3 Python)
- GitHub Actions release workflow for PyPI trusted publishing

Sprint 8 - Claude Skills + Installer:
- 5 bundled SKILL.md files (modeling, dax, deployment, security, docs)
- `pbi skills install/list/uninstall` command for Claude Code discovery
- Skills packaged with wheel via setuptools package-data
2026-03-26 13:54:24 +02:00
MinaSaad1
170413cf22 feat: initial pbi-cli project with all 20+ command groups
Complete CLI framework for Power BI semantic models via MCP server:

- Core: MCP client (stdio via mcp SDK), binary manager (VSIX download),
  config, connection store, dual output (JSON + Rich)
- Commands: setup, connect, dax, measure, table, column, relationship,
  model, database, security-role, calc-group, partition, perspective,
  hierarchy, expression, calendar, trace, transaction, advanced
- Binary resolution: env var > managed > VS Code extension fallback
- Global --json flag for agent consumption
2026-03-26 13:05:53 +02:00