Skip to content

Conversation

@lawrence-u10d
Copy link
Contributor

@lawrence-u10d lawrence-u10d commented Dec 24, 2025

Summary

  • Adds renovate.json5 extending shared Unstructured config
  • Enables security-only dependency updates (Python, Docker, GitHub Actions)
  • Includes automatic version bumping and CHANGELOG updates on security fixes

Test plan

  • Verify Renovate picks up config and creates dependency dashboard
  • Test version bump script locally with mock changes

🤖 Generated with Claude Code


Note

Sets up Renovate to manage security-only Python dependency updates and automates versioning/changelog maintenance.

  • Introduces renovate.json5 extending org preset; for PyPI vulnerability alerts runs scripts/renovate-security-bump.sh (branch execution) with file filters for unstructured_inference/__version__.py and CHANGELOG.md
  • Adds scripts/renovate-security-bump.sh that detects versioning style (__version__.py or pyproject.toml), computes release version (strip -dev or bump patch), updates the version file, infers changed packages from diffs (requirements, uv.lock, pyproject.toml), and inserts a security-focused entry in CHANGELOG.md respecting existing format

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

- Extends shared Unstructured renovate config for security-only dependency updates
- Includes version bumping script for automatic version and CHANGELOG updates

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Syncs script with latest version from renovate-config that includes:
- shfmt formatting (2-space indents)
- pyproject.toml versioning support

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- PEP 508 compliant package name regex (supports dots)
- Detection for requirements/*.in files
- Detection for pyproject.toml dependencies
- Better logging of detected packages

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
lawrence-u10d and others added 3 commits December 24, 2025 15:44
lawrence-u10d and others added 2 commits December 24, 2025 16:39
- Use portable sed for pyproject version extraction (avoid \x27)
- Discard trailing content in pyproject version extraction
- Include detected packages in changelog entries
- Prevent substring match of CHANGELOG dev version header

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Script now detects CHANGELOG format (brackets, subsections) and adapts
output accordingly.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
fi

cat "$tmp_file" "$CHANGELOG_FILE" >"$CHANGELOG_FILE.tmp"
mv "$CHANGELOG_FILE.tmp" "$CHANGELOG_FILE"
Copy link

Choose a reason for hiding this comment

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

New CHANGELOG entry prepended before main file header

The create_new_changelog_entry function prepends the new version entry to the beginning of the file by concatenating tmp_file before CHANGELOG_FILE. For CHANGELOGs that have a main header like # Changelog or introductory text at the top, this inserts the new version section BEFORE the header, corrupting the file structure. Since the script is explicitly described as a "Shared script for Renovate" (line 5) intended for reuse, this breaks when used with repos that follow the common pattern of having a title header before version entries.

Fix in Cursor Fix in Web

fi

cat "$tmp_file" "$CHANGELOG_FILE" >"$CHANGELOG_FILE.tmp"
mv "$CHANGELOG_FILE.tmp" "$CHANGELOG_FILE"
Copy link

Choose a reason for hiding this comment

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

Prepending breaks CHANGELOGs with title headers

The create_new_changelog_entry() function uses cat to prepend the new version entry directly to the beginning of the CHANGELOG file. If the CHANGELOG follows Keep a Changelog format with a title header like # Changelog and description at the top, the new version entry would be inserted before this title, corrupting the document structure. The new entry should be inserted after any title/description but before the first version entry.

Fix in Cursor Fix in Web

if [ "$CHANGELOG_USE_BRACKETS" = true ]; then
DEV_VERSION_HEADER=$(grep -m 1 -E "^## \[${ESCAPED_VERSION}\]" "$CHANGELOG_FILE" || true)
else
DEV_VERSION_HEADER=$(grep -m 1 -E "^## ${ESCAPED_VERSION}(\s*$)" "$CHANGELOG_FILE" || true)
Copy link

Choose a reason for hiding this comment

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

Non-bracketed version headers with dates won't match

The grep pattern for non-bracketed CHANGELOG format uses (\s*$) which requires the version to be at end of line. This fails to match common CHANGELOG headers that include dates like ## 1.2.0-dev1 - 2024-01-01. The bracketed format on line 251 doesn't have this restriction. When the dev header can't be matched, the script falls back to creating a new entry instead of renaming the existing one, potentially creating duplicate version entries in the CHANGELOG.

Fix in Cursor Fix in Web

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