Skip to content

Fixup eachdist.py handling of package names - #5417

Merged
xrmx merged 6 commits into
open-telemetry:mainfrom
xrmx:fixup-eachdist-proto
Jul 16, 2026
Merged

Fixup eachdist.py handling of package names#5417
xrmx merged 6 commits into
open-telemetry:mainfrom
xrmx:fixup-eachdist-proto

Conversation

@xrmx

@xrmx xrmx commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

We have an annoying bug in eachdist.py that we get at release time when it bumps wrongly some packages because their name is a subset for another. It looks like this was two different issues and not just one: a not strict enough regexp and not strict enough check of the package name when looping over them.

Fixes #5227
Closes #5237

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

xrmx added 2 commits July 15, 2026 16:53
While at it also introduce tests
Checking for substrings is not precise enough, let's check for the
metadata we have in pyproject.toml.
@xrmx
xrmx requested a review from a team as a code owner July 15, 2026 15:12
@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jul 15, 2026
@xrmx xrmx changed the title Fixup eachdist proto Fixup eachdist.py handling of package names Jul 15, 2026
@pmcollins
pmcollins requested a review from Copilot July 15, 2026 17:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes release-time version bump issues in scripts/eachdist.py where a package name that is a prefix of another package name could be matched and updated incorrectly. This improves correctness of release tooling and adds CI coverage for the regression.

Changes:

  • Tightened package filtering for version-file updates by matching project.name instead of substring matching on paths.
  • Tightened dependency-update regexes to avoid prefix collisions (and added support for optional extras like pkg[extra]).
  • Added a dedicated test-scripts tox env + GitHub Actions job, along with unit tests for eachdist.py.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/eachdist.py Fixes overly-broad package/regex matching that could bump the wrong package when names overlap by prefix.
scripts/tests/test_eachdist.py Adds regression tests covering the prefix-matching scenarios for deps and version-file updates.
scripts/tests/test-requirements.txt Adds dependencies needed to run the new script tests under tox.
tox.ini Introduces test-scripts tox environment wired to run scripts/tests.
.github/workflows/misc.yml Runs the new test-scripts tox environment in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.