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

Re-resolve when lockfile is invalid #7020

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Sep 30, 2023

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

Sometimes, even if we give a warning about it, we may end up installing gems incompatible with each other.

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

My fix is to move the check for unmet dependencies in lockfile just in time to be able to re-resolve if unmet dependencies are found.

Still missing a spec.

Make sure the following tasks are checked

Move the check for unmet dependencies in lockfile just in time to be
able to re-resolve if unmet dependencies are found.
Copy link
Member

@martinemde martinemde left a comment

Choose a reason for hiding this comment

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

This looks like a much better approach.

@deivid-rodriguez
Copy link
Member Author

Thanks @martinemde!

@deivid-rodriguez deivid-rodriguez merged commit 956ecb8 into master Oct 3, 2023
92 checks passed
@deivid-rodriguez deivid-rodriguez deleted the reresolve-when-lockfile-is-invalid branch October 3, 2023 10:51
@etiennebarrie
Copy link

Tested this and it works great, I get a non-zero exit status code (6 for some reason, I don't think that's publicly documented), the error message is really good. Thank you!

I don't see anything checking the return value explicitly in the spec though, the raise_on_error: false allows the command to fail but does not make sure it does.

Also while looking into this, I found this, which sounds 6 shouldn't go all the way to the exit status of the command:

# Internal error, should be rescued
class SolveFailure < BundlerError; status_code(6); end

@deivid-rodriguez
Copy link
Member Author

You're right, happy to take a PR to add that assertion. We have helpers for checking that no gems were installed, and also for checking that the last command returned a failed status.

deivid-rodriguez added a commit that referenced this pull request Oct 13, 2023
…alid

Re-resolve when lockfile is invalid

(cherry picked from commit 956ecb8)
deivid-rodriguez added a commit that referenced this pull request Oct 13, 2023
…alid

Re-resolve when lockfile is invalid

(cherry picked from commit 956ecb8)
deivid-rodriguez added a commit that referenced this pull request Oct 13, 2023
…alid

Re-resolve when lockfile is invalid

(cherry picked from commit 956ecb8)
deivid-rodriguez added a commit that referenced this pull request Oct 16, 2023
…alid

Re-resolve when lockfile is invalid

(cherry picked from commit 956ecb8)
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.

None yet

3 participants