-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remove Bundler v1 Deprecation and Unsupported Feature Flags and Deactivate Bundler v1 CI Tests #10796
Remove Bundler v1 Deprecation and Unsupported Feature Flags and Deactivate Bundler v1 CI Tests #10796
Changes from 6 commits
bf12637
f7204ec
f443ea6
03370cb
d1b0e2d
7cfa07b
6fe8041
8501677
0cafd89
b2077fc
18bbf0a
37538e9
aa3bf2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,15 @@ function print_usage() { | |
|
||
function handle_args() { | ||
export SUITE_NAME=$1 | ||
case $SUITE_NAME in | ||
bundler1 | bundler2) | ||
export MODULE=bundler | ||
;; | ||
"") | ||
print_usage | ||
exit 1 | ||
;; | ||
*) | ||
export MODULE=$SUITE_NAME | ||
esac | ||
|
||
# Only allow "bundler" as a valid SUITE_NAME | ||
if [[ "$SUITE_NAME" != "bundler" ]]; then | ||
echo "Error: Only 'bundler' is allowed as SUITE_NAME." | ||
print_usage | ||
exit 1 | ||
fi | ||
|
||
export MODULE="bundler" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are removing bundler v1 from specs and replace suite name as |
||
|
||
if ! [ -d "$MODULE" ]; then | ||
print_usage | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ FROM ghcr.io/dependabot/dependabot-updater-core | |
USER dependabot | ||
|
||
COPY --chown=dependabot:dependabot bundler/helpers /opt/bundler/helpers | ||
RUN bash /opt/bundler/helpers/v1/build \ | ||
&& bash /opt/bundler/helpers/v2/build | ||
RUN bash /opt/bundler/helpers/v2/build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to build old bundler v1 code anymore |
||
|
||
COPY --chown=dependabot:dependabot bundler $DEPENDABOT_HOME/bundler | ||
COPY --chown=dependabot:dependabot common $DEPENDABOT_HOME/common | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,21 +20,17 @@ def self.bundler_version(lockfile) | |
|
||
if (matches = lockfile.content&.match(BUNDLER_MAJOR_VERSION_REGEX)) | ||
matches[:version].to_i >= 2 ? V2 : V1 | ||
elsif Dependabot::Experiments.enabled?(:bundler_v1_unsupported_error) | ||
DEFAULT | ||
else | ||
failover_version | ||
DEFAULT | ||
end | ||
end | ||
|
||
# If we are updating a project with a Gemfile.lock that does not specify | ||
# the version it was bundled with, we failover to V1 on the assumption | ||
# it was created with an old version that didn't add this information | ||
# the version it was bundled with, we failover to V2 | ||
# the version it was bundled with, we failover to V2 | ||
sig { returns(String) } | ||
def self.failover_version | ||
return V2 if Dependabot::Experiments.enabled?(:bundler_v1_unsupported_error) | ||
|
||
V1 | ||
V2 | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are going to always return bundler v2 except if version defined lower than version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is removed. |
||
|
||
sig { params(lockfile: T.nilable(Dependabot::DependencyFile)).returns(String) } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,7 @@ bundle exec turbo_tests --verbose | |
# NOTE: Don't use `if` branches without `else` part, since the code in some of | ||
# then seems to not abort the script regardless of `set -e` | ||
|
||
if [[ "$SUITE_NAME" == "bundler1" ]]; then | ||
# shellcheck source=../helpers/v1/build | ||
DEPENDABOT_NATIVE_HELPERS_PATH="" source helpers/v1/build \ | ||
&& BUNDLER_VERSION=1.17.3 ./patched_bundler exec rspec spec\ | ||
&& cd - | ||
else | ||
# shellcheck source=../helpers/v2/build | ||
DEPENDABOT_NATIVE_HELPERS_PATH="" source helpers/v2/build \ | ||
&& bundle exec rspec spec \ | ||
&& cd - | ||
fi | ||
# shellcheck source=../helpers/v2/build | ||
DEPENDABOT_NATIVE_HELPERS_PATH="" source helpers/v2/build \ | ||
&& bundle exec rspec spec \ | ||
&& cd - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only need to run specs for bundler v2 version. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,32 +172,7 @@ | |
|
||
its(:length) { is_expected.to eq(5) } | ||
|
||
describe "an untagged dependency", :bundler_v1_only do | ||
subject { dependencies.find { |d| d.name == "uk_phone_numbers" } } | ||
|
||
let(:expected_requirements) do | ||
[{ | ||
requirement: ">= 0", | ||
file: "Gemfile", | ||
source: { | ||
type: "git", | ||
url: "https://github.com/dependabot-fixtures/uk_phone_numbers", | ||
branch: nil, | ||
ref: "master" | ||
}, | ||
groups: [:default] | ||
}] | ||
end | ||
|
||
it { is_expected.to be_a(Dependabot::Dependency) } | ||
its(:requirements) { is_expected.to eq(expected_requirements) } | ||
|
||
its(:version) do | ||
is_expected.to eq("1530024bd6a68d36ac18e04836ce110e0d433c36") | ||
end | ||
end | ||
|
||
describe "an untagged dependency", :bundler_v2_only do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need bundler v1 only specs anymore |
||
describe "an untagged dependency" do | ||
subject { dependencies.find { |d| d.name == "uk_phone_numbers" } } | ||
|
||
let(:expected_requirements) do | ||
|
@@ -247,34 +222,7 @@ | |
end | ||
end | ||
|
||
describe "a github dependency", :bundler_v1_only do | ||
subject { dependencies.find { |d| d.name == "business" } } | ||
|
||
let(:dependency_files) { bundler_project_dependency_files("github_source") } | ||
|
||
let(:expected_requirements) do | ||
[{ | ||
requirement: ">= 0", | ||
file: "Gemfile", | ||
source: { | ||
type: "git", | ||
url: "https://github.com/dependabot-fixtures/business.git", | ||
branch: nil, | ||
ref: "master" | ||
}, | ||
groups: [:default] | ||
}] | ||
end | ||
|
||
it { is_expected.to be_a(Dependabot::Dependency) } | ||
its(:requirements) { is_expected.to eq(expected_requirements) } | ||
|
||
its(:version) do | ||
is_expected.to eq("d31e445215b5af70c1604715d97dd953e868380e") | ||
end | ||
end | ||
|
||
describe "a github dependency", :bundler_v2_only do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need bundler v1 only specs anymore |
||
describe "a github dependency" do | ||
subject { dependencies.find { |d| d.name == "business" } } | ||
|
||
let(:dependency_files) { bundler_project_dependency_files("github_source") } | ||
|
@@ -301,31 +249,7 @@ | |
end | ||
end | ||
|
||
context "with a subdependency of a git source", :bundler_v1_only do | ||
subject { dependencies.find { |d| d.name == "kaminari-actionview" } } | ||
|
||
let(:dependency_files) { bundler_project_dependency_files("git_source_undeclared") } | ||
|
||
let(:expected_requirements) do | ||
[{ | ||
requirement: ">= 0", | ||
file: "Gemfile", | ||
source: { | ||
type: "git", | ||
url: "https://github.com/dependabot-fixtures/kaminari", | ||
branch: nil, | ||
ref: "master" | ||
}, | ||
groups: [:default] | ||
}] | ||
end | ||
|
||
it { is_expected.to be_a(Dependabot::Dependency) } | ||
its(:name) { is_expected.to eq("kaminari-actionview") } | ||
its(:requirements) { is_expected.to eq(expected_requirements) } | ||
end | ||
|
||
context "with a subdependency of a git source", :bundler_v2_only do | ||
context "with a subdependency of a git source" do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need bundler v1 only specs anymore |
||
subject { dependencies.find { |d| d.name == "kaminari-actionview" } } | ||
|
||
let(:dependency_files) { bundler_project_dependency_files("git_source_undeclared") } | ||
|
@@ -589,48 +513,6 @@ | |
end | ||
end | ||
|
||
context "with an unparseable git dep that also appears in the gemspec", :bundler_v1_only do | ||
let(:dependency_files) { bundler_project_dependency_files("git_source_unparseable") } | ||
|
||
it "includes source details on the gemspec requirement" do | ||
expect(dependencies.map(&:name)).to match_array(%w(business)) | ||
expect(dependencies.first.name).to eq("business") | ||
expect(dependencies.first.version) | ||
.to eq("1378a2b0b446d991b7567efbc7eeeed2720e4d8f") | ||
expect(dependencies.first.requirements) | ||
.to contain_exactly({ | ||
file: "example.gemspec", | ||
requirement: "~> 1.0", | ||
groups: ["runtime"], | ||
source: { | ||
type: "git", | ||
url: "git@github.com:dependabot-fixtures/business", | ||
branch: nil, | ||
ref: "master" | ||
} | ||
}) | ||
end | ||
|
||
it "includes source details on the gemspec requirement", :bundler_v2_only do | ||
expect(dependencies.map(&:name)).to match_array(%w(business)) | ||
expect(dependencies.first.name).to eq("business") | ||
expect(dependencies.first.version) | ||
.to eq("1378a2b0b446d991b7567efbc7eeeed2720e4d8f") | ||
expect(dependencies.first.requirements) | ||
.to contain_exactly({ | ||
file: "example.gemspec", | ||
requirement: "~> 1.0", | ||
groups: ["runtime"], | ||
source: { | ||
type: "git", | ||
url: "git@github.com:dependabot-fixtures/business", | ||
branch: nil, | ||
ref: nil | ||
} | ||
}) | ||
end | ||
end | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need bundler v1 only specs anymore |
||
context "with two gemspecs" do | ||
let(:dependency_files) { bundler_project_dependency_files("imports_two_gemspecs") } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove bundler1 from test suites