Skip to content

Conversation

cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Aug 18, 2025

Problem

The changelog check was failing to properly detect when package.json changes were only in devDependencies because the git diff logic required both the start and end of the devDependencies section to be visible. In many cases, especially with limited diff context (-U20), the closing brace of the devDependencies section might not be included in the diff output.

Solution

  • Fixed section detection logic: Now only requires devDependencies section start to be found
  • Graceful handling of truncated diffs: When the section end is not visible, assume any line after the start is within devDependencies

Testing

This fix ensures that packages with only devDependency changes are properly skipped during changelog checks, preventing false positives that would require unnecessary changelog updates.

This should resolve the CI failure that occurred in this PR: MetaMask/core#6331

Impact

  • ✅ Fixes false positive changelog requirements for dev-only changes

Note

Relax devDependencies detection in package.json diffs to work when the closing brace isn’t present, treating all lines after the start as within the section.

  • Changelog check (src/changelog-check.ts):
    • getDevDependencyLines:
      • Only requires the start of devDependencies; no longer depends on detecting the end.
      • If the end isn’t found, treats all lines after the start as inside devDependencies.
      • Minor comment updates for clarity.

Written by Cursor Bugbot for commit 819cf6d. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@cryptodev-2s cryptodev-2s requested a review from mcmire August 18, 2025 19:20
@cryptodev-2s cryptodev-2s self-assigned this Aug 18, 2025
@cryptodev-2s cryptodev-2s mentioned this pull request Aug 18, 2025
4 tasks
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Makes sense!

@cryptodev-2s cryptodev-2s force-pushed the fix/changelog-check-dev-dependencies-section-detection branch from 01eb96f to 819cf6d Compare October 2, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants