Skip to content

Add RefactorLog support: contracts, service methods, tree rendering and tests - #22371

Draft
Sai Avishkar Sreerama (ssreerama) wants to merge 2 commits into
mainfrom
sai/July/refactorlog_tree_support
Draft

Add RefactorLog support: contracts, service methods, tree rendering and tests#22371
Sai Avishkar Sreerama (ssreerama) wants to merge 2 commits into
mainfrom
sai/July/refactorlog_tree_support

Conversation

@ssreerama

@ssreerama Sai Avishkar Sreerama (ssreerama) commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds end-to-end support for displaying <RefactorLog> entries from SQL project files in the database project tree view.

Changes

extensions/mssql — service layer

  • sqlProjectsContracts.ts — Added GetRefactorLogItemsRequest, AddRefactorLogItemRequest, DeleteRefactorLogItemRequest request types
  • sqlProjectsService.ts — Added getRefactorLogItems, addRefactorLogItem, deleteRefactorLogItem methods
  • vscode-mssql.d.ts — Added 3 new methods to ISqlProjectsService interface

extensions/sql-database-projects — tree UI

  • constants.ts — Added DatabaseProjectItemType.refactorLogFile constant
  • fileFolderTreeItem.ts — Added RefactorLogNode class (mirrors NoneNode)
  • project.ts — Added _refactorLogItems field, refactorLogItems getter, readRefactorLogItems(), addRefactorLogItem(), deleteRefactorLogItem(); wired readRefactorLogItems() alongside all readNoneItems() callsites
  • projectTreeItem.ts — Renders RefactorLogNode entries in tree construct() loop

Tests

  • sqlProjectsService.test.ts (new) — 5 unit tests for new service methods
  • project.test.ts — Added "Project: RefactorLog items" suite with read/add/delete tests
  • projectTree.test.ts — Added test verifying RefactorLogNode rendering with correct context value
  • openSqlProjectWithRefactorLogBaseline.xml (new) — Test fixture with 2 <RefactorLog> entries

- Add GetRefactorLogItems, AddRefactorLogItem, DeleteRefactorLogItem request types
  in sqlProjectsContracts.ts
- Add getRefactorLogItems/addRefactorLogItem/deleteRefactorLogItem methods to
  SqlProjectsService and ISqlProjectsService interface
- Add DatabaseProjectItemType.refactorLogFile constant and RefactorLogNode tree item
- Read RefactorLog items from project file (readRefactorLogItems) and expose via
  project.refactorLogItems; wire up in all project refresh/add/delete callsites
- Render RefactorLogNode entries in projectTreeItem.ts construct loop
- Add unit tests for new service methods (sqlProjectsService.test.ts)
- Add project.test.ts suite for reading/adding/deleting RefactorLog items
- Add projectTree.test.ts test for RefactorLogNode tree rendering
- Add openSqlProjectWithRefactorLogBaseline.xml test fixture

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds end-to-end support for surfacing <RefactorLog> items from .sqlproj files in the SQL Database Projects tree, by extending the vscode-mssql SqlProjects service contract + client and wiring the new item type through the Project model and tree rendering. It also adds unit/integration tests and a baseline fixture to validate parsing, service calls, and tree node context values.

Changes:

  • Extended SqlProjects service contracts/typings and SqlProjectsService client with getRefactorLogItems, addRefactorLogItem, and deleteRefactorLogItem.
  • Added Project.refactorLogItems plumbing (read/add/delete + refresh callsites) and rendered these items in the project tree as RefactorLogNode with a dedicated context value.
  • Added tests and a new .sqlproj baseline fixture containing <RefactorLog> entries.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extensions/sql-database-projects/test/projectTree.test.ts Adds coverage ensuring RefactorLog entries render as RefactorLogNode with the correct context value.
extensions/sql-database-projects/test/project.test.ts Adds integration tests for reading/adding/deleting RefactorLog items via the Project model.
extensions/sql-database-projects/test/baselines/openSqlProjectWithRefactorLogBaseline.xml New .sqlproj baseline fixture containing <RefactorLog> items for parsing tests.
extensions/sql-database-projects/test/baselines/baselines.ts Registers and loads the new RefactorLog baseline fixture.
extensions/sql-database-projects/src/models/tree/projectTreeItem.ts Renders project.refactorLogItems in the tree construction loop.
extensions/sql-database-projects/src/models/tree/fileFolderTreeItem.ts Introduces RefactorLogNode to set the tree item context value for RefactorLog files.
extensions/sql-database-projects/src/models/project.ts Adds _refactorLogItems storage plus read/add/delete methods and refresh wiring.
extensions/sql-database-projects/src/common/constants.ts Adds DatabaseProjectItemType.refactorLogFile context value constant.
extensions/mssql/typings/vscode-mssql.d.ts Extends ISqlProjectsService typings with the new RefactorLog APIs.
extensions/mssql/test/unit/sqlProjectsService.test.ts New unit tests validating request types/params and success/failure propagation for new service methods.
extensions/mssql/src/services/sqlProjectsService.ts Implements the 3 new SqlProjects service methods by sending the new request types.
extensions/mssql/src/models/contracts/sqlProjects/sqlProjectsContracts.ts Adds new request contract types for RefactorLog endpoints.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 79072 KB 79072 KB ⚪ 0 KB ( 0% )
sql-database-projects VSIX 6310 KB 6314 KB ⚪ 4 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )
keymap VSIX 7 KB 7 KB ⚪ 0 KB ( 0% )

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.38017% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.30%. Comparing base (6e671a2) to head (0987bc5).
⚠️ Report is 176 commits behind head on main.

Files with missing lines Patch % Lines
...nsions/sql-database-projects/src/models/project.ts 42.59% 31 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #22371      +/-   ##
==========================================
- Coverage   88.45%   86.30%   -2.15%     
==========================================
  Files         413      326      -87     
  Lines      130316   115426   -14890     
  Branches     8265      447    -7818     
==========================================
- Hits       115273    99624   -15649     
- Misses      15043    15802     +759     
Flag Coverage Δ
data-workspace 77.10% <ø> (ø)
mssql 89.28% <100.00%> (-0.44%) ⬇️
sqlproj 62.08% <62.65%> (-15.48%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...xtensions/mssql/src/services/sqlProjectsService.ts 100.00% <100.00%> (+51.95%) ⬆️
...ions/sql-database-projects/src/common/constants.ts 72.46% <100.00%> (-8.29%) ⬇️
...ase-projects/src/models/tree/fileFolderTreeItem.ts 82.38% <100.00%> (-1.89%) ⬇️
...tabase-projects/src/models/tree/projectTreeItem.ts 74.38% <100.00%> (-10.97%) ⬇️
.../sql-database-projects/test/baselines/baselines.ts 100.00% <100.00%> (ø)
...nsions/sql-database-projects/src/models/project.ts 44.82% <42.59%> (-47.02%) ⬇️

... and 205 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants