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

Remove Bundler v1 Deprecation and Unsupported Feature Flags and Deactivate Bundler v1 CI Tests #10796

Merged
merged 13 commits into from
Oct 16, 2024

Conversation

kbukum1
Copy link
Contributor

@kbukum1 kbukum1 commented Oct 15, 2024

What are you trying to accomplish?

This PR removes the feature flags associated with the deprecation and unsupported status of Bundler v1 and deactivates Bundler v1 CI tests. With these changes, our CI pipeline focuses exclusively on Bundler v2 as the primary supported version. This is part of a gradual approach to phasing out Bundler v1 without immediately removing its code, helping to simplify the test suite by prioritizing Bundler v2.

Anything you want to highlight for special attention from reviewers?

This PR deactivates Bundler v1 CI tests and removes related feature flags, but it does not remove Bundler v1 code. This helps maintain a stable test environment with Bundler v2 set as the default in CI while marking Bundler v1 as inactive.

How will you know you've accomplished your goal?

  • Confirm that all Bundler v1 CI tests are disabled.
  • Ensure that the removal of Bundler v1 deprecation and unsupported feature flags is complete.
  • Verify that the CI pipeline now runs exclusively with Bundler v2, with no impact on test performance or coverage.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@github-actions github-actions bot added the L: ruby:bundler RubyGems via bundler label Oct 15, 2024
@kbukum1 kbukum1 changed the title Remove Bundler v1 deprecation and unsupported feature flags, deactivate Bundler v1 CI tests, and update Bundler specs Deactivate Bundler v1 CI tests Oct 15, 2024
@kbukum1 kbukum1 force-pushed the kamil/deactivate_bundler_v1_code branch from f8bc272 to 256dbd4 Compare October 16, 2024 00:31
@kbukum1 kbukum1 force-pushed the kamil/deactivate_bundler_v1_code branch from 256dbd4 to bf12637 Compare October 16, 2024 00:44
@kbukum1 kbukum1 changed the title Deactivate Bundler v1 CI tests Remove Deprecation&Unsupported Feature Flags and Deactivate Bundler v1 CI tests Oct 16, 2024
@kbukum1 kbukum1 changed the title Remove Deprecation&Unsupported Feature Flags and Deactivate Bundler v1 CI tests Remove Bundler v1 Deprecation and Unsupported Feature Flags and Deactivate Bundler v1 CI Tests Oct 16, 2024
@@ -15,8 +15,7 @@ jobs:
fail-fast: false
matrix:
suite:
- { path: bundler, name: bundler1, ecosystem: bundler }
- { path: bundler, name: bundler2, ecosystem: bundler }
- { path: bundler, name: bundler, ecosystem: bundler }
- { path: cargo, name: cargo, ecosystem: cargo }
Copy link
Contributor Author

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

exit 1
fi

export MODULE="bundler"
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 bundler which is going to run specs for bundler v2 directly.

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need to build old bundler v1 code anymore

return V2 if Dependabot::Experiments.enabled?(:bundler_v1_unsupported_error)

V1
V2
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 2. When version is lower than version 2 we assume it is going to be V1 and our unsupported error is going to throw error for that.

Copy link
Member

Choose a reason for hiding this comment

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

Is failover_version being used anywhere now? Maybe it can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is removed.

# shellcheck source=../helpers/v2/build
DEPENDABOT_NATIVE_HELPERS_PATH="" source helpers/v2/build \
&& bundle exec rspec spec \
&& cd -
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only need to run specs for bundler v2 version.

end
end

describe "an untagged dependency", :bundler_v2_only do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need bundler v1 only specs anymore

end
end

describe "a github dependency", :bundler_v2_only do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need bundler v1 only specs anymore

end

context "with a subdependency of a git source", :bundler_v2_only do
context "with a subdependency of a git source" do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need bundler v1 only specs anymore

})
end
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need bundler v1 only specs anymore

end

it "does not touch the yanked gem", :bundler_v2_only do
it "does not touch the yanked gem" do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need bundler v1 only specs anymore

end

it "preserves the BUNDLED WITH line in the lockfile", :bundler_v2_only do
it "preserves the BUNDLED WITH line in the lockfile" do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need bundler v1 only specs anymore

end

it "returns the latest version", :bundler_v2_only do
it "returns the latest version" do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need bundler v1 only specs anymore

# Check if the feature flag for Bundler v1 unsupported error is enabled.
return false unless name == "bundler" && Dependabot::Experiments.enabled?(:bundler_v1_unsupported_error)

version < supported_versions.first
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since bundler_v1 unsupported error is activated and stable we don't need feature flag to check it anymore.

expect(mock_error_handler).to receive(:handle_dependency_error).with(error: error, dependency: dependency)
perform
end
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We removed this test because unsupported error is moved on parent file update file command instead of in operation. The unsupported error will be thrown before operation.perform is called.

expect(mock_error_handler).to receive(:handle_dependency_error).with(error: error, dependency: dependency)
perform
end
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We removed this test because unsupported error is moved on parent file update file command instead of in operation. The unsupported error will be thrown before operation.perform is called.

@kbukum1 kbukum1 marked this pull request as ready for review October 16, 2024 17:40
@kbukum1 kbukum1 requested a review from a team as a code owner October 16, 2024 17:40
@kbukum1 kbukum1 marked this pull request as draft October 16, 2024 17:40
@kbukum1 kbukum1 marked this pull request as ready for review October 16, 2024 18:05
Copy link
Member

@jakecoffman jakecoffman left a comment

Choose a reason for hiding this comment

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

Much easier to review now that the other changes were in a separate PR, thank you!

@kbukum1
Copy link
Contributor Author

kbukum1 commented Oct 16, 2024

easier to review now t

Thanks for the review and all the help.

@kbukum1 kbukum1 merged commit b6d3c5a into main Oct 16, 2024
142 checks passed
@kbukum1 kbukum1 deleted the kamil/deactivate_bundler_v1_code branch October 16, 2024 19:02
@kbukum1 kbukum1 self-assigned this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: ruby:bundler RubyGems via bundler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants