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
2 changes: 1 addition & 1 deletion src/lib/config-generator/yaml-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function generateVectorYaml(
// Inject a per-sink metadata enrichment transform to preserve topology
if (enrichment) {
const sinkKeys = Object.keys(config.sinks ?? {});
const vrl = `.vectorflow.environment = ${JSON.stringify(enrichment.environmentName)}\n.vectorflow.pipeline_version = ${enrichment.pipelineVersion}`;
const vrl = `.vectorflow.environment = ${JSON.stringify(enrichment.environmentName.toLowerCase())}\n.vectorflow.pipeline_version = ${enrichment.pipelineVersion}`;

for (const sinkKey of sinkKeys) {
const sink = config.sinks[sinkKey] as Record<string, unknown>;
Expand Down
11 changes: 9 additions & 2 deletions src/server/routers/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const pipelineRouter = router({
include: {
nodes: true,
edges: true,
environment: { select: { teamId: true, gitOpsMode: true } },
environment: { select: { teamId: true, gitOpsMode: true, name: true } },
nodeStatuses: {
select: { status: true },
},
Expand All @@ -231,7 +231,7 @@ export const pipelineRouter = router({
const latestVersion = await prisma.pipelineVersion.findFirst({
where: { pipelineId: input.id },
orderBy: { version: "desc" },
select: { configYaml: true, logLevel: true },
select: { configYaml: true, logLevel: true, version: true },
});

if (latestVersion) {
Expand All @@ -252,10 +252,17 @@ export const pipelineRouter = router({
target: e.targetNodeId,
...(e.sourcePort ? { sourceHandle: e.sourcePort } : {}),
}));
const enrichment = pipeline.enrichMetadata
? {
environmentName: pipeline.environment.name,
pipelineVersion: latestVersion.version,
}
: null;
const currentYaml = generateVectorYaml(
flowNodes as Parameters<typeof generateVectorYaml>[0],
flowEdges as Parameters<typeof generateVectorYaml>[1],
pipeline.globalConfig as Record<string, unknown> | null,
enrichment,
);
hasConfigChanges = currentYaml !== latestVersion.configYaml;

Expand Down
Loading