Skip to content

Commit 1d6445c

Browse files
committed
verified chromatic works, try to fix tsdiff
1 parent dcb40bb commit 1d6445c

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/weekly-api-diff.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ jobs:
193193
else:
194194
# Read the already-processed delta saved by the shell step
195195
delta_path = f"{workspace}/snapshots/deltas/{today}.txt"
196-
model_input = open(delta_path).read() if os.path.exists(delta_path) else ""
196+
model_input_full = open(delta_path).read() if os.path.exists(delta_path) else ""
197+
TRUNCATE_LIMIT = 8000
198+
truncated = len(model_input_full) > TRUNCATE_LIMIT
199+
model_input = model_input_full[:TRUNCATE_LIMIT] if truncated else model_input_full
197200
198201
# Extract classification rules from prompt.md (single source of truth)
199202
prompt_md = open(f"{workspace}/scripts/weekly-api-diff/prompt.md").read()
@@ -228,7 +231,8 @@ jobs:
228231
}
229232
)
230233
summary = json.loads(urllib.request.urlopen(req).read())['choices'][0]['message']['content']
231-
body = f"{summary}\n\nWhat's new this week: {delta_url}\nFull diff vs release: {diff_url}\n\nReact ✅ if changes look expected, or 🚨 if something looks wrong."
234+
truncation_note = "\n\n⚠️ Delta was large — summary may be incomplete. Check the full delta link below." if truncated else ""
235+
body = f"{summary}{truncation_note}\n\nWhat's new this week: {delta_url}\nFull diff vs release: {diff_url}\n\nReact ✅ if changes look expected, or 🚨 if something looks wrong."
232236
233237
ts = post(f"📊 Weekly API Diff — {today}")
234238
post(f"📊 Weekly API Diff — {today}\n\n{body}", thread_ts=ts)

.github/workflows/weekly-chromatic.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666
env:
6767
SLACK_TSDIFF_CHROMATIC_BOT_TOKEN: ${{ secrets.SLACK_TSDIFF_CHROMATIC_BOT_TOKEN }}
6868
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
69-
TEST_SLACK_ID: ${{ secrets.TEST_SLACK_ID }}
7069
CHROMATIC_URL: ${{ needs.chromatic.outputs.build_url }}
7170
CHROMATIC_CODE: ${{ needs.chromatic.outputs.code }}
7271
CHROMATIC_FC_URL: ${{ needs.chromatic-fc.outputs.build_url }}
@@ -84,7 +83,7 @@ jobs:
8483
raise SystemExit(f"Missing required environment variables: {', '.join(missing)}")
8584
8685
today = date.today().isoformat()
87-
channel = os.environ.get('TEST_SLACK_ID') or os.environ['SLACK_CHANNEL_ID']
86+
channel = os.environ['SLACK_CHANNEL_ID']
8887
slack_token = os.environ['SLACK_TSDIFF_CHROMATIC_BOT_TOKEN']
8988
9089
def fmt(code, url):

0 commit comments

Comments
 (0)