Skip to content

Commit 563cdb4

Browse files
CI: Tweak output and add telco to workflow (#186)
* CI: Tweak output and add telco to workflow * Add telco README
1 parent 3176325 commit 563cdb4

File tree

2 files changed

+70
-57
lines changed

2 files changed

+70
-57
lines changed

.github/workflows/create-build.yml

Lines changed: 67 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,21 @@ jobs:
106106
"op://Product ACT/axiom_supplychain/ECOMMERCE_ECOMMERCE_MONGODB_MONGODB_DATABASE_URI"
107107
SUPPLYCHAIN_SCMS_POSTGRES_JDBC_URL: "op://Product ACT/axiom_supplychain/SCMS_SCMS_POSTGRES_JDBC_URL"
108108
SUPPLYCHAIN_SCMS_POSTGRES_JDBC_SCHEMAS: "op://Product ACT/axiom_supplychain/SCMS_SCMS_POSTGRES_JDBC_SCHEMAS"
109+
# Telco secrets
110+
TELCO_HASURA_DDN_PAT: "op://Product ACT/axiom_telco/ddn-service-account"
111+
TELCO_JWT_SECRET: "op://Product ACT/axiom_telco/JWT_SECRET"
112+
TELCO_AUTH_AUTH_JDBC_URL: "op://Product ACT/axiom_telco/AUTH_AUTH_JDBC_URL"
113+
TELCO_AUTH_SEARCH_BRAVE_API_KEY: "op://Product ACT/axiom_telco/AUTH_SEARCH_BRAVE_API_KEY"
114+
TELCO_AUTH_SEARCH_GEMINI_API_KEY: "op://Product ACT/axiom_telco/AUTH_SEARCH_GEMINI_API_KEY"
115+
TELCO_AUTH_SEARCH_PERPLEXITY_API_KEY: "op://Product ACT/axiom_telco/AUTH_SEARCH_PERPLEXITY_API_KEY"
116+
TELCO_CUSTOMER_AURORA_JDBC_URL: "op://Product ACT/axiom_telco/CUSTOMER_AURORA_JDBC_URL"
117+
TELCO_CUSTOMER_MONGO_MONGODB_DATABASE_URI: "op://Product ACT/axiom_telco/CUSTOMER_MONGO_MONGODB_DATABASE_URI"
118+
TELCO_NETWORK_CLICKHOUSE_JDBC_URL: "op://Product ACT/axiom_telco/NETWORK_CLICKHOUSE_JDBC_URL"
119+
TELCO_NETWORK_KAFKA_SINK_JDBC_URL: "op://Product ACT/axiom_telco/NETWORK_KAFKA_SINK_JDBC_URL"
120+
TELCO_SUPPORT_ATLAS_MONGODB_DATABASE_URI: "op://Product ACT/axiom_telco/SUPPORT_ATLAS_MONGODB_DATABASE_URI"
121+
TELCO_SUPPORT_VECTOR_JDBC_URL: "op://Product ACT/axiom_telco/SUPPORT_VECTOR_JDBC_URL"
122+
TELCO_SUPPORT_VECTOR_SEARCH_SERVICE_OPENAI_API_KEY:
123+
"op://Product ACT/axiom_telco/SUPPORT_VECTOR_SEARCH_SERVICE_OPENAI_API_KEY"
109124

110125
- name: Build all changed demos
111126
id: build
@@ -156,6 +171,21 @@ jobs:
156171
export SCMS_SCMS_POSTGRES_JDBC_URL="$SUPPLYCHAIN_SCMS_POSTGRES_JDBC_URL"
157172
export SCMS_SCMS_POSTGRES_JDBC_SCHEMAS="$SUPPLYCHAIN_SCMS_POSTGRES_JDBC_SCHEMAS"
158173
;;
174+
telco)
175+
export HASURA_DDN_PAT="$TELCO_HASURA_DDN_PAT"
176+
export JWT_SECRET="$TELCO_JWT_SECRET"
177+
export AUTH_AUTH_JDBC_URL="$TELCO_AUTH_AUTH_JDBC_URL"
178+
export AUTH_SEARCH_BRAVE_API_KEY="$TELCO_AUTH_SEARCH_BRAVE_API_KEY"
179+
export AUTH_SEARCH_GEMINI_API_KEY="$TELCO_AUTH_SEARCH_GEMINI_API_KEY"
180+
export AUTH_SEARCH_PERPLEXITY_API_KEY="$TELCO_AUTH_SEARCH_PERPLEXITY_API_KEY"
181+
export CUSTOMER_AURORA_JDBC_URL="$TELCO_CUSTOMER_AURORA_JDBC_URL"
182+
export CUSTOMER_MONGO_MONGODB_DATABASE_URI="$TELCO_CUSTOMER_MONGO_MONGODB_DATABASE_URI"
183+
export NETWORK_CLICKHOUSE_JDBC_URL="$TELCO_NETWORK_CLICKHOUSE_JDBC_URL"
184+
export NETWORK_KAFKA_SINK_JDBC_URL="$TELCO_NETWORK_KAFKA_SINK_JDBC_URL"
185+
export SUPPORT_ATLAS_MONGODB_DATABASE_URI="$TELCO_SUPPORT_ATLAS_MONGODB_DATABASE_URI"
186+
export SUPPORT_VECTOR_JDBC_URL="$TELCO_SUPPORT_VECTOR_JDBC_URL"
187+
export SUPPORT_VECTOR_SEARCH_SERVICE_OPENAI_API_KEY="$TELCO_SUPPORT_VECTOR_SEARCH_SERVICE_OPENAI_API_KEY"
188+
;;
159189
*)
160190
echo "Unknown demo: $demo - skipping"
161191
continue
@@ -210,6 +240,22 @@ jobs:
210240
ECOMMERCE_ECOMMERCE_MONGODB_MONGODB_DATABASE_URI=$ECOMMERCE_ECOMMERCE_MONGODB_MONGODB_DATABASE_URI
211241
SCMS_SCMS_POSTGRES_JDBC_URL=$SCMS_SCMS_POSTGRES_JDBC_URL
212242
SCMS_SCMS_POSTGRES_JDBC_SCHEMAS=$SCMS_SCMS_POSTGRES_JDBC_SCHEMAS
243+
EOF
244+
;;
245+
telco)
246+
cat > .env.cloud << EOF
247+
JWT_SECRET=$JWT_SECRET
248+
AUTH_AUTH_JDBC_URL=$AUTH_AUTH_JDBC_URL
249+
AUTH_SEARCH_BRAVE_API_KEY=$AUTH_SEARCH_BRAVE_API_KEY
250+
AUTH_SEARCH_GEMINI_API_KEY=$AUTH_SEARCH_GEMINI_API_KEY
251+
AUTH_SEARCH_PERPLEXITY_API_KEY=$AUTH_SEARCH_PERPLEXITY_API_KEY
252+
CUSTOMER_AURORA_JDBC_URL=$CUSTOMER_AURORA_JDBC_URL
253+
CUSTOMER_MONGO_MONGODB_DATABASE_URI=$CUSTOMER_MONGO_MONGODB_DATABASE_URI
254+
NETWORK_CLICKHOUSE_JDBC_URL=$NETWORK_CLICKHOUSE_JDBC_URL
255+
NETWORK_KAFKA_SINK_JDBC_URL=$NETWORK_KAFKA_SINK_JDBC_URL
256+
SUPPORT_ATLAS_MONGODB_DATABASE_URI=$SUPPORT_ATLAS_MONGODB_DATABASE_URI
257+
SUPPORT_VECTOR_JDBC_URL=$SUPPORT_VECTOR_JDBC_URL
258+
SUPPORT_VECTOR_SEARCH_SERVICE_OPENAI_API_KEY=$SUPPORT_VECTOR_SEARCH_SERVICE_OPENAI_API_KEY
213259
EOF
214260
;;
215261
esac
@@ -234,8 +280,9 @@ jobs:
234280
with:
235281
script: |
236282
const builds = JSON.parse(`${{ steps.build.outputs.builds_output }}`);
283+
const commitSha = context.payload.pull_request.head.sha.substring(0, 7);
237284
238-
let comment = `## 🚀 PromptQL Builds Complete\n\n`;
285+
let comment = `## 🚀 PromptQL Builds Complete (${commitSha})\n\n`;
239286
240287
builds.forEach(build => {
241288
comment += `### ${build.demo.toUpperCase()} Demo\n`;
@@ -248,32 +295,14 @@ jobs:
248295
comment += `\n`;
249296
});
250297
251-
const comments = await github.rest.issues.listComments({
298+
// Always create a new comment
299+
await github.rest.issues.createComment({
252300
issue_number: context.issue.number,
253301
owner: context.repo.owner,
254302
repo: context.repo.repo,
303+
body: comment
255304
});
256305
257-
const existingComment = comments.data.find(comment =>
258-
comment.body.includes('🚀 PromptQL Builds Complete')
259-
);
260-
261-
if (existingComment) {
262-
await github.rest.issues.updateComment({
263-
comment_id: existingComment.id,
264-
owner: context.repo.owner,
265-
repo: context.repo.repo,
266-
body: comment
267-
});
268-
} else {
269-
await github.rest.issues.createComment({
270-
issue_number: context.issue.number,
271-
owner: context.repo.owner,
272-
repo: context.repo.repo,
273-
body: comment
274-
});
275-
}
276-
277306
- name: Notify Slack
278307
if: always()
279308
uses: actions/github-script@v7
@@ -283,13 +312,10 @@ jobs:
283312
with:
284313
script: |
285314
const builds = JSON.parse(`${{ steps.build.outputs.builds_output }}`);
286-
287-
console.log('Environment check:');
288-
console.log('SLACK_BOT_TOKEN exists:', !!process.env.SLACK_BOT_TOKEN);
289-
console.log('SLACK_CHANNEL_ID:', process.env.SLACK_CHANNEL_ID);
315+
const commitSha = context.payload.pull_request.head.sha.substring(0, 7);
290316
291317
// Create message for each build
292-
let slackMessage = `🚀 *PromptQL Builds Complete*\n\n`;
318+
let slackMessage = `🚀 *PromptQL Builds Complete* (${commitSha})\n\n`;
293319
294320
builds.forEach(build => {
295321
slackMessage += `*${build.demo.toUpperCase()} Demo*\n`;
@@ -302,7 +328,7 @@ jobs:
302328
slackMessage += `\n`;
303329
});
304330
305-
// Check if thread exists in PR metadata
331+
// Find existing PR thread
306332
const comments = await github.rest.issues.listComments({
307333
issue_number: context.issue.number,
308334
owner: context.repo.owner,
@@ -317,11 +343,10 @@ jobs:
317343
if (threadComment) {
318344
const match = threadComment.body.match(/<!-- slack-thread-ts:([^-]+) -->/);
319345
threadTs = match ? match[1] : null;
320-
console.log('Found existing thread:', threadTs);
321346
}
322347
348+
// Create PR thread if it doesn't exist
323349
if (!threadTs) {
324-
console.log('Creating new Slack thread...');
325350
const prAuthor = context.payload.pull_request.user.login;
326351
const prTitle = context.payload.pull_request.title;
327352
const prNumber = context.payload.pull_request.number;
@@ -341,28 +366,22 @@ jobs:
341366
});
342367
343368
const slackData = await response.json();
344-
console.log('Slack thread response:', JSON.stringify(slackData, null, 2));
345-
346-
if (!slackData.ok) {
347-
console.error('Failed to create Slack thread:', slackData.error);
348-
return;
369+
if (slackData.ok) {
370+
threadTs = slackData.ts;
371+
372+
// Store thread timestamp
373+
await github.rest.issues.createComment({
374+
issue_number: context.issue.number,
375+
owner: context.repo.owner,
376+
repo: context.repo.repo,
377+
body: `<!-- slack-thread-ts:${threadTs} -->`
378+
});
349379
}
350-
351-
threadTs = slackData.ts;
352-
353-
// Store thread timestamp in PR comment
354-
await github.rest.issues.createComment({
355-
issue_number: context.issue.number,
356-
owner: context.repo.owner,
357-
repo: context.repo.repo,
358-
body: `<!-- slack-thread-ts:${threadTs} -->`
359-
});
360380
}
361381
362-
// Only post to thread if we have a valid threadTs
382+
// Post build info as reply in thread
363383
if (threadTs) {
364-
console.log('Posting build info to thread:', threadTs);
365-
const buildResponse = await fetch('https://slack.com/api/chat.postMessage', {
384+
await fetch('https://slack.com/api/chat.postMessage', {
366385
method: 'POST',
367386
headers: {
368387
'Authorization': `Bearer ${process.env.SLACK_BOT_TOKEN}`,
@@ -374,13 +393,4 @@ jobs:
374393
text: slackMessage,
375394
}),
376395
});
377-
378-
const buildData = await buildResponse.json();
379-
console.log('Slack build response:', JSON.stringify(buildData, null, 2));
380-
381-
if (!buildData.ok) {
382-
console.error('Failed to post build info:', buildData.error);
383-
}
384-
} else {
385-
console.error('No valid thread timestamp available');
386396
}

demos/telco/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TELCO Demo
2+
3+
Adding here as a test to trigger CI.

0 commit comments

Comments
 (0)