dependabot / dependabot/dependabot-core

[Ruby] poetry_file_updater.rb throws "Content did not change" error for TOML file

Open
#8,931 10 comments 2 reactions 0 assignees View on GitHub
L: python:pip T: bug 🐞
Dominant language
Ruby
Stars
5.8k
Forks
1.5k
Avg merge
2d 18h
Merged PRs (30d)
149

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Package ecosystem

pip

### Package manager version

poetry-core >= 1.8.0

### Language version

python = ">=3.8.1, <4.0.0"

### Manifest location and content before the Dependabot update

[tool.poetry]
name = "myPackage"
version = "0.5.6-dev"

[tool.poetry.dependencies]
python = ">=3.8.1, <4.0.0"
importlib_resources = {version = ">=6.0.0", python = ">=3.9"}
gymnasium = ">=0.26.3"
deprecated = "^1.2.13"
pandas = ">=1.3.0"
numpy = ">=1.18.0"
salabim = ">23.2.0"
Pillow = "^10.0.1"
kaleido = "0.2.1"
plotly = ">=5.8.0"
openpyxl = "^3.0.10"
PuLP = ">=2.6.0"
networkx = [
{version = "^3.2.1", python = ">=3.9"},
{version = "3.1", python = "<3.9"}
]
matplotlib = [
{version = "^3.8.2", python = ">=3.9"},
{version = "3.7.4", python = "<3.9"}
]
ordered-set = "^4.1.0"
sortedcontainers = "^2.4.0"

