MCPcopy Index your code
hub / github.com/TrainLoop/evals / create_release_notes

Function create_release_notes

scripts/release.py:375–476  ·  view source on GitHub ↗

Create or validate release notes file.

(
    new_version: str,
    description: str,
    existing_file: Optional[str] = None,
    skip_claude: bool = False,
)

Source from the content-addressed store, hash-verified

373
374
375def create_release_notes(
376 new_version: str,
377 description: str,
378 existing_file: Optional[str] = None,
379 skip_claude: bool = False,
380) -> pathlib.Path:
381 """Create or validate release notes file."""
382 release_file = RELEASES_DIR / f"{new_version}.md"
383
384 if existing_file:
385 existing_path = pathlib.Path(existing_file)
386 if not existing_path.exists():
387 sys.exit(f"❌ Release notes file not found: {existing_file}")
388
389 # Copy existing file to correct location
390 release_file.write_text(existing_path.read_text())
391 print(f"✅ Using existing release notes: {existing_file}")
392 return release_file
393
394 if release_file.exists():
395 print(f"✅ Release notes already exist: {release_file}")
396 return release_file
397
398 print(f"📝 Creating release notes: {release_file}")
399
400 # Ensure releases directory exists
401 RELEASES_DIR.mkdir(exist_ok=True)
402
403 # Try to generate with Claude Code first (unless disabled)
404 claude_content = None
405
406 if not skip_claude:
407 claude_path = check_claude_code_available()
408
409 if claude_path:
410 previous_version = get_previous_version()
411 if previous_version:
412 print(f"📚 Found previous version: {previous_version}")
413
414 claude_content = generate_release_notes_with_claude(
415 new_version, description, previous_version
416 )
417 else:
418 print("⚠️ Claude Code not available, using manual template")
419 else:
420 print("🚫 Claude Code generation disabled, using manual template")
421
422 if claude_content:
423 # Write Claude-generated content
424 release_file.write_text(claude_content)
425 print(f"✅ Generated release notes with Claude Code: {release_file}")
426 print("📝 Opening editor for review and editing...")
427 else:
428 # Fallback to manual template
429 content = f"""Summary: {description}
430
431**Release {new_version}**
432

Callers 1

mainFunction · 0.85

Calls 4

get_previous_versionFunction · 0.85
run_cmdFunction · 0.85

Tested by

no test coverage detected