Skip to content

feat(knowledge): persist Cosmos DB resource ID - #9598

Open
Bryan Bennett (bjbennet) wants to merge 3 commits into
Azure:mainfrom
bjbennet:brbenn-microsoft-cosmos-resource-id
Open

feat(knowledge): persist Cosmos DB resource ID#9598
Bryan Bennett (bjbennet) wants to merge 3 commits into
Azure:mainfrom
bjbennet:brbenn-microsoft-cosmos-resource-id

Conversation

@bjbennet

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Knowledge hub connections currently persist the selected Cosmos DB endpoint but discard the Azure resource ID chosen in the connection wizard. This change serializes the existing Cosmos DB account selection as cosmosDB.resourceId, making the account identity available alongside the endpoint in connections.json.

Impact of Change

  • Users: Newly created and updated knowledge hub connections retain the selected Cosmos DB account resource ID.
  • Developers: KnowledgeHubConnectionModel.cosmosDB now includes a required resourceId property.
  • System: The Standard connection serializer writes the selected account ID under knowledgeHubConnections.HubConnection.cosmosDB.resourceId and restores it when editing.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: Focused Vitest suites for designer knowledge connection metadata and Standard connection persistence (43 tests)

Contributors

@brbenn_microsoft

Screenshots/Videos

N/A - no visual changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 3, 2026 17:42
@bjbennet Bryan Bennett (bjbennet) added the risk:medium Medium risk change with potential impact label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: feat(knowledge): persist Cosmos DB resource ID
  • Issue: None — uses a valid feat: prefix with a scope and is descriptive.
  • Recommendation: No change needed.

Commit Type

  • Exactly one type selected (feature - New functionality), which aligns with the feat: title prefix.
  • Note: the label reads "feature" rather than "feat," but it maps to the correct box — no action required.

Risk Level

  • Declared Medium in the body and labeled risk:medium — these match each other and match the advised estimate. This change modifies shared runtime code in libs/logic-apps-shared/src/designer-client-services (connection serialization/model) plus the VS Code extension distribution, which is squarely Medium per the rubric (shared runtime + state/serialization changes, no security/breaking-API impact).

What & Why

  • Current: Clear explanation that Cosmos DB resource ID is now serialized as cosmosDB.resourceId alongside the endpoint in connections.json.
  • Issue: None.
  • Recommendation: No change needed.

Impact of Change

  • All three audiences (Users, Developers, System) are addressed with concrete detail.
  • Recommendation:
    • Users: Adequately described (connections retain the selected Cosmos DB account resource ID).
    • Developers: Adequately described (KnowledgeHubConnectionModel.cosmosDB gains resourceId).
    • System: Adequately described (serializer writes/restores the resource ID).

Test Plan

  • Unit tests added/updated — confirmed in the diff across libs/designer/.../knowledge/utils/__test__/connection.spec.ts, libs/logic-apps-shared/.../standard/__tests__/connection.spec.ts, and apps/vs-code-designer/.../__test__/connection.test.ts. Satisfies CHECK TESTS.

Contributors

  • Credited @brbenn_microsoft — thank you for acknowledging collaborators.

⚠️ Screenshots/Videos

  • Marked N/A. The diff touches libs/designer/src only in test/utility serialization logic (no visual UI components), so screenshots are not required. No action needed.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level Medium is correct and consistent
What & Why No change needed
Impact of Change No change needed
Test Plan Unit tests present
Contributors Contributor credited
Screenshots/Videos ⚠️ Not required (non-visual change)

All required checks pass. This PR is compliant and cleared to merge. 🎉


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Thu, 03 Sep 2026 21:07:26 GMT

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.

🟡 Changes recommended

Existing connections cannot persist updates, and requiring resourceId breaks compatibility with legacy connection data.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Persists Cosmos DB resource IDs for Knowledge Hub connections and restores them during editing.

Changes:

  • Adds cosmosDB.resourceId serialization and restoration.
  • Extends connection models and focused unit coverage.
  • Requires fixes for legacy compatibility and updating existing connections.
File summaries
File Review
libs/logic-apps-shared/src/designer-client-services/lib/standard/connection.ts Adds resourceId, but it must remain optional for legacy data compatibility.
libs/logic-apps-shared/src/designer-client-services/lib/standard/__tests__/connection.spec.ts Tests resource ID serialization.
libs/designer/src/lib/core/knowledge/utils/connection.ts Adds serialization, but existing connections are not overwritten by host writers.
libs/designer/src/lib/core/knowledge/utils/__test__/connection.spec.ts Tests metadata and edit restoration; host-writer update coverage is still needed.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libs/designer/src/lib/core/knowledge/utils/connection.ts
Comment thread libs/logic-apps-shared/src/designer-client-services/lib/standard/connection.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants