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 git source lockfile instability #6786

Merged
merged 3 commits into from Jun 30, 2023
Merged

Conversation

deivid-rodriguez
Copy link
Member

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

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

Sometimes Bundler may print inconsistent git source ordering to the lockfile.

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

We have some flags that limit running git commands under certain situations, for example, when running under --local. However, those should only affect remote git operations, not local read-only operations like git --version, or git rev-parse --abbrev-ref HEAD.

This commit refactors things to achieve that.

By doing this, the #to_s representation of a source is more consistent, since we don't get any errors when reading the checked out branch, and we avoid some flip-flop lockfile issues.

Fixes #6743.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez force-pushed the fix-git-sources-stability branch 2 times, most recently from 56993a3 to a1858ef Compare June 30, 2023 14:58
We have some flags that limit running git commit commands under certain
situations, for example, when running under `--local`. However, those
should only affect remote git operations, not local read-only operations
like `git --version`, or `git rev-parse --abbrev-ref HEAD`.

This commit refactors things to achieve that.

By doing this, the `#to_s` representation of a source is more
consistent, since we don't get any errors when reading the checked out
branch, and we avoid some flip-flop lockfile issues.
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review June 30, 2023 16:16
@deivid-rodriguez deivid-rodriguez changed the title Fix git source lockfile unstability Fix git source lockfile instability Jun 30, 2023
@duckinator
Copy link
Member

Added a test. Currently waiting for CI to finish. If CI is happy, I'll go ahead and merge it.

@duckinator duckinator merged commit 163a104 into master Jun 30, 2023
92 checks passed
@duckinator duckinator deleted the fix-git-sources-stability branch June 30, 2023 23:36
deivid-rodriguez pushed a commit that referenced this pull request Jul 6, 2023
Fix git source lockfile instability

(cherry picked from commit 163a104)
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.

Git sources sorting isn't stable
2 participants