Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Make release note generation more resilient by gracefully handling invalid changelog fragments #8780

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Oct 31, 2024

Description

Currently, the release note generation script (scripts/generate_release_note) fails entirely if any single changelog fragment has invalid formatting or YAML syntax errors. This causes the entire process to abort, preventing the generation of release notes even when most fragments are valid.

For example, if a fragment has incorrect YAML indentation:

feat:
- "[navigation] Adjust the appearances..." # incorrect indentation
Screenshot 2024-10-31 at 4 00 30 PM

This PR modifies the release note generation script to:

  • continue processing when encountering invalid fragments instead of aborting
  • add error handling around file reading, fragment validation, and YAML parsing
  • report failed fragments with detailed error messages

The changes make the script more resilient while maintaining strict validation rules. Invalid fragments are skipped and reported, allowing the process to continue with valid entries.

Screenshot 2024-10-31 at 4 00 40 PM

Issues Resolved

NA

Screenshot

above

Testing the changes

Changelog

  • skip

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

…ing invalid changelog fragments

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.75%. Comparing base (3381dcd) to head (17e761e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8780   +/-   ##
=======================================
  Coverage   60.75%   60.75%           
=======================================
  Files        3798     3798           
  Lines       90690    90690           
  Branches    14277    14277           
=======================================
  Hits        55101    55101           
  Misses      32090    32090           
  Partials     3499     3499           
Flag Coverage Δ
Linux_1 29.05% <ø> (ø)
Linux_2 56.39% <ø> (ø)
Linux_3 37.61% <ø> (ø)
Linux_4 29.82% <ø> (ø)
Windows_1 29.07% <ø> (ø)
Windows_2 56.34% <ø> (ø)
Windows_3 37.61% <ø> (ø)
Windows_4 29.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Love the new error handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distinguished-contributor Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants