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

Using a jsonpath array filter with GenericToml extra-file config does not find the relevant version #2455

Open
roberthjaplaio opened this issue Dec 18, 2024 · 0 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@roberthjaplaio
Copy link

I have a python project managed with uv where I specify a build system in the pyproject.toml file. When I do this, my application is "installed" into the environment and I receive a version number into the uv.lock file.

While updating a lock file generally is perhaps not my best idea, I decided to try it out anyway using the generic toml updater but it seems I am unable to use a jsonpath filter. I have verified that the jsonpath works when I convert the toml to json, but to my surprise the release-please cli and the release please github action both log out that nothing was found in the uv.lock file. (No entries modified in $.package[?(@.name==="app")].version)

I have tried specifying an absolute path from the root of the project ("/uv.lock"). I have tried escaping double quotes as well as using single quotes, I've tried == and === but no success.

Example minimum uv.lock file to reproduce:

version = 1
requires-python = ">=3.13"

[[package]]
name = "app"
version = "3.1.0"
source = { virtual = "." }

Environment details

  • OS: happens on OSX 15 and also the github action (v4)
  • Node.js version: 23.4.0
  • npm version: 10.9.2
  • release-please version: 16.15.0

Steps to reproduce

  1. using a release please config similar to this one:
{
"release-type": "python",
"packages": {
  ".": {
    "extra-files": [
      {
        "type": "toml",
        "path": "uv.lock",
        "jsonpath": "$.package[?(@.name==\"app\")].version"
      }
    ]
  }
}
}

Other attempted jsonpaths:

$.package[?(@.name==\"app\")].version
$.package[?(@.name=='app')].version
$.package[?(@.name===\"app\")].version
$.package[?(@.name==='app')].version
  1. run release-please using cli or in a github action

I understand my problem could be avoided through various means and supporting updating a lock file like this makes no sense for release-please. However it seems that the generic toml updater might be broken because this file is a valid toml file and does not get updated.

@roberthjaplaio roberthjaplaio added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants