Skip to content

Conversation

@vaind
Copy link
Contributor

@vaind vaind commented Sep 23, 2025

Summary

Fixes changelog generation for non-tagged commits and edge cases that were causing updater workflow failures. The previous git clone-based approach failed when trying to generate changelogs between commit SHAs or when references weren't tagged releases.

Key Changes

  • API-based fetching: Replace git clone with GitHub raw API calls for better performance
  • Flexible reference support: Support both tags and commit SHAs as input parameters
  • Diff-based extraction: Use git diff --no-index for accurate changelog differences
  • Better error handling: Proper PowerShell exit code handling for CI compatibility
  • Edge case support: Handle missing changelog files and invalid URLs gracefully

Technical Details

The new implementation:

  1. Fetches changelog files directly from GitHub's raw API
  2. Uses git diff to extract only the changes between references
  3. Handles PowerShell error action preferences for CI compatibility
  4. Maintains backward compatibility with existing formats

Test Results

All 62 tests in the updater test suite pass, including new tests for commit SHA scenarios and edge cases.

🤖 Generated with Claude Code

vaind and others added 10 commits September 22, 2025 21:19
- Switch from git clone to GitHub raw API for better performance
- Support commit SHAs as OldTag/NewTag parameters
- Use diff-based approach for accurate changelog extraction
- Handle repositories without existing changelog files
- Add proper error handling and cleanup
- Improve test coverage for edge cases

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Restructure script to use result variable instead of early returns
- Ensure proper exit handling in try/catch/finally blocks
- Fix CI failures caused by exit code 1 from PowerShell script
- All tests continue to pass (62/62 tests passing)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add entry for PR #115 to Unreleased section
- Addresses Danger bot requirement for changelog updates

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add proper error action preference settings to match CI environment
- Handle git diff exit code 1 (differences found) as expected behavior
- Use explicit exit 0 to ensure clean script termination
- Fixes updater-pr-creation CI failures with PSNativeCommandErrorActionPreference

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vaind vaind marked this pull request as ready for review September 23, 2025 12:54
- Use full markdown link format [#115](url) instead of (#115)
- Matches existing changelog entry format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vaind
Copy link
Contributor Author

vaind commented Sep 23, 2025

@sentry review

vaind and others added 2 commits September 23, 2025 15:06
- Change test range from 1.0.0-2.4.0 (invalid) to 1.60.0-2.32.0 (valid)
- Ensure truncation test actually validates the truncation functionality
- Range 1.60.0 to 2.32.0 generates >60k characters and triggers truncation
- All 11 tests continue to pass

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix diff checking logic: use string conversion for proper emptiness check
- Fix truncation safety: handle case when no newlines exist in content
- Add graceful fallback to direct truncation when LastIndexOf returns -1
- All tests continue to pass (11/11 tests passing)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vaind vaind merged commit 6af5c2d into main Sep 23, 2025
16 checks passed
@vaind
Copy link
Contributor Author

vaind commented Sep 23, 2025

Verified in action here (see PR description history): https://github.com/getsentry/sentry-playstation/pull/59

@vaind vaind deleted the fix/changelog-for-non-tagged-commits branch September 24, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants