Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions DataFactory.MCP.Core/Configuration/DataFactoryJsonContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using System.Text.Json;
using System.Text.Json.Serialization;
using DataFactory.MCP.Models.AirflowJob;
using DataFactory.MCP.Models.AirflowJob.Definition;
using DataFactory.MCP.Models.Capacity;
using DataFactory.MCP.Models.Common;
using DataFactory.MCP.Models.Connection;
Expand Down Expand Up @@ -97,6 +99,16 @@ namespace DataFactory.MCP.Configuration;
[JsonSerializable(typeof(JsonElement))]
[JsonSerializable(typeof(EmptyRequest))]
[JsonSerializable(typeof(RunOnDemandRequest))]
// AirflowJob types
[JsonSerializable(typeof(AirflowJob))]
[JsonSerializable(typeof(CreateAirflowJobRequest))]
[JsonSerializable(typeof(UpdateAirflowJobRequest))]
[JsonSerializable(typeof(ListAirflowJobsResponse))]
// AirflowJob Definition types
[JsonSerializable(typeof(AirflowJobDefinition))]
[JsonSerializable(typeof(AirflowJobDefinitionPart))]
[JsonSerializable(typeof(GetAirflowJobDefinitionResponse))]
[JsonSerializable(typeof(UpdateAirflowJobDefinitionRequest))]
internal sealed partial class DataFactoryJsonContext : JsonSerializerContext
{
}
6 changes: 3 additions & 3 deletions DataFactory.MCP.Core/Resources/McpApps/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion DataFactory.MCP.Core/Services/FabricAirflowJobService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using DataFactory.MCP.Infrastructure.Http;
using DataFactory.MCP.Models.AirflowJob;
using DataFactory.MCP.Models.AirflowJob.Definition;
using DataFactory.MCP.Models.Common;
using Microsoft.Extensions.Logging;

namespace DataFactory.MCP.Services;
Expand Down Expand Up @@ -185,7 +186,7 @@ public async Task<AirflowJobDefinition> GetAirflowJobDefinitionAsync(
Logger.LogInformation("Getting definition for Apache Airflow Job {AirflowJobId} in workspace {WorkspaceId}",
airflowJobId, workspaceId);

var emptyRequest = new { };
var emptyRequest = new EmptyRequest();
var response = await PostAsync<GetAirflowJobDefinitionResponse>(endpoint, emptyRequest)
?? throw new InvalidOperationException("Failed to get Apache Airflow Job definition response");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,13 @@ public async Task AirflowJob_FullLifecycle_CreateGetUpdateDeleteAsync()
if (!IsValidJson(createResult)) return; // API may not support creation in test workspace

var createJson = JsonDocument.Parse(createResult);

// Skip if API returned an error (e.g., workspace doesn't support Airflow Jobs)
if (createJson.RootElement.TryGetProperty("success", out var successProp) && !successProp.GetBoolean())
{
Skip.If(true, $"Skipping lifecycle test - create returned error: {createResult}");
}

Assert.True(createJson.RootElement.TryGetProperty("airflowJobId", out var idElement),
$"Create response missing airflowJobId. Response: {createResult}");
airflowJobId = idElement.GetString();
Expand Down
Loading