Skip to content

Commit 8e6491b

Browse files
feat: enhanced deployment outputs (CopilotKit#1051)
* add print cdk outputs * fix typo * define lgc js in infra * fix typo
1 parent 565a1be commit 8e6491b

8 files changed

Lines changed: 44 additions & 20 deletions

File tree

.github/workflows/preview-envs-deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ jobs:
195195
GITHUB_ACTIONS_RUN_ID: "${{ github.run_id }}"
196196
GITHUB_PR_NUMBER: "${{ github.event.number }}"
197197

198+
- name: Print CDK Outputs
199+
working-directory: infra
200+
run: |
201+
cat cdk_outputs.json
202+
198203
- name: Generate table from outputs
199204
id: generate-table
200205
working-directory: infra

examples/e2e/tests/coagents-canvas-researcher-demo.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { test, expect } from "@playwright/test";
2-
import { waitForStepsAndEnsureStreaming, waitForResponse, sendChatMessage } from "../lib/helpers";
2+
import {
3+
waitForStepsAndEnsureStreaming,
4+
waitForResponse,
5+
sendChatMessage,
6+
} from "../lib/helpers";
37
import {
48
getConfigs,
59
filterConfigsByProject,
@@ -31,9 +35,7 @@ Object.entries(groupedConfigs).forEach(([projectName, descriptions]) => {
3135
appendLGCVariants(
3236
{
3337
...config,
34-
lgcJSDeploymentUrl:
35-
config.lgcJSDeploymentUrl ??
36-
"https://coagents-research-canvas-st-08476feebc3a58e5925116da0d3ad635.default.us.langgraph.app",
38+
lgcJSDeploymentUrl: config.lgcJSDeploymentUrl,
3739
},
3840
variants
3941
).forEach((variant) => {
@@ -66,8 +68,8 @@ Object.entries(groupedConfigs).forEach(([projectName, descriptions]) => {
6668
} catch (e) {
6769
// Sometimes the LLM does not fill the draft. We will attempt a retry at filling it.
6870
await sendChatMessage(
69-
page,
70-
"The draft seems to be empty, please fill it in."
71+
page,
72+
"The draft seems to be empty, please fill it in."
7173
);
7274
await waitForStepsAndEnsureStreaming(page);
7375
await waitForResponse(page);

examples/e2e/tests/coagents-qa-native-demo.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ Object.entries(groupedConfigs).forEach(([projectName, descriptions]) => {
3030
appendLGCVariants(
3131
{
3232
...config,
33-
lgcJSDeploymentUrl:
34-
config.lgcJSDeploymentUrl ??
35-
"https://coagents-qa-native-stg-js-036615e530e8593286ccf93d3003ffe2.default.us.langgraph.app",
33+
lgcJSDeploymentUrl: config.lgcJSDeploymentUrl,
3634
},
3735
variants
3836
).forEach((variant) => {

examples/e2e/tests/coagents-qa-text-demo.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ Object.entries(groupedConfigs).forEach(([projectName, descriptions]) => {
2929
appendLGCVariants(
3030
{
3131
...config,
32-
lgcJSDeploymentUrl:
33-
config.lgcJSDeploymentUrl ??
34-
"https://coagents-qa-text-stg-js-4d74616e480750d0a5d10d0c3c5d44a4.default.us.langgraph.app",
32+
lgcJSDeploymentUrl: config.lgcJSDeploymentUrl,
3533
},
3634
variants
3735
).forEach((variant) => {

examples/e2e/tests/coagents-routing-demo.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ Object.entries(groupedConfigs).forEach(([projectName, descriptions]) => {
3131
appendLGCVariants(
3232
{
3333
...config,
34-
lgcJSDeploymentUrl:
35-
config.lgcJSDeploymentUrl ??
36-
"https://coagents-routing-stg-js-4df4be4cab70578ca535df7e1c0b05cf.default.us.langgraph.app",
34+
lgcJSDeploymentUrl: config.lgcJSDeploymentUrl,
3735
},
3836
variants
3937
).forEach((variant) => {

infra/bin/infra.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const coAgentsResearchCanvasUIWithLocalDeps = createUIProjectStack({
2424
dependencies: "Local",
2525
selfHostedAgentProject: coAgentsResearchCanvasAgentWithLocalDeps.selfHostedAgent,
2626
lgcAgentProjectPython: coAgentsResearchCanvasAgentWithLocalDeps.lgcAgentPython,
27-
environmentVariables: {}
27+
environmentVariables: {},
28+
customOutputs: {
29+
"LgcJSDeploymentUrl": `https://coagents-research-canvas-st-08476feebc3a58e5925116da0d3ad635.default.us.langgraph.app`
30+
}
2831
});
2932

3033
/*
@@ -45,7 +48,10 @@ const coAgentsRoutingUIWithLocalDeps = createUIProjectStack({
4548
dependencies: "Local",
4649
selfHostedAgentProject: coAgentsRoutingAgentWithLocalDeps.selfHostedAgent,
4750
lgcAgentProjectPython: coAgentsRoutingAgentWithLocalDeps.lgcAgentPython,
48-
environmentVariables: {}
51+
environmentVariables: {},
52+
customOutputs: {
53+
"LgcJSDeploymentUrl": `https://coagents-routing-stg-js-4df4be4cab70578ca535df7e1c0b05cf.default.us.langgraph.app`
54+
}
4955
});
5056

5157
/*
@@ -66,7 +72,10 @@ const qaTextUIWithLocalDeps = createUIProjectStack({
6672
dependencies: "Local",
6773
selfHostedAgentProject: qaTextAgentWithLocalDeps.selfHostedAgent,
6874
lgcAgentProjectPython: qaTextAgentWithLocalDeps.lgcAgentPython,
69-
environmentVariables: {}
75+
environmentVariables: {},
76+
customOutputs: {
77+
"LgcJSDeploymentUrl": `https://coagents-qa-text-stg-js-4d74616e480750d0a5d10d0c3c5d44a4.default.us.langgraph.app`
78+
}
7079
});
7180

7281
/*
@@ -87,7 +96,10 @@ const qaNativeUIWithLocalDeps = createUIProjectStack({
8796
dependencies: "Local",
8897
selfHostedAgentProject: qaNativeAgentWithLocalDeps.selfHostedAgent,
8998
lgcAgentProjectPython: qaNativeAgentWithLocalDeps.lgcAgentPython,
90-
environmentVariables: {}
99+
environmentVariables: {},
100+
customOutputs: {
101+
"LgcJSDeploymentUrl": `https://coagents-qa-native-stg-js-036615e530e8593286ccf93d3003ffe2.default.us.langgraph.app`
102+
}
91103
});
92104

93105
/**

infra/generate-table.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ function generateTable() {
3636
acc[entry.ProjectName].local = entry.FunctionUrl;
3737
}
3838

39-
// Add LGC Deployment URL if it exists
39+
// Add LGC Python Deployment URL if it exists
4040
if (entry.LgcPythonDeploymentUrl) {
4141
acc[entry.ProjectName].lgcPythonDeploymentUrl = entry.LgcPythonDeploymentUrl;
4242
}
4343

44+
// Add LGC JS Deployment URL if it exists
45+
if (entry.LgcJSDeploymentUrl) {
46+
acc[entry.ProjectName].lgcJSDeploymentUrl = entry.LgcJSDeploymentUrl;
47+
}
48+
4449
return acc;
4550
}, {});
4651

infra/lib/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export function createUIProjectStack({
113113
lgcAgentProjectPython,
114114
environmentVariables,
115115
environmentVariablesFromSecrets,
116+
customOutputs,
116117
}: {
117118
app: App;
118119
project: string;
@@ -122,6 +123,7 @@ export function createUIProjectStack({
122123
lgcAgentProjectPython: PreviewProjectStack;
123124
environmentVariables?: Record<string, string>;
124125
environmentVariablesFromSecrets?: string[];
126+
customOutputs?: Record<string, string>;
125127
}) {
126128
const cdkStackName = toCdkStackName(project) + "UI" + dependencies + "Deps";
127129
const dockerfile =
@@ -136,6 +138,10 @@ export function createUIProjectStack({
136138
LgcPythonDeploymentUrl: `${lgcAgentProjectPython.fnUrl}`
137139
};
138140

141+
if (customOutputs) {
142+
Object.assign(outputs, customOutputs);
143+
}
144+
139145
if (process.env.GITHUB_PR_NUMBER) {
140146
outputs["PRNumber"] = process.env.GITHUB_PR_NUMBER;
141147
}

0 commit comments

Comments
 (0)