Skip to content

Conversation

@deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Jun 18, 2024

What was the end-user or developer problem that led to this PR?

I tried to implement a more stable behavior for locking credentials in #7720, but I missed one case.

The problem is that in the "re-resolve without full unlock" case, the Source::Rubygems#remotes= setter is called twice, so original lockfile credentials are lost.

What is your fix for the problem, implemented in this PR?

My fix is to set original credentials only when parsing the lockfile initially, not every time sources are replaced, so that they are never overwritten.

Fixes #7761.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez merged commit 9c022dc into master Jun 20, 2024
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/keep-credentials-take-2 branch June 20, 2024 07:15
deivid-rodriguez added a commit that referenced this pull request Jun 20, 2024
…als-take-2

Fix credentials being readded when re-resolving without a full unlock

(cherry picked from commit 9c022dc)
@deivid-rodriguez deivid-rodriguez changed the title Fix credentials being readded when re-resolving without a full unlock Fix credentials being re-added when re-resolving without a full unlock Jun 20, 2024
@wlokes
Copy link

wlokes commented Jul 2, 2024

Running bundle lock ... (remove-platform and add-platform were used) causes credentials to be re-added.

@deivid-rodriguez
Copy link
Contributor Author

Hi @wlokes, thanks for letting me know. I did some testing and I was not able to reproduce. Are you sure you used the latest version of Bundler?

@wlokes
Copy link

wlokes commented Jul 2, 2024 via email

@deivid-rodriguez
Copy link
Contributor Author

No problem, let me know if you run into more issues!

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.

Credentials now readded from Gemfile.lock if they were removed in 2.5.11

3 participants