Point release notes at the GlitchTip API in place of sentry.io (todo 581)
ci / client (pull_request) Successful in 1m28s
ci / lint (pull_request) Successful in 1m8s
ci / nox (pull_request) Successful in 51s
ci / server (mysql) (pull_request) Successful in 37s
ci / server (sqlite) (pull_request) Successful in 56s
ci / sidecar (pull_request) Successful in 1m20s
ci / image (pull_request) Successful in 3m19s
ci / sourcemaps (pull_request) Skipped
ci / deploy (pull_request) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1
2026-11-14 10:54:53 -05:00
co-authored by Claude Opus 5.5
parent 7228b73599
commit 2af79660cc
+11 -8
View File
@@ -1,14 +1,16 @@
#!/usr/bin/env node
// Draft release notes for the current package run by combining two sources:
// 1. git log since the previous tag (or since N days back if untagged)
// 2. (optional) Sentry issues marked as resolved since that point
// 2. (optional) GlitchTip issues marked as resolved since that point
//
// Writes to scripts/.release-notes-draft.md (gitignored). The package
// script copies the file into the deploy zip's README banner so a fresh
// deploy carries its own change log.
//
// All Sentry calls are gated by SENTRY_AUTH_TOKEN; without it the script
// runs in commits-only mode and produces a valid draft anyway.
// GlitchTip calls go to its Sentry-compatible API at GLITCHTIP_URL
// (default https://bugs.extant2000.com) and are gated by SENTRY_AUTH_TOKEN,
// the same GlitchTip token CI gives sentry-cli. Without it the script runs
// in commits-only mode and produces a valid draft anyway.
import { execSync } from 'child_process';
import { writeFileSync, mkdirSync, readFileSync } from 'fs';
@@ -54,7 +56,7 @@ for (const line of raw) {
else buckets.other.push({ sha, msg: subject });
}
// Optional Sentry — resolved issues since the previous release. Skipped
// Optional GlitchTip: resolved issues since the previous release. Skipped
// silently if no auth token; the file still ships, just commit-only.
async function fetchResolvedIssues() {
const token = process.env.SENTRY_AUTH_TOKEN;
@@ -62,7 +64,8 @@ async function fetchResolvedIssues() {
const project = process.env.SENTRY_PROJECT;
if (!token || !org || !project) return [];
try {
const url = `https://sentry.io/api/0/projects/${org}/${project}/issues/?query=is:resolved&statsPeriod=14d&limit=20`;
const base = (process.env.GLITCHTIP_URL || process.env.SENTRY_URL || 'https://bugs.extant2000.com').replace(/\/+$/, '');
const url = `${base}/api/0/projects/${org}/${project}/issues/?query=is:resolved&statsPeriod=14d&limit=20`;
const r = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
if (!r.ok) return [];
const issues = await r.json();
@@ -72,7 +75,7 @@ async function fetchResolvedIssues() {
const resolved = await fetchResolvedIssues();
// Emit the draft. Commit groups, then resolved Sentry issues, then a
// Emit the draft. Commit groups, then resolved GlitchTip issues, then a
// "checklist for you to edit" footer so the file is obviously a draft.
const lines = [
`# Caelum v${version} (${headSha})`,
@@ -101,11 +104,11 @@ for (const k of Object.keys(SECTION)) {
}
if (resolved.length) {
lines.push('## 🩹 Sentry issues resolved');
lines.push('## GlitchTip issues resolved');
for (const i of resolved) lines.push(`- ${i.shortId || i.id}: ${i.title}`);
lines.push('');
} else if (process.env.SENTRY_AUTH_TOKEN) {
lines.push('_No Sentry issues marked resolved in the last 14 days._');
lines.push('_No GlitchTip issues marked resolved in the last 14 days._');
lines.push('');
}