Skip to content

Use entity datasource for REST mutations - #3882

Open
Souvik Ghosh (souvikghosh04) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-table-writes-http-500
Open

Souvik Ghosh (souvikghosh04) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-table-writes-http-500

Conversation

Copilot AI commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Why make this change?

REST table mutations for entities in linked data-source-files configs use the root datasource’s metadata, causing HTTP 500 errors. Mutations should work for entities across all configured datasources.

What is this change?

  • Select the REST mutation datasource using the target entity’s configured datasource.
  • Add a regression test verifying a linked entity uses its linked metadata provider.

How was this tested?

  • Integration Tests
  • Unit Tests

Sample Request(s)

POST /api/Db2Customers
Content-Type: application/json

{ "Name": "test" }

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: souvikghosh04 <210500244+souvikghosh04@users.noreply.github.com>

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.

🟢 Approval recommended

No active review issues are recorded for the change routing REST mutations through the target entity’s configured datasource.

No open issues 🎉

What changed in this PR

Fixes REST table mutations for entities in linked datasource configurations by selecting the entity’s configured datasource instead of the root datasource, addressing the failure reported in #3701.

Changes:

  • Resolve the mutation datasource from the target entity.
  • Add a regression test verifying that a linked entity’s DELETE mutation uses the linked metadata provider, not the root provider.
File Description
src/​Service.Tests/​UnitTests/​SqlMutationEngineHelperTests.cs Adds regression coverage for linked-datasource mutation routing.
src/​Core/​Resolvers/​SqlMutationEngine.cs Selects the entity-specific datasource for REST mutations.

Review effort: Balanced

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

Labels

None yet

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

[Bug]: Table writes fail (HTTP 500) for entities defined in a linked data-source-files config

6 participants