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

Update the uv LockFileUpdater regex #11810

Merged
merged 1 commit into from
Mar 13, 2025
Merged

Conversation

markhallen
Copy link
Contributor

What are you trying to accomplish?

There is a regex error thrown when parsing uv.lock files.

Follows #11795

Anything you want to highlight for special attention from reviewers?

We replicated the issue and tested the solution using a dry run:

./bin/dry-run.rb uv dsp-testing/dependabot-uv

Failing dry run output
/home/dependabot/uv/lib/dependabot/uv/file_updater/lock_file_updater.rb:191:in `declaration_regex': end pattern with unmatched parenthesis: / (RegexpError)
          \[project\]\s*(?:\s*#.*?)*?\n.*?
          (?<declaration>
            (?:^\s*|["'])requests["']?\s*=\s*["'].*?==2\.31\.0["']
          )
          .*$
        /mix
      from /home/dependabot/uv/lib/dependabot/uv/file_updater/lock_file_updater.rb:88:in `replace_dep'
      from /home/dependabot/uv/lib/dependabot/uv/file_updater/lock_file_updater.rb:76:in `block in updated_pyproject_content'
      from /home/dependabot/uv/lib/dependabot/uv/file_updater/lock_file_updater.rb:73:in `each'
      from /home/dependabot/uv/lib/dependabot/uv/file_updater/lock_file_updater.rb:73:in `updated_pyproject_content'
      from /home/dependabot/uv/lib/dependabot/uv/file_updater/lock_file_updater.rb:52:in `fetch_updated_dependency_files'
      from /home/dependabot/uv/lib/dependabot/uv/file_updater/lock_file_updater.rb:35:in `updated_dependency_files'
      from /home/dependabot/uv/lib/dependabot/uv/file_updater.rb:78:in `updated_uv_lock_files'
      from /usr/local/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `bind_call'
      from /usr/local/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `validate_call'
      from /usr/local/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
      from /home/dependabot/uv/lib/dependabot/uv/file_updater.rb:32:in `updated_dependency_files'
      from /usr/local/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `bind_call'
      from /usr/local/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `validate_call'
      from /usr/local/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
      from bin/dry-run.rb:739:in `block in <main>'
      from bin/dry-run.rb:647:in `each'
      from bin/dry-run.rb:647:in `<main>'
[dependabot-core-dev] ~ $ 

How will you know you've accomplished your goal?

We successfully completed the previously failing dry run: ./bin/dry-run.rb uv dsp-testing/dependabot-uv.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@markhallen markhallen requested a review from a team as a code owner March 13, 2025 14:12
robaiken
robaiken previously approved these changes Mar 13, 2025
@markhallen markhallen merged commit 3406644 into main Mar 13, 2025
62 checks passed
@markhallen markhallen deleted the markhallen/fix-uv-regex branch March 13, 2025 15:09
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.

2 participants