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

fix(workers/repository): Pass proper lockFiles in lockFileMaintenance #27319

Merged
merged 12 commits into from Feb 27, 2024

Conversation

not7cd
Copy link
Contributor

@not7cd not7cd commented Feb 15, 2024

Changes

#26858 introduced a regression. Because higher functions don't pass a lock files associated with a given package file, and UpdateArtifactsConfig has lock files from a first package file, lock file maintenance will ignore the rest.
The workaround used available packageFiles data associated to manager, and patched config passed to updateArtifacts

Context

@mbudnek has found this issue

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@not7cd
Copy link
Contributor Author

not7cd commented Feb 15, 2024

Hopefully it will ignore infered lock files if they don't exist

rarkins
rarkins previously approved these changes Feb 15, 2024
@not7cd
Copy link
Contributor Author

not7cd commented Feb 15, 2024

This workaround may break more things. Attempt 2 will require mayor refactor in tests and hack some data in managerData

@not7cd not7cd marked this pull request as ready for review February 15, 2024 13:30
@not7cd not7cd requested a review from rarkins February 15, 2024 13:30
@not7cd
Copy link
Contributor Author

not7cd commented Feb 15, 2024

Tested on a real repo
icetek-lab/renovate-case2#8

rarkins
rarkins previously approved these changes Feb 15, 2024
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

I don't really like this workaround 🤔

lib/workers/repository/update/branch/get-updated.ts Outdated Show resolved Hide resolved
lib/workers/repository/update/branch/get-updated.ts Outdated Show resolved Hide resolved
not7cd and others added 2 commits February 15, 2024 17:54
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
@not7cd
Copy link
Contributor Author

not7cd commented Feb 15, 2024

I still don't know what should I expect at the input of updateArtifacts. Current interface with package file name/path, it's contents and config is lacking. config seems to be this catch all bag of data, but seems fragile.

This whole workaround can be taken away from get-updated and into pip-compile. Because it looks like only pip-compile became dependent on config.lockFiles.

But putting some plumbing before updateArtifacts can enable its interface change before refactoring get-updated and further methods.

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Needs deconflicting

@not7cd not7cd requested a review from rarkins February 19, 2024 11:09
@not7cd not7cd changed the title fix(manager/pip-compile): Workaround for no lockFiles fix(manager/pip-compile): Pass proper lockFiles in lockfileMaintenance Feb 21, 2024
@not7cd not7cd changed the title fix(manager/pip-compile): Pass proper lockFiles in lockfileMaintenance fix(manager/pip-compile): Pass proper lockFiles in lockFileMaintenance Feb 21, 2024
@not7cd not7cd changed the title fix(manager/pip-compile): Pass proper lockFiles in lockFileMaintenance fix(workers/repository): Pass proper lockFiles in lockFileMaintenance Feb 21, 2024
@mbudnek
Copy link
Contributor

mbudnek commented Feb 26, 2024

@rarkins @viceice Any chance of getting this merged? This issue is currently blocking me from rolling renovate out to most of my team's python-based projects.

Co-authored-by: Rhys Arkins <rhys@arkins.net>
@rarkins rarkins added this pull request to the merge queue Feb 27, 2024
Merged via the queue into renovatebot:main with commit 3f315fb Feb 27, 2024
35 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.214.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@not7cd not7cd deleted the fix/no-lockfiles branch February 27, 2024 23:21
mbudnek added a commit to mbudnek/renovate that referenced this pull request Mar 12, 2024
This applies the fix from renovatebot#27319 to non-lockFileMaintanence updates so
that the correct lockFiles attribute gets passed to the manager's
updateArtifacts function when updating single dependencies.  Without
this change, the same lockFiles attribute gets passed along with every
packageFileName, which causes the pip-compile manager to update the same
lock file multiple times when a dependency is updated in multiple input
files.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants