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 .github/workflows/finalize-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
if: |-
${{ steps.meta.outputs.is_stable == 'true' }}
continue-on-error: true
timeout-minutes: 15
timeout-minutes: 35
env:
GITHUB_TOKEN: '${{ secrets.CI_BOT_PAT }}'
OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
Expand Down
10 changes: 5 additions & 5 deletions scripts/generate-release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function parseModelJson(value) {
export async function generateAiContent(
entries,
complete,
{ batchSize = 12, maxConsecutiveBatchFailures = 3 } = {},
{ batchSize = 8, maxConsecutiveBatchFailures = 3 } = {},
) {
const summaries = new Map();
const warnings = [];
Expand Down Expand Up @@ -324,8 +324,8 @@ export async function generateAiContent(
summaries.set(entry.number, entry.title);
}
if (consecutiveBatchFailures >= maxConsecutiveBatchFailures) {
// The model side is down, not slow: stop paying 60s per remaining
// batch and fall back wholesale instead of pretending otherwise.
// The model side is down, not slow: stop paying per remaining batch
// and fall back wholesale instead of pretending otherwise.
circuitOpen = true;
warnings.push(
`Summary batches stopped after ${consecutiveBatchFailures} consecutive failures; remaining entries use pull-request titles.`,
Expand Down Expand Up @@ -431,10 +431,10 @@ export function createOpenAiCompleter({
baseUrl,
model,
fetchImpl = fetch,
timeoutMs = 60_000,
timeoutMs = 180_000,
maxRetries = 2,
baseDelayMs = 2_000,
totalTimeoutMs = 12 * 60_000,
totalTimeoutMs = 30 * 60_000,
}) {
const endpoint = `${baseUrl.replace(/\/$/, '')}/chat/completions`;
const deadline = Date.now() + totalTimeoutMs;
Expand Down
19 changes: 18 additions & 1 deletion scripts/tests/ai-release-notes-workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const finalizeWorkflow = readFileSync(
'.github/workflows/finalize-release.yml',
'utf8',
);
const releaseNotesScript = readFileSync(
'scripts/generate-release-notes.js',
'utf8',
);

function getStep(workflow, name) {
const match = new RegExp(
Expand Down Expand Up @@ -66,8 +70,21 @@ describe('stable release notes workflow', () => {
);
expect(validate).toContain('is not a stable release tag');
expect(validate).toContain('exit 1');
expect(generate).toContain('timeout-minutes: 15');
expect(generate).toContain('timeout-minutes: 35');
expect(generate).toContain('continue-on-error: true');

// The step timeout must exceed the script's internal budget; otherwise
// the runner SIGKILLs the step and even the fallback notes are lost.
const stepTimeoutMin = Number(
generate.match(/timeout-minutes:\s*(\d+)/)[1],
);
const budgetMs = releaseNotesScript
.match(/totalTimeoutMs\s*=\s*([\d_]+)\s*\*\s*([\d_]+)/)
.slice(1)
.map((part) => Number(part.replace(/_/g, '')))
.reduce((a, b) => a * b, 1);
expect(stepTimeoutMin * 60_000).toBeGreaterThan(budgetMs);

expect(generate).toContain('GitHub-generated notes');
expect(generate).toContain('node scripts/generate-release-notes.js');
expect(update).toContain('continue-on-error: true');
Expand Down
Loading