[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
poetry = ">=1.4.2,<1.8.0"
pre-commit = "^3.5.0"
black = ">= 24.1.0"
reorder-python-imports = "^3.12.0"
flynt = ">= 0.71"
pydocstyle = "^6.3.0"
flake8 = "^6.1.0"
flake8-typing-imports = "^1.15.0"
flake8-black = "^0.3.6"
flake8-docstrings = "^1.7.0"
flake8-implicit-str-concat = "^0.4.0"
flake8-unused-arguments = "^0.0.13"

[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
pytest = "^8.0.0"
pytest-cov = "^4.1.0"

[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
Sphinx = ">=7.1.2"
sphinx-rtd-theme = "^2.0.0"
sphinx-autodoc-typehints = "^1.24.0"
sphinxcontrib-bibtex = "^2.5.0"
myst_parser = "^2.0.0"

[tool.semantic_release]
version_variable = "pyproject.toml:version" # version location
branch = "main" # branch to make releases of
changelog_file = "CHANGELOG.md" # changelog file
build_command = "poetry build" # build dists
dist_path = "dist/" # where to put dists
upload_to_release = false # auto-create GitHub release
upload_to_pypi = false # don't auto-upload to PyPI
remove_dist = false # don't remove dists
patch_without_tag = false # patch release by default

[build-system]
requires = ["poetry-core>=1.8.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

### dependabot.yml content

version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
allow:
- dependency-type: "direct"
commit-message:
prefix: "[CI] "
open-pull-requests-limit: 10
reviewers:
- "PhilippWillms"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
commit-message:
prefix: "[CI] "
open-pull-requests-limit: 10
reviewers:
- "PhilippWillms"

### Updated dependency

pytest from ^7.2.0 to ^8.0.0
black from ^23.1.0 to ^24.1.1
flake8 from ^6.1.10to 7.0.0

### What you expected to see, versus what you actually saw

The Sentry envelope sent back to GH Dependabot led into RunTime Error for the dependencies mentioned. It worked before fall 2023.

### Native package manager behavior

_No response_

### Images of the diff or a link to the PR, issue, or logs

_No response_

### Smallest manifest that reproduces the issue

updater | 2024/01/29 13:58:22 INFO Checking if black needs updating
proxy | 2024/01/29 13:58:23 [936] GET https://pypi.org:443/simple/black/
proxy | 2024/01/29 13:58:23 [936] 200 https://pypi.org:443/simple/black/
updater | 2024/01/29 13:58:23 INFO Latest version is 24.1.1
proxy | 2024/01/29 13:58:23 [938] GET https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:58:23 [938] 301 https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:58:23 [940] GET https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:58:23 [940] 404 https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:58:26 [942] GET https://pypi.org:443/pypi/black/24.1.1/json
proxy | 2024/01/29 13:58:26 [942] 200 https://pypi.org:443/pypi/black/24.1.1/json
proxy | 2024/01/29 13:58:26 [944] GET https://pypi.org:443/pypi/platformdirs/4.1.0/json
proxy | 2024/01/29 13:58:26 [944] 200 https://pypi.org:443/pypi/platformdirs/4.1.0/json
proxy | 2024/01/29 13:58:29 [946] GET https://pypi.org:443/pypi/poetry/1.7.0/json
proxy | 2024/01/29 13:58:29 [946] 200 https://pypi.org:443/pypi/poetry/1.7.0/json
proxy | 2024/01/29 13:58:29 [948] GET https://pypi.org:443/pypi/poetry/1.6.1/json
proxy | 2024/01/29 13:58:29 [948] 200 https://pypi.org:443/pypi/poetry/1.6.1/json
proxy | 2024/01/29 13:58:29 [950] GET https://pypi.org:443/pypi/poetry/1.6.0/json
proxy | 2024/01/29 13:58:29 [950] 200 https://pypi.org:443/pypi/poetry/1.6.0/json
proxy | 2024/01/29 13:58:29 [952] GET https://pypi.org:443/pypi/poetry/1.5.1/json
proxy | 2024/01/29 13:58:29 [952] 200 https://pypi.org:443/pypi/poetry/1.5.1/json
proxy | 2024/01/29 13:58:30 [954] GET https://pypi.org:443/pypi/poetry/1.5.0/json
proxy | 2024/01/29 13:58:30 [954] 200 https://pypi.org:443/pypi/poetry/1.5.0/json
proxy | 2024/01/29 13:58:30 [956] GET https://pypi.org:443/pypi/poetry/1.4.2/json
proxy | 2024/01/29 13:58:30 [956] 200 https://pypi.org:443/pypi/poetry/1.4.2/json
proxy | 2024/01/29 13:58:31 [958] GET https://pypi.org:443/pypi/urllib3/1.26.18/json
proxy | 2024/01/29 13:58:31 [958] 200 https://pypi.org:443/pypi/urllib3/1.26.18/json
proxy | 2024/01/29 13:59:02 [960] GET https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:02 [960] 301 https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:02 [962] GET https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:02 [962] 404 https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:02 [964] GET https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:02 [964] 301 https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:02 [966] GET https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:02 [966] 404 https://pypi.org:443/pypi/mypackage/json
updater | 2024/01/29 13:59:02 INFO Requirements to unlock own
proxy | 2024/01/29 13:59:02 [968] GET https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:02 [968] 301 https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:02 [970] GET https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:02 [970] 404 https://pypi.org:443/pypi/mypackage/json
updater | 2024/01/29 13:59:02 INFO Requirements update strategy bump_versions
proxy | 2024/01/29 13:59:03 [972] GET https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:03 [972] 301 https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:03 [974] GET https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:03 [974] 404 https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:03 [976] GET https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:03 [976] 301 https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:03 [978] GET https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:03 [978] 404 https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:03 [980] GET https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:03 [980] 301 https://pypi.org:443/pypi/mypackage/json/
proxy | 2024/01/29 13:59:03 [982] GET https://pypi.org:443/pypi/mypackage/json
proxy | 2024/01/29 13:59:03 [982] 404 https://pypi.org:443/pypi/mypackage/json
updater | 2024/01/29 13:59:03 INFO Updating black from to 24.1.1
updater | 2024/01/29 13:59:03 INFO [Transport] Sending envelope with items [event] a54b4e754c0c474380da10d3b52aac53 to Sentry
proxy | 2024/01/29 13:59:03 [985] POST https://sentry.io:443/api/1451818/envelope/
proxy | 2024/01/29 13:59:03 [985] 200 https://sentry.io:443/api/1451818/envelope/
updater | 2024/01/29 13:59:03 ERROR Error processing black (RuntimeError)
updater | 2024/01/29 13:59:03 ERROR Content did not change!
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/python/lib/dependabot/python/file_updater/poetry_file_updater.rb:74:in `updated_pyproject_content'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/python/lib/dependabot/python/file_updater/poetry_file_updater.rb:48:in `fetch_updated_dependency_files'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/python/lib/dependabot/python/file_updater/poetry_file_updater.rb:31:in `updated_dependency_files'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/python/lib/dependabot/python/file_updater.rb:101:in `updated_poetry_based_files'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/python/lib/dependabot/python/file_updater.rb:34:in `updated_dependency_files'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/dependency_change_builder.rb:91:in `generate_dependency_files'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/dependency_change_builder.rb:37:in `run'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/dependency_change_builder.rb:26:in `create_from'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/updater/operations/update_all_versions.rb:128:in `check_and_create_pull_request'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/updater/operations/update_all_versions.rb:60:in `check_and_create_pr_with_error_handling'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/updater/operations/update_all_versions.rb:35:in `block in perform'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/updater/operations/update_all_versions.rb:35:in `each'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/updater/operations/update_all_versions.rb:35:in `perform'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:45:in `run'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/update_files_command.rb:43:in `perform_job'
updater | 2024/01/29 13:59:03 ERROR /home/dependabot/dependabot-updater/lib/dependabot/base_command.rb:36:in `run'
updater | 2024/01/29 13:59:03 ERROR bin/update_files.rb:24:in `'

Contributor guide

Open the contributing guide

Research direction

Start in python/lib/dependabot/python/file_updater/poetry_file_updater.rb, especially updated_pyproject_content at line 74, using the supplied pyproject.toml and updater log as the reproduction. Trace why updating black produces unchanged content, then verify that the dependency update no longer raises “Content did not change!”.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, ruby
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